‎2006 Aug 11 4:11 PM
I am calling multiple times BAPI_GOODSMVT_CREATE for same Purchase order to post goods receipt.
first goods receipt created successfully but second one has given the error the Purchase order is lockecd by USER 'XXXX' .
i am calling 'BAPI_TRANSACTION_COMMIT after each BAPI BAPI_GOODSMVT_CREATE.
i tried with passing parameter WAIT = 'X' in 'BAPI_TRANSACTION_COMMIT. then also getting same error message.
please any one tell me the solution
‎2006 Aug 11 4:13 PM
‎2006 Aug 11 4:15 PM
Try DEQUEUEing after the commit. Here is a sample coding.
* Call goods movement BAPI
call function 'BAPI_GOODSMVT_CREATE'
exporting
goodsmvt_header = gm_header
goodsmvt_code = gm_code
importing
goodsmvt_headret = gm_headret
materialdocument = gm_retmtd
tables
goodsmvt_item = gm_item
return = gm_return.
if not gm_retmtd is initial.
<b> commit work and wait.
call function 'DEQUEUE_ALL'.</b>
write:/ gm_retmtd.
else.
commit work and wait.
call function 'DEQUEUE_ALL'.
endif.
Regards,
Rich Heilman
‎2006 Aug 11 4:18 PM
‎2006 Aug 11 4:45 PM
thanks for your reply
we have requirement partial goods receipts for purchase orders diffrent times.
so i need to call each time BAPI_GOODS_MVT_CREATE for each parial goods receipt.
i will try with call function 'DEQUEUE_ALL'.
please can you expalain what is the use of WAIT parameter in 'BAPI_TRANSACATION_COMMIT'.
Thanks
‎2006 Aug 11 5:25 PM
‎2006 Aug 11 7:35 PM
You get the error because locks in the update work process are not released yet when you call the bapi second time.
You can try adding SET UPDATE TASK LOCAL before calling the bapi.
Regards
Sridhar