‎2013 Dec 27 8:39 AM
Dear Experts,
I am executing two BAPI's(BAPI_SALESORDER_CHANGE and BAPI_GOODSMVT_CREATE)
in a report.My problem is for first material both the BAPI's are running fine but for the second material salesorder_change
BAPI is executed but for goodsmvt_create BAPI its showing an error that material is locked by certain user, which is not true.As I run the same in debugger I donot encounter any of this Problems.
Please Help,
Reagrds
SUHAS.
‎2013 Dec 27 8:42 AM
‎2013 Dec 27 9:01 AM
Hi Suhas,
While update the material tables using BAPI_SALESORDER_CHANGE, material will be locked and it will be released after some times.
You can use wait up to <number> seconds.
It will resolve your issue.
Arivazhagan S
‎2013 Dec 27 9:03 AM
Use BAPI_TRANSACTION_COMMIT after BAPI_SALESORDER_CHANGE.
Regards
Vivek
‎2013 Dec 27 9:05 AM
Hello Suhas,
You can try with calling BAPI: BAPI_TRANSACTION_COMMIT after execution of (BAPI_SALESORDER_CHANGE and BAPI_GOODSMVT_CREATE).
Sample code:
IF wa-type NA 'EA' OR wa-type NA 'E'.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT' DESTINATION xyz
EXPORTING
WAIT = 'X'
* IMPORTING
* RETURN =
ENDIF. .
Check the error status of your BAPI and if no error then call commit BAPI to commit your work.
I think it may solve your problem.
Regards,
Chandan
‎2013 Dec 27 9:25 AM
Hi Suhas,
Pass WAIT as 'X' to 'BAPI_TRANSACTION_COMMIT' which should solve the problem. If you still encounter the same issue, you can choose to introduce some delay manually as below before calling BAPI_GOODSMVT_CREATE.
WAIT UP TO 2 SECONDS. " System waits for specified time units so that the locks are released
Regards,
Prashanth
‎2013 Dec 27 11:25 AM
Dear Suhas,
Use Call Function 'BAPI_TRANSACTION_COMMIT'. after "BAPI_SALESORDER_CHANGE".
then use WAIT UP TO 3 SECONDS.
then use Call Function 'BAPI_GOODSMVT_CREATE'.
This will resolve your problem.
Regards,
NG.
‎2013 Dec 27 11:35 AM
HI Suhas,
After passing data in BDC code using work area or structure please clear work area & refresh internal table ....