Application Development 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: 

determine batch is locked or not

Former Member
0 Kudos

how can i determine if a batch is locked (ie it is in change mode) . Before i update the batch i would like to know if it is locked or not , so that i can wait till it is unlocked and then update

1 ACCEPTED SOLUTION

naimesh_patel
Active Contributor
0 Kudos

You can use the Enquequ Function of the Batch to try to lock the Batch. If you are successfully able to lock it that means that Batch is not locked by any other user.

Enquequ FM: ENQUEUE_EMMCH1E

Dequequ FM: DEQUEUE_EMMCH1E

You need to pass Material and batch to set and release the lock using these FM.

You can try to lock using this FM in a loop (with Some predefined number ... to avoid the deadlock). You can use the dequeue FM after the Enqueue to release the lock.

Regards,

Naimesh Patel

3 REPLIES 3

former_member212653
Active Contributor
0 Kudos

what do you exactly mean by batch: batch upload program or material batch?

naimesh_patel
Active Contributor
0 Kudos

You can use the Enquequ Function of the Batch to try to lock the Batch. If you are successfully able to lock it that means that Batch is not locked by any other user.

Enquequ FM: ENQUEUE_EMMCH1E

Dequequ FM: DEQUEUE_EMMCH1E

You need to pass Material and batch to set and release the lock using these FM.

You can try to lock using this FM in a loop (with Some predefined number ... to avoid the deadlock). You can use the dequeue FM after the Enqueue to release the lock.

Regards,

Naimesh Patel

Former Member
0 Kudos

i want to know whether the material batch is locked or unlocked before i start updating the batch. I would like to know this before I send the control to BAPI to update the material batch. If it is locked i wouldn't send the control to BAPI and wait till it is unlocked