cancel
Showing results for 
Search instead for 
Did you mean: 

File to JDBC(multiple tables)

Former Member
0 Kudos

hi experts,

i am doing file to jdbc scenario.

for example the file contents are

<emp>

<empid/>

<empname/>

<address>

<addressone>

<eid></eid>

<homecity></homecity>

<homestate></homestate>

</addressone>

<addresstwo>

<eid></eid>

<homecity></homecity>

<homestate></homestate>

</addresstwo>

</address>

</emp>

in this i want to insert employee information into 'employee' table with columns

(empid,empname) and insert address related data into 'empaddress' table with columns(empid,city,state).

can anybody tell how to map the columns.

Accepted Solutions (0)

Answers (3)

Answers (3)

baskar_gopalakrishnan2
Active Contributor
0 Kudos

>in this i want to insert employee information into 'employee' table with columns

(empid,empname) and insert address related data into 'empaddress' table with columns(empid,city,state).

Basically you need to create two select statment for two inserts in one data structure. BPM is not required. Please follow the jdbc reciever structure sap help ink. That is more than sufficient. Since you do asynchronous , your scenario is not complex.

Note: If u construct both inserts as explained above with 2 statement inside one jdbc data structure, if the first insert fails due to some backend issues then the second issue will not proceed. Because JDBC adapter handle this entire as one transaction.

That is advantage too.

Example:

Refer this [link |http://help.sap.com/saphelp_nw04/helpdata/en/64/ce4e886334ec4ea7c2712e11cc567c/content.htm]for configuration

To create data structure example as follow...

<dt_dbinsert>
<StatementName1>
<table>employee</table>
<dbTableName action=u201DINSERTu201D>
<access>
<col1>val1</col1>
<col2>val2</col2>
</access>
</dbTableName>
</StatementName1>
<StatementName2>
<table>empaddress</table>
<dbTableName action=u201DINSERTu201D>
<access>
<col1>val1</col1>
<col2>val2</col2>
</access>
</dbTableName>
</StatementName2>
</db_dbinsert>

Refer this [link |http://help.sap.com/saphelp_nw70ehp1/helpdata/en/4d/8c103e05df2e4b95cbcc68fed61705/content.htm]also

Former Member
0 Kudos

I agree with Baskar.

Another solution is to achieve this requirement by using a Stored Procedure for better performance (less use of db sessions)

Former Member
0 Kudos

I thinki you should use BPM.

former_member529475
Active Contributor
0 Kudos

HI Rama Rao

First you need to install the drivers in XI. Ask your basis guys to install the drivers. Then you can proceed further.

Go through the weblog given by pooja. Apart from this see this weblogs which may help you:

/people/sameer.shadab/blog/2005/10/24/connecting-to-ms-access-using-receiver-jdbc-adapter-without-dsn

/people/yining.mao/blog/2006/09/13/tips-and-tutorial-for-sender-jdbc-adapter

Try these links:

/people/sap.user72/blog/2005/06/01/file-to-jdbc-adapter-using-sap-xi-30

And generalised data types:

/people/alessandro.berta/blog/2005/10/04/save-time-with-generalized-jdbc-datatypes

which can be used for any jdbc operations(ie foe insert/update/delete).

Cheers..

Vasu

<REMOVED BY MODERATOR>

Edited by: Prateek Raj Srivastava on May 22, 2011 10:57 AM