cancel
Showing results for 
Search instead for 
Did you mean: 

DB2 Table update

former_member203627
Participant
0 Kudos

Hi

I am working on a scenario SAP->XI->DB2, I have establish connection between XI and DB2 by using JDBC adapter by using special driver.

Now DB2 is expecting to trigger the stored procedure. I am confused how this can be achieved.

Can anyone explain me what happens when we need to update the table directly from XI message.

Regards

Hema

Accepted Solutions (0)

Answers (2)

Answers (2)

former_member203627
Participant
0 Kudos

So is there any procedure needs to be trigger in DB2 or not.

Former Member
0 Kudos

Hi Ria,

In DB2 it is not required. XI will do it, once the receiver JDBC adapter is configured.

http://help.sap.com/saphelp_nw70/helpdata/EN/22/b4d13b633f7748b4d34f3191529946/content.htm

-Regards

Shamly.

Former Member
0 Kudos

Hi Ria,

When you need to send data from SAP to DB2 via XI, First you have to map the SAP message to DB2 table fields. Use graphical mapping.

The receiver DB2 structure has a standard format , one of them i have mentioned below. There are others too.

Let table name = Employee

Fields = Field1, field2...etc

In the below statement tag you need to add an attribute action and hardcode in your mapping as INSERT. This will generate an SQL to insert into your database table. Map the node which has the set of records from SAP to access tag and the rest to the required appropriate fields.

<ns0:MT_Employee xmlns:ns0="urn:damm.com/pi/EmployeeMasterData">

<STATEMENT>

<Emplolyee action="INSERT">

<access>

<FIELD1>

<FIELD2>

<FIELD3>

<FIELD4>

</access>

</Employee>

</STATEMENT>

</ns0:MT_XMLSQL_SPEC>

-Regards,

Shamly.

Former Member
0 Kudos

HI,

Apart from the standard format told by SAP using statement command and action we can wite query in the graphical mapping and then map it to the action keyword.

1) write insert query in a constant box and map it to action. you can also mention stored procedure in the constant

2) all the data fields which you want to insert should be present under Key fields.

This is the most easiest method and it always works.

Kulwinder

Reward points if helpful

former_member203627
Participant
0 Kudos

Since I have two steps to do Insert the record in table and then trigger the stored procedure, I have done the mapping for stored procedure.

Please let me know do I need to have two seperate communication channles for Insert and stored procedure?

Regards

Former Member
0 Kudos

I dont understand your requirement. When you already have a SP why do you need to insert a record in the db and then invoke the SP? Instead pass the values of the record to be inserted in the db to the SP and let the SP do the insert first and then carry out the rest of operations.

Regards,

Jaishankar

former_member203627
Participant
0 Kudos

Sorry I think I didn't explain properly

I need to insert record in the table and then execute the SP so that SP can trigger DB2 program.

I hope now I have made it clear..

Regards

Hema

Former Member
0 Kudos

You need to insert the record in the table. The table is in the same DB2 database. Correct?

Then what is the problem in passing the record values to the SP and making the SP insert the record in the DB2 table?

former_member203627
Participant
0 Kudos

Can you please help me understand, how can i achive this. I have understood your point but don't know how to implement now.

Regards