cancel
Showing results for 
Search instead for 
Did you mean: 

Handle 2 incoming Idocs simultaneously in CPI

MohitS
Explorer
0 Kudos
662

Hello experts,

We have a scenario where we have to create business partner in S4Hana Cloud via CPI. SAP ECC system is sending out 2 IDocs (CREMAS and ADRMAS) to CPI in 2 different triggers with time difference of milliseconds.

To create a complete Business Partner in S4HC, data from both Idocs should be posted.

Could you please suggest a way to handle these 2 Idocs simultaneously in CPI.


Thanks and regards,

Mohit

Accepted Solutions (0)

Answers (1)

Answers (1)

AshGoyal
Participant
0 Kudos

Hi Mohit,

I would suggest to collect both these iDocs in two different queues using SAP Enterprise Messaging. For this you will need to different iFlow to trap the iDocs and then update in SAP EMS. You'll need one more iFlow which will be a scheduled one. This new iFlow will pop the oldest record from both the queues using the HTTP APIs of SAP EMS and then combine them to send to S4H.

Probably, you can also use some kind of persistence to do the same in case you do not want to use SAP EMS.

Offcourse, you will need some field in both the iDocs which can be matched so that you know that the records popped from the queues do match.

When using SAP EMS, ensure that concurrent access is not allowed from multiple process as access from multiple process will mess up the order of records in both queues.

Some questions:

1. Is this ongoing integration or one time ETL kind of scenario?

2. Do you have possibility of combining both iDOCs into one iDoc in SAP ECC side?

best regards,

Ash