Skip to Content
0

Locking issue with IDoc MBGMCR - BAPI_IDOC_INPUT1

May 03, 2017 at 01:17 PM

261

avatar image

Hi experts,

We are receiving IDOCs from an interface (PI) and are having locking issues. We have basically two IDOCs of type MBGMCR (BAPI_IDOC_INPUT1) being passed to ECC one right after the other, and as both Idocs are processing the same material and when the processing is slow, it happens often that the first Idoc is still processing the material document creation when the second one gets started, what causes the locking issue... in this case, the second IDOC returns an error regarding a lock for the material.

The question is: how to sort it out? Is there any EXIT/BADI/etc. I may use to ckeck if the material is still locked before proceeding with the execution of the second IDOC?

Thanks in advance!

Willian.

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

3 Answers

Best Answer
Evgeny Gubenko May 03, 2017 at 01:43 PM
0

Hi!

If you have standard processing, FM IDOC_INPUT_MBGMCR is being called. So it has enhancement point IDOC_INPUT_MBGMCR_03 right at the beginning, and you can use it for checking if the material locked or not

Hope it's helpful

Evgeny

Show 1 Share
10 |10000 characters needed characters left characters exceeded

Hi Evgeny,

Thank you for your prompt answer. Processing my IDOC I could see that the FM IDOC_INPUT_MBGMCR is being called, and I have implemented the enhancement point you mentioned to check the lock on the material.

Thank you!

Willian.

0
Always Learner May 04, 2017 at 09:09 AM
0

Hi ,

How are the Idocs being processed (Trigger Immediately or Trigger by background program).

I guess idoc are processed 'immediately'. I suggest change this to 'Trigger by background program' in WE20 and

schedule RBDAPP01 program in background with message type MBGMCR . This will process Idocs in background and can avoid locking issues.

Thanks

Show 3 Share
10 |10000 characters needed characters left characters exceeded

Hi,

These two IDOCs are being triggered from a legacy system through SAP PI. I have implemented the enhancement-point at the beginning of the FM IDOC_INPUT_MBGMCR to check the lock but I am still getting the lock error message for the second IDOC. Please find below the message details:

The site data of the article 100000017 is locked by the user COCO_CXD_000. Message no. M3897

Any other idea to sort it out? Probably this error message is being triggered before my enhancement implementation, or perhaps I am not using the correct FM to check the lock of the object. I'm checking the lock through the FMs ENQUEUE_EMMARAE and then DEQUEUE_EMMARAE.

Thank you!

0

You can search by message, and check, which FMs were called before this message. As I see, it's checking MARC lock object in common case. By the way, you can use FM ENQUEUE_READ to analyze which locks are set.

0

Hi Evgeny,

Thank you so much for your help on this. I have implemented the enhancement in a different way and now I think it will do the trick.

0
Raghu Govindarajan May 04, 2017 at 01:50 PM
0

An additional suggestion... instead of actually putting a lock and then removing it with the DEQUEUE, you can test it using lock modes 'U' and 'V'. An added bonus, if you use the WAIT option, it will try waiting for a predefined amount of time (normally up to 5 seconds) for the lock to release. See my blog post and the comment section too about these options

Show 1 Share
10 |10000 characters needed characters left characters exceeded

Hi,

Thank you for your contribution on this. So helpful!

0