2008 Nov 14 2:20 PM
Hi All-
I am using BAPI(BAPI_MATERIAL_SAVEDATA) to modify the existing Materials...I am facing locking problem, if I am trying to change for multiple plants to the same material...It is updating for the first palnt, but for the second plant onwards it is getting locked...
I tired with wait upto 4 seconds, it is working....But, user does not want to wait for each record for 4 seconds...
I tried with DEQUEUE, but still gets locked...
I tried passing wait = '4' seconds in BAPI_TRANSACTION_COMMIT..I ran in the background, but job still not completed...
Even though, if I use ENQUEUE_EMMARCE and DEQUEUE_EMMARCE will not resolve my issue...
Please guide me, if anyone come across this issue in real time...We are upgrading system from 4.6c to ECC6.0...We don't have locking issue in 4.6c, same program working fine without any locking issue in 4.6c...
Thanks,
Sony
2008 Nov 14 3:09 PM
recently i have similar kind of problem, if there is any error then also lock will not be released, are you checking the return messages also. based on success you commit.
2 weeks ago
Hello I got the same issue and debug.
Issue is due to FORM sperren_mara in include LMG21FSQ whe perform ENQUEUE_EMMARAE
So I enhance it and remove autolock :
IF my_transaction
CALL FUNCTION 'ENQUEUE_EMMARAE'
EXPORTING
matnr = mara_keytab-matnr
EXCEPTIONS
foreign_lock = 01
system_failure = 02.
IF sy-subrc IS NOT INITIAL
AND sy-msgv1 EQ sy-uname.
CALL FUNCTION 'DEQUEUE_EMMARAE'
EXPORTING
matnr = mara_keytab-matnr.
WAIT UP TO 2 SECONDS.
ENDIF.
CALL FUNCTION 'ENQUEUE_EMMARAS'
EXPORTING
matnr = mara_keytab-matnr
EXCEPTIONS
foreign_lock = 01
system_failure = 02.
IF sy-subrc IS NOT INITIAL
AND sy-msgv1 EQ sy-uname.
CALL FUNCTION 'DEQUEUE_EMMARAS'
EXPORTING
matnr = mara_keytab-matnr.
WAIT UP TO 2 SECONDS.
ENDIF.
Regards