2008 Dec 22 11:54 AM
Hi All,
How can i detect whether a specific database table has been locked or not.
If the table is not locked i will have to update the table from my program.
Are there any standard Function Modules avalable for this ????
Thanks in advance....
regards,
Anindya
2008 Dec 22 12:14 PM
When you try to ENQUEUE any table for Locking in return you will get to know whether the lock is successful or not.
I suppose you can just check for sy-subrc = 0 => Successfully Locked. Insert Data
sy-subrc <> 0 => Table is already locked.
2008 Dec 22 12:30 PM
Hi Anindya,
Just got to T.code SM12(Lock Entries), which gives the table name and user who has locked.
for checking purpose,
create lock object to any ztable which create two FM enqueue and Dequeue just keep a break point in between these FM and check the transaction SM12.
Regards
Kumar M
2008 Dec 22 12:34 PM
Hi,
Use FM ENQUEUE_EBU_PARTNR
OR
go to SM12 transaction
You can use function ENQUEUE_READ.also you can use the function module GET_LOCKLIST_ADA
2008 Dec 22 12:41 PM
go to trasection sm12
use FM ENQUE_READ
IF SY-SUBRC = 0 then it is successfully locked.
to learn lock mechenism go to this link
http://www.slideshare.net/guest28d364/abap-table-lock-object/