‎2006 Nov 12 6:21 PM
Hi all,
can any one send a piece of code for locking.(shared,exclusive..)
Regards
vijaya
‎2006 Nov 12 6:56 PM
Vijaya,
How to lock and unlock object...
fm used...ENQUEUE_E_TABLE
Ex...
Lock Table
CALL FUNCTION 'ENQUEUE_E_TABLE'
EXPORTING
tabname = table_name
EXCEPTIONS
foreign_lock = 1
system_failure = 2
OTHERS = 3.
*-Unlock Table
CALL FUNCTION 'DEQUEUE_E_TABLE'
EXPORTING
tabname = table_name
Check these Threads...
http://help.sap.com/saphelp_nw04/helpdata/en/7b/f9813712f7434be10000009b38f8cf/content.htm
http://www.sap-img.com/abap/type-and-uses-of-lock-objects-in-sap.htm
http://www.guidancetech.com/people/holland/sap/abap/yusrlock.htm
http://www.sappoint.com/abap/ab4dict.pdf
http://help.sap.com/saphelp_nw04/helpdata/en/cf/21eef3446011d189700000e8322d00/content.htm
http://help.sap.com/saphelp_nw04s/helpdata/en/41/7af4c5a79e11d1950f0000e82de14a/content.htm
‎2006 Nov 13 11:16 AM
hello,
Lock
CALL FUNCTION 'ENQUEUE....'
EXPORTING
tabname = table_name
EXCEPTIONS
foreign_lock = 1
system_failure = 2
OTHERS = 3.
*-Unlock
CALL FUNCTION 'DEQUEUE...
EXPORTING
tabname = table_name
Regards,
shehryar
‎2006 Nov 13 11:19 AM
hi,
Hi,
Lock objects are used to lock the database table while making the modifications on the database table.
you can create your own lock objects using SE11.
if you create lock objects on any table system will create two function modules.
1.ENQUEUE....
2.DEQUEUE.....
first one is used to lock the table
second one used to removing lock on the table.
*-------------lock Table
CALL FUNCTION 'ENQUEUE_E_TABLE'
EXPORTING
tabname = table_name
EXCEPTIONS
foreign_lock = 1
system_failure = 2
OTHERS = 3.
*-------------Unlock Table
CALL FUNCTION 'DEQUEUE_E_TABLE'
EXPORTING
tabname = table_namecheck this link :
http://help.sap.com/saphelp_40b/helpdata/en/cf/21eea5446011d189700000e8322d00/content.htm
Rgds
Anver
<b><i>if hlped pls mark points</i></b>
‎2006 Nov 13 11:37 AM
If you are working with HR Tables, Please use below FM's for enqueue / dequeue HR Objects..
<b>Unlock HR Objects</b> HR_DEQUEUE_OBJECT
<b>Lock HR Objects</b> HR_ENQUEUE_OBJECT
Regards,
Ramki.