Skip to Content

Locking issue with IDoc MBGMCR - BAPI_IDOC_INPUT1

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!


Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

3 Answers

  • Best Answer
    May 03, 2017 at 01:43 PM


    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


    Add comment
    10|10000 characters needed 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!


  • May 04, 2017 at 09:09 AM

    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.


    Add comment
    10|10000 characters needed characters exceeded

  • May 04, 2017 at 01:50 PM

    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

    Add comment
    10|10000 characters needed characters exceeded