Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Question on BAPI BAPI_MATERIAL_SAVEDATA

Former Member
0 Likes
886

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.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
607

Are you calling BAPI_TRANSACTION_COMMIT with parameter WAIT = 'X' after each call to BAPI_MATERIAL_SAVEDATA?

3 REPLIES 3
Read only

Former Member
0 Likes
608

Are you calling BAPI_TRANSACTION_COMMIT with parameter WAIT = 'X' after each call to BAPI_MATERIAL_SAVEDATA?

Read only

0 Likes
607

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.

Read only

Former Member
0 Likes
607

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