‎2009 May 20 12:26 PM
Hi all,
We are using the BAPI call to the FM BAPI_GOODSMVT_CREATE for goods recipt posting.
When we have multiple PO's the first PO is posted succesfully and the next PO gives a locking error as "The plant data of the material <material number> is locked by the user <usedrid> "
How to dequeue the plant data for the material? Is there any specific function module ?
Regards,
stk
‎2009 May 20 12:28 PM
‎2009 May 20 12:29 PM
Hi stock.
try this.
DEQUEUE_E_MATNR_LOCK
if does not work serch in SE37 DEMATNR*.
U will get so many function modules.May be some thisng will help u
Thanks
‎2009 May 20 1:00 PM
Hi ,
Both DEQUEUE_E_MATNR_LOCK and DEQUEUE_ALL doesnt remove the lock...
But when i check the program in debug mode the lock is removed and the posting is done.
still problem persists.
thnks
‎2009 May 20 1:06 PM
Your BAPI sets a lock using ENQUEUE. Using debug or just looking at the code, (or I think there is a trace somewhere), you can find the FM used to do the ENQUEUE. What you need to do, is in a loop, try to get the same lock, using the same ENQUEUE function module. If you can't get a lock, then it means that BAPI processing hasn't quite finished. So use FM Enque_Sleep to sleep for a number of seconds. Then try and get a lock again.
When you get a lock, immediately release it (Using a DEQUEUE FM with exactly the same params, and do your next task.
Don't use DEQUEUE_ALL. You don't want to inadvertantly remove a lock that you actually need. That way lies db corrupution.
‎2010 Feb 05 9:42 PM
hi, can you give me code example of it....??
table S021 no update after bapi commit..
‎2009 Jun 29 8:03 AM