Skip to Content
Author's profile photo Former Member

Read Excel instead of XML through FileAdapter

Is there a restriction that a file adapter can read only xml files? You will say a ‘NO’ after you read this blog.    This blog is a very simple example about how to read data from an external source like excel and pass it into the Adapter Framework. After reading this blog you will find the real use of modules and ask yourself the need for an adapter for JDBC, JMS, Http etc (Just Kidding).   h3. A little bit of theory     Here is the design of the process.   image    The diagram explains about the FileAdapter Sender which gets the excel as input and sends the fetched data to the module in Module Processor. It is here the Excel Module gets called. Similarly, the FileAdapter Receiver gives the output as XML. The module can be place anywhere (rewriting the code accordingly), ie., in Sender or Receiver according to the need.   Required JAR File   **  jxl.jar +(Java Excel API – open source Java API)+     Assuming, you have little knowledge about modules let’s go directly into the coding part of Excel Module. Please note that most of the coding part are stripped for simplicity. The process function of the Excel Module for File Adapter is as follows.     h3. The process function        h3. Configuration in Integration Directory    The configuration on Sender Communication Channel (Integration Directory) is as follows. The key things to note are that the Adapter used is a FileAdapter and the file is an Excel File.   image   The following configuration is for the module part, where I specified the Module Bean.  image

Assigned Tags

      13 Comments
      You must be Logged on to comment or reply to a post.
      Author's profile photo Michal Krawczyk
      Michal Krawczyk
      Hi,

      nice one (excel idea) Felix,
      but let's not propose creating JMS adaptes
      as modules to the file adapter:)

      Regards,
      michal

      Author's profile photo Former Member
      Former Member
      Michal,
      It's just an idea 😉
      Regards,
      Felix
      Author's profile photo Former Member
      Former Member
      Hi Felix,

      Great weblog, however I was wondering if you could include a little bit more information about how to setup this module? You also state that the code shown is only a small part of the module, what else is required?

      thx,
      Jason.

      Author's profile photo Former Member
      Former Member
      Jason,
      Setting up this module is no different from setting up any module. Also, the code provided is the most important part in that module. I also felt that setting up a module is out of the scope of this weblog.
      Regards,
      Felix
      Author's profile photo Former Member
      Former Member
      Hi Felix, is there any chance you could maybe describe the process of setting up a module in a further weblog or forum post...
      Author's profile photo Former Member
      Former Member
      Ya sure. 🙂 Watch for my future blogs...
      Author's profile photo Former Member
      Former Member
      Author's profile photo Former Member
      Former Member
      Is there an new location for this document. The link

      https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/xi/xi%20code%20samples/how%20to%20develop%20a%20module%20for%20reading%20file%20name%20in%20a%20sender%20file%20adapter%20xi%203.0.pdf

      is not working anylonger ... or is there another place to find out how to set up a custom module for XI using NetWeaver Developer Studio.

      Thanks,

      Marc

      Author's profile photo Former Member
      Former Member
      I just found the answer to my own question:

      The document below provides a good guide of the basic steps that are necessary to setup a module.

      https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/da5675d1-0301-0010-9584-f6cb18c04805

      Marc

      Author's profile photo Former Member
      Former Member
      Blog Post Author
      It's a very good blog...:)

      Cheers
      Sudhir

      Author's profile photo Former Member
      Former Member
      Hi Felix, Nice blog. One issue i foresee is the support of Excel "versions" by the open source API. It may happen that you may receive an excel file created by an external party in production env , however that particular version of MS-Excel was not supported by the API and because of which it failed(assuming a worst case scenario). Anyways it is a call to be made on a NEED basis 🙂

      Thanks
      Saravana

      Author's profile photo Former Member
      Former Member
      hai

      well after reading this blog i can understand need of module, so we are using modues to add extra functionality to adapters

      byee

      Author's profile photo Former Member
      Former Member
      Hi Felix,

      Thanks for your blog. I'm new to using Modules in the Adapter Framework, and wanted your opinion on 2 conversion scenarios:

      1) Conversion from XLS to CSV using a File Adapter?

      2). Conversion from non_ASCII character sets to ASCII character sets, again using the File Adapter?

      Many thanks in advance!

      Reuben.