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: 

FM to read locks

Former Member
0 Kudos

Hello,

I am planning to lock the table only if its not currently locked. does anyone knows any FM for the same.

Thanks in advance.

Regards

Rajeev

1 ACCEPTED SOLUTION

former_member222860
Active Contributor
0 Kudos

check the table DD02L

DD02L~AS4LOCAL ( lock entry L)

4 REPLIES 4

Former Member
0 Kudos

Hi,

You have to create a lock object for the database table in TCODE SE11.

And you can use the function module automatically generated for the lock object <lockobj> which you have created, namely, ENQUEUE_<lockobj> and DEQUEUE_<lockobj>...

If you use ENQUEUE_<lockobj>, if the table has been locked, then the function module raises an exception saying locked, which you can check from sy-subrc.

If sy-subrc = 0.

Then the table will be locked by you, you can perform any operations, and you can DEQUEUE it using the function module DEQUEUE_<lockobj> after performing the operations.

Best Regards,

Suresh

former_member222860
Active Contributor
0 Kudos

check the table DD02L

DD02L~AS4LOCAL ( lock entry L)

Former Member
0 Kudos

Hi:

Use FM DEQUEUE_E_TABLE / EQUEUE_E_TABLE it asks the locking mode and table name.

Regards

Shashi

Former Member
0 Kudos

solved by Enqueue/Dequeue only