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: 

Check Lock on production order

Former Member
0 Kudos

Hi,

before lauching the BAPI to confirm a production order in Z program, l want to check first if a lock exist on that same production order. How can l find the FM that does the job?

Thank's for your help.

Bob

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi Bob,

In the transaction SM12 you can see all current SAP locks, they can be selected using object or user name. If you want to get that list in your ABAP, the function ENQUEUE_READ will return you a list of object locks for specific objects (that can be specified with a pattern). The function can be useful if you want to process some object without locking it, for example, with a BAPI or BDC, and you want to check whether you may do this at the moment. If the object is currently locked by another user, you can read the lock and decide what to do: wait, or just report an error.

Regards

Sudheer

2 REPLIES 2

former_member181962
Active Contributor
0 Kudos

Use the fm: ENQUEUE_READ to read if any lock exist on the AUFK table

Former Member
0 Kudos

Hi Bob,

In the transaction SM12 you can see all current SAP locks, they can be selected using object or user name. If you want to get that list in your ABAP, the function ENQUEUE_READ will return you a list of object locks for specific objects (that can be specified with a pattern). The function can be useful if you want to process some object without locking it, for example, with a BAPI or BDC, and you want to check whether you may do this at the moment. If the object is currently locked by another user, you can read the lock and decide what to do: wait, or just report an error.

Regards

Sudheer