Skip to Content
0
Sep 22, 2020 at 02:54 PM

Lock Issue - with custom program -Intercompany automatic GR with Replenishment delivery .

80 Views

Hell expert.

I have a business scenario- when the user use the following transactions - MB11, Co11n, MIGO and QA11. After clicking save it should automatically do everything till GR. So this means that we have to check PO exists or not if not then create PO and then create Replenishment outbound delivery wrt PO and then update picking and then GI and then GR.

So I found the enhancement spot in MM07MFB9_BUCHEN_AUSFUEHREN which is called by all the transactions. Here I read MSEG table and insert values to the custom table and then called my custom program from the enhancement and read data from the custom table and called corresponding BAPI's to accomplish the task.

1. PO is created - BAPI_PO_CREATE1

2. Delivery also created wrt PO - BAPI_OUTB_DELIVERY_CREATE_STO but delivery qty is 0 because the material is locked by me and so i couldn't proceed further.

I am also using COMMIT after BAPI'S.

These locks are obtained at the enhancement spot itself. it is not wise to use dequeue all. Please provide me your input on how can I achieve this.

I am kind of stuck and can not think of the solution. I have no idea how can I achieve this?

looking forward for your inputs and thanks in advance.

Regards

Reshu