Skip to Content
File to JDBC Adapter using SAP XI
Author Anirban Ghatak
Version 1.0
Introduction:
The document deals with the integration scenario involving File to JDBC adapter communication using SAP XI. File adapter is used to read the data from xml source. JDBC adapter is used to push the data to Database.
Prerequisites:
a> Database table with the following fields:
EMPID: varchar 1
EMPNAME: varchar 1
EMPAGE: Integer
FLAG: Char 1
b> Two business systems are required to be configured of type 3rd party (in SLD). ‘Service’ parameter to be set as ‘Service without party’.
c> FTP configuration should be in place.

Configuration steps in Integration Repository
1> Create two data types: data_filesender and data_jdbcreceiver as shown in the following figure.
image
Similarly the second data type as shown in the following figure:
image
2> Create two Message type for the data types we created in the step 1 as: data_filesender and data_jdbcreceiver. Figure below is the actual screenshot as a sample.

image
And similarly the second message type.
image
3> Create the Message Interface: mi_file and mi_jdbc as shown below in the figure:
image
For the File system in DEFINITION tab check radio button Inbound for Category. Mode value should be Asynchronous. For the receiver, Category should be Inbound and Mode should be Asynchronous.
image
4> Now create the Message Mapping as mm_file_jdbc, make sure the table is created prior to this and the action field is hard coded with “insert” value under CONSTANT function. Please refer to the figure below.
image
image
5> Now create the Interface Mapping mi_file_jdbc. We make sure to select the correct mapping Program.
image

Configuration steps in Integration Depository
1>As a first step create two Communication channel,
cc_file_sender and cc_jdbc_receiver as shown in the figure below. Make sure that the Service selected is of 3rd party in system landscape directory.
Set Processing Mode value as delete (this option will delete the file once it is read by SAP XI adapter) and transfer mode as binary.
image
Similarly configure the Receiver channel. Use the JDBC 2.0 Transport protocol. Make sure that connection parameter has your local machine name.
image
2> Now create the Sender Agreement connecting to the channel of sender as shown in figure below:
image
Now create the Receiver Determination as shown in the figure below:
image
3> Configure the Interface Determination as shown in the figure below:
image
4> As a last step create the Receiver Agreement as shown in the figure below:
image

This completes configuration with Integation Repository and Intregation Directory.

Testing:
• Log in to Adapter monitor and check for the File adapter and Jdbc adapter.The status should be green.
• Insert the source xml in the root folder path of the FTP adapter that you used. It will be detected and deleted according to the time set in your polling interval.
• Check message and flag status in SXMB_MONI. A chequered flag should be present.
• Log in to SQL Studio and look for your table under the DBA path (or the path you used to create the table), and right click->show content for the values, you should get the new values as shown in the slide below:
image
It should reflect the new values in the tuple of the table that we have created .This is shown in the slide below.
image

That’s the &#146File-xi-Jdbc scenario&#146.

To report this post you need to login first.

12 Comments

You must be Logged on to comment or reply to a post.

  1. Matt Jordan
    Hello Anirban – ExcelBlog ! How do I set std parameters for JDBC connection like initial connections, connection time out, max connections etc ?

    M

    (0) 
  2. R.Manoj Kumar
    hi,

    its really good one.
    can u give idea about how to find out the driver and connections for sql and MS access data base. to mention in adapter communication channel.

    somebody are giving different drivers and connectins for MS access. please send to manoj.r@hcl.in

    (0) 
    1. kalyan golla
      hi manoj,

      i am using mysql for file to jdbc scenario. now what is the jdbc driver to be used, how should i setup the jdbc drivers.

      kalyan.

      (0) 
    2. kalyan golla
      hi manoj,

      i am using mysql for file to jdbc scenario. now what is the jdbc driver to be used, how should i setup the jdbc drivers.

      kalyan.

      (0) 
  3. Anonymous
    I have a CSV file that contains multipy records, but only one the first record is getting inserted into the database?  Any help would be greatly apprecitaed.

    Thanks
    Skip Ford

    (0) 

Leave a Reply