Hello,
Has anybody ran across a problem of lock objects (related to materials) not getting released when BAPI_GOODSMVT_CREATE fails?
Here is the sequence of events:
1. I run my function (which calls BAPI_GOODSMVT_CREATE) in SE37 and force an error (i.e. return table contains entries). I do NOT leave SE37.
2. In another session I run the same test again (but with correct data). I get error M3 897 (The plant data of the material 3319 is locked by user USCLXH90).
By looking in SM12 after step 1 is finished, I have noticed that 2 lock entries do not get released. These lock entries subsequently cause the error in step 2.
Lock Object: ENQARRAY
Tables: MARC, MBEW
Arguments: material and plant used in my test
IMPORTANT NOTES:
A. These lock objects do finally get released once I completely exit SE37.
B. These lock objects get released immediately and automatically if step 1 is successful (in other words, it's only when there is an error do the lock objects remain!)
C. I do call BAPI_TRANSACTION_COMMIT. I have also tried using SET UPDATE TASK LOCAL. Neither makes any difference (I think these are irrelevant b/c there are no db updates anyway in step 1 b/c of the error I force).
D. We have seen this specific problem occur when calling the function via RFC from our web front end.
I couldn't find any OSS note that describes this problem. Anybody know how to guarantee that all lock objects get released in the case where BAPI_GOODSMVT_CREATE fails?
p.s. I am a doing a 541 movement type (although I don't think this problem is specific to movement types).
Thanks for any suggestions or insights anybody might have.
Regards,
Lee
I've used this BAPI in many of my programs, and always after the call, I code.....
commit work and wait. call function 'DEQUEUE_ALL'.
The DEQUEUE_ALL show release any/all locks.
Regards,
Rich Heilman
Hi Lee,
Did you set the parameter 'WAIT' to 'X'? This will ensure that all the updates are completed and the locks are released, before the next call of the BAPI.
Srinivas
Add a comment