Hi,
In our programs we are using the bapi BAPI_GOODSMVT_CREATE to post the goods movement for different movement types. We are processing this bapi inside a loop . Inside the loop after each bapi call we are doing the commit work by executing the function module BAPI_TRANSACTION_COMMIT.
Problem:-
We are getting material locking issue inside the loop as we are using the same material, batch in the loop for creating different goods mvmt for multiple times.
Steps we tried for resolution:-
1. We added SET UPDATE TASK LOCAL before calling the Goods Mvmt Bapi.
2. Call the bapi Bapi_Transaction_commit to commit the changes as below.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
EXPORTING
wait = abap_true.
3. Used the wait statement to hold the processing for some time to clear the buffer / locks.
WAIT UP TO 4 SECONDS.
After doing all this we found very less issues with self locking inside the loop, but still getting some locking issues some times not every time may be when CPU have load request / peak load and in some unidentifiable times also.
Now my request is :-
We tried all the above options by googling and some other member's inputs. This time I am looking to get actual underlying architecture in this process. So that I want to fix the issue on permanent basis.
1.could you please anyone help me what will be the actual memory / locks processing in executing a bapi,
2. Why Set update task local is required?
3. Why wait statement is required?
4. When and how locks will be released / created ?
5. How to check after each bapi call for goods mvmt, how can I check that the current bapi call commited successfully and released l
Regards,
Chitturi.