‎2021 Nov 24 7:03 AM
Hello.
Well, If there is a scenario, who want to do mass transfer of material, between storage location.
You have number of material which are maintain with different batch no, but same material number.
First of All, With using BAPI, It'll lock the material you're using - so it can't be processed with other parallel processing.
If you update your result in Z-tables, If 2 jobs are completed simultaneously, the Z-table is locked because a job is locking the table, making other job can't be updated - because table is locked by other job.
Any advice on this situation?
‎2021 Nov 24 7:15 AM
I used the FM ENQUEUE_ESINDX, as suggested by rich.heilman in his answer to this post Locking a Report | SAP Community
‎2021 Nov 24 7:25 AM
Well, I know there is a 'enquene' concept of SAP.. but the problem is 'wait until the locked object is completed'.
Do I have to do use do-enddo clause?
‎2021 Nov 24 7:34 AM
Indeed you will have to use a loop. First decide how long you want the process to wait to, then create a loop where you have four things:
1. The call to ENQUEUE_ESINDX
2. Check if the lock could be done successfully and if so, exit the loop and go on with processing
3. If locking could not be done, use instruction WAIT UP TO xx SECONDS in order to give the other process time to unlock once finished
4. Decrease a variable that you defined beforehand to decide how long you want to wait