cancel
Showing results for 
Search instead for 
Did you mean: 

BAPI call in incoming IDOC - Locking problem

Former Member
0 Kudos

Hi,

I have got a situation where there are many incoming IDOCs got created (Customer Contract IDOC) in ECC through PI. All these IDOCs are basically referring to same Contract number (VA43).

In Incoming IDOC process code, there is Z-function module inside which BAPI_CUSTOMERCONTRACT_CHANGE is called to post the IDOC into application tables.

All the incoming IDOCs are selected for posting in one shot through background scheduled program in backend. Here the issue is since all of them referring to one contract, only 1 IDOC get posted.

I thought of a solution to check the lock before call of BAPI using FM "ENQUEUE_READ" and then if there is a lock ONLY, call FM BAPI_TRANSACTION_COMMIT with wait indicator. THIS IS NOT WORKING as I expected. Suppose there are 4 IDOCS (1,2,3,4), in this case after implementing my solution it works like - 1 get posted, 2 error, 3 error, 4 - get posted... i retried again - at that time 1 - get posted, 2 get posted and then other 2 error - no consitency

I don't want to WAIT flag to trigger for all IDOC postings. Is there any way?

Accepted Solutions (0)

Answers (1)

Answers (1)

shashi_thakur
Contributor
0 Kudos

Hi,

Serialization for the Idoc should solve your issue.

Regards,

Shashi Thakur