cancel
Showing results for 
Search instead for 
Did you mean: 

Avoid duplication while processing data in XI

venkatesh_r
Employee
Employee
0 Kudos

Hi,

I am tring to send customer master data from SAP to local DB through XI. I have scheduled the whole process in sm36.

My problem is when i create and edit the data in SAP with the job scheduling period it creates 2 IDOCs of the same master data. When I perform a JDBC look up of the master data, it will not be available in my local DB and hence they go in as two separate entries in my local DB.

How can I avoid this situation?

Regards,

Venkatesh

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Venkatesh,

When I perform a JDBC look up of the master data, it will not be available in my local DB and hence they go in as two separate entries in my local DB.

Can you elaborate on this?

Also the following may help you..in your local db in the table in which you are inserting customer master data create the table with the customer number as primary key. And in your sql statement use update_insert. i.e if entry doesnt exist it will insert and if entry exists in db it will modify the record.

Regards,

Sumit

ps : award points if that solved your problem.

venkatesh_r
Employee
Employee
0 Kudos

Hi Sumit,

In the sense I have to check if the particular SAP Customer Number exists in local DB and this SAP Customer Number is available only in one table. There are three tables that has to be inserted/updated based on this check.

How do i do this is if the primary key cannot be set on this table now?

Regards,

Venkatesh

justin_santhanam
Active Contributor
0 Kudos

Ram,

are u using BPM for this case? If yes then you can do synch call and get response, and based on the response u can insert data into table .

Best regards,

raj.

venkatesh_r
Employee
Employee
0 Kudos

Hi Raj,

A synch call is usefull if the value exists in the database. Both the IDOCs are processed together and hence those values will not available in the database.

I know that primary key setting will be a better solution. But those columns have to be added in the other tables involved and I want to avoid this.

Regards,

Venkatesh

justin_santhanam
Active Contributor
0 Kudos

Ram,

You said both IDOCS come together, both the IDOCS are getting processed in the same time by XI. Why i'm askin this bcoz even though u are sending two IDOCS to XI, it will be processed one after another am I right, Please correct me if i'm worng. How the flow happens, can u please clarify it.

Best regards,

raj.

venkatesh_r
Employee
Employee
0 Kudos

Hi,

When the IDOCs are getting processed, I perform a JDBC look up into one table and check if the SAP Customer Number is available in my local DB. If it is available, I update the 3 tables involved with the record else I insert it.

If the adapter engine has not performed the JDBC Operations, the data will be still persisting in the Adapter Engine. Only if the first record reaches the database, my second record knows that the data has already come and then it will perform an update.

How do I check with the data that is available in the adapter engine or the datas that are being currently being processed?

Regards,

Venkatesh

moorthy
Active Contributor
0 Kudos

Hi,

To understand better, everytime you get only 2 iDOCs ? or many??

Using ccBPM with wait step you can achieve for some extent.

For e.g You have got 2 idocs with for a same customer no.

1) First IDOC u got into BPM. you are calling jdbc lookup. It returns that, data does not exist. Now it will send the idoc to jdbc.

2) then execute wait step in ccBPM

3) now call lookup for second IDOC .. It returns you the false.. hence you need to call update into jdbc.

Now as per my understanding, at first time you need to insert everything.so i think you can handle like this. Else you need to have 2nd sync call to JDBC to insert/update the records. After successful insert/update you will get the response then you can call lookup again for the second IDOC. btw, all this should be in loop for no. of IDOCs.

Btw, this will be a huge performance hit for the scenario.If possible, just use MODIFY statement in the JDBC so that any IDOC comes it will just insert/or update if it exists. but you need to make sure that, you are passing only one IDOC at a time to JDBC. Can be handled via EOIO in BPM.

Hope this will give some hints

rgds,

Moorthy

Answers (1)

Answers (1)

venkatesh_r
Employee
Employee
0 Kudos

Thank you Moorthy, Raj and Sumit. Those replies were helpful.