‎2008 Mar 27 7:06 PM
We are using BAPI_MATERIAL_SAVEDATA within a loop in an ABAP program to create multiple sales view records ( for multiple sales keys for a single material - the BAPI by design does not accept data for more than one sales key ) .
We are encountering lock errors on ther material whenever we try to make a subsequent call to the BAPI -for multiple sales key for the same material .
Is there a flag or something when the BAPI is called to avoid this lock error - or do we have to check for the material lock before we call the BAPI for each sales key and wait for a few seconds before we attempt the call ?
Any similar experiences while implementation shared will be appreciated. Correct answers/solutions will be rewarded.
‎2008 Mar 27 7:19 PM
Are you calling BAPI_TRANSACTION_COMMIT with parameter WAIT = 'X' after each call to BAPI_MATERIAL_SAVEDATA?
‎2008 Mar 27 7:19 PM
Are you calling BAPI_TRANSACTION_COMMIT with parameter WAIT = 'X' after each call to BAPI_MATERIAL_SAVEDATA?
‎2008 Mar 27 10:00 PM
Ken & Ganesh
Both of you were right. I was missing the call to BAPI_TRANSACTION_COMMIT in some cases and also had to include the wait parameter in each of the calls. This seems to have fixed the lock issue.
Thanks a bunch.
‎2008 Mar 27 7:35 PM
Hi,
If you are working with BAPI to Create/Update/Delete after calling the bapi
you should call BAPI_TRANSACTION_COMMIT other wise it won't update
I think in your case in loop after calling the BAPI_MATERIAL_SAVEDATA
call BAPI_TRANSACTION_COMMIT you are not called .
Thanks and Regards
Ganesh