cancel
Showing results for 
Search instead for 
Did you mean: 

Best approach for IDOC - JDBC scenario

Former Member
0 Kudos

Hi,

In my scenarion I am creating sales order(ORDERS04) in R/3 system and which need to be replicated in a SQL Server system. I am sending the order to XI as an IDoc and want to use JDBC for sending data to SQL Server. I need to insert data in two tables(header & details). Is it possible without BPM? Or what is the best approach for this?

Thanks,

Sri.

Accepted Solutions (0)

Answers (5)

Answers (5)

STALANKI
Active Contributor
0 Kudos

try this blog for stored procedures.

/people/sriram.vasudevan3/blog/2005/02/14/calling-stored-procs-in-maxdb-using-sap-xi

Former Member
0 Kudos

I Sri,

Yes this is possible without BPM.

You can use asynchronous communication for this.

Since you want to update data in two table , design your Message type for JDBC in such a way that you can fire two statements . Thus additional effort you need to do only on message type and message mapping.

Please refer to the following link for more details on JDBC specific message format ,it also says that you can update more than one table simultaneously.

http://help.sap.com/saphelp_nw2004s/helpdata/en/22/b4d13b633f7748b4d34f3191529946/frameset.htm

regards,

yomesh

Former Member
0 Kudos

Hi Sri,

On the JDBC end you can write a stored procedure to make your data update more efficient.

Regards

Vijaya

Former Member
0 Kudos

Hi,

If I am writing a stored procedute to insert data into two tables, How to handle the item detail data inside stored procedure, as occurence will be '0....unbounded' in this case.

Please advice.

Thanks,

Sri.

bhavesh_kantilal
Active Contributor
0 Kudos

Hi,

<i>as occurence will be '0....unbounded' in this case.</i>

just make the occurence of the STATEMENT to be 0 to unbounded in your JDBC datatype and map each occurence of the DETAIL to the STATEMENT tag.

Just remember ACTION attribute will be EXECUTE for a stored porcedure.

<StatementName5>

<storedProcedureName action=” EXECUTE”>

<table>realStoredProcedureeName</table>

<param1 [isInput=”true”] [isOutput=true] type=SQLDatatype>val1</param1>

</storedProcedureName >

</StatementName5>

http://help.sap.com/saphelp_nw04/helpdata/en/2e/96fd3f2d14e869e10000000a155106/content.htm

Regards,

Bhavesh

Former Member
0 Kudos

Hi,

Now I am trying transfer data from an ORDERS04 IDoc to two tables in SQL Server table. Occurence of the STATEMENT is 0...unbounded. Still it does not update the all item record in item table of SQL Server. It just update the first item record in the table. Is there any different approach available for this?

Thanks,

Sri.

Jitendra_Jeswan
Contributor
0 Kudos

If u want to Update Two Tables, then u need to have Two Statements in the Document Format (action attribute need not be same), one for Each table and the Corresponding Access tags which shud resemble ur Table Fields(need not be same)

Map the Idoc Fields to Access Fields and u r done.

Try this and let us knw if u have any issues regarding this

thanks

Jeet.

bhavesh_kantilal
Active Contributor
0 Kudos

Yes, this is possible without the BPM.

Just create the Corresponding Datatype for the insertion.

if the records to be inserted are different, then there wil be 2 different datatypes ( one for header and one for detail).

Do a mutlimapping, where your Source is mapped into the header and details datatype and then send using the JDBC sender adapter.

For the strucutre of your Datatype for insertion , just check this link,

http://help.sap.com/saphelp_nw04/helpdata/en/7e/5df96381ec72468a00815dd80f8b63/content.htm

To access any Database from XI, you will have to install the corresponding Driver on your XI server.

https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/3867a582-0401-0010-6cbf-964...

Regards,

Bhavesh

Former Member
0 Kudos

Sri,

I think you don't need BPM in your scenario. You can use the Idoc Adapter on the sender side and JDBC on the reciever side. After you have configured your scenario, you shoudl be able to write data into the tables.