‎2007 Aug 13 3:49 PM
How do we lock a se11 user defined table using inclusive/exclusive? In any way can we lock a se38 program?
‎2007 Aug 13 3:53 PM
You will need to create a new lock object using SE11 and define the key combinations which define a lock.
All programs are locked by the system when they are being edited. If you try to edit a program that another user is already editing, you will get an error message.
Hope this helps.
Sudha
‎2007 Aug 13 3:57 PM
Hi,
Lock objects are use in SAP to avoid the inconsistancy at the time of data is being insert/change into database.
SAP Provide three type of Lock objects.
- Read Lock(Shared Locked)
protects read access to an object. The read lock allows other transactions read access but not write access to
the locked area of the table
- Write Lock(exclusive lock)
protects write access to an object. The write lock allows other transactions neither read nor write access to
the locked area of the table.
- Enhanced write lock (exclusive lock without cumulating)
works like a write lock except that the enhanced write lock also protects from further accesses from the
same transaction.
You can create a lock on a object of SAP thorugh transaction SE11 and enter any meaningful name start with EZ Example EZTEST_LOCK.
Use: you can see in almost all transaction when you are open an object in Change mode SAP could not allow to any other user to open the same object in change mode.
Example: in HR when we are enter a personal number in master data maintainance screen SAP can't allow to any other user to use same personal number for changes.
Technicaly:
When you create a lock object System automatically creat two function module.
1. ENQUEUE_<Lockobject name>. to insert the object in a queue.
2. DEQUEUE_<Lockobject name>. To remove the object is being queued through above FM.
You have to use these function module in your program.
http://help.sap.com/saphelp_nw04s/helpdata/en/cf/21eea5446011d189700000e8322d00/content.htm
Hope this will give a basic idea.
Regards
Sudheer
‎2007 Aug 13 4:01 PM
Hi Sudha!
Thanks for your immediate reply but my question meant how to create a new lock object? And for se38 program in the way you said the user is not locking the program by writing the code it is all system oriented. Is there any way by which user locks the 38 program as we do for se11 by creating a lock object?
Regards.
‎2007 Aug 13 4:21 PM
Hi,
Please check this online help on how to create lock object step by step.
http://help.sap.com/saphelp_nw04s/helpdata/en/cf/21eef3446011d189700000e8322d00/content.htm
For locking/unlocking table, you can use FM ENQUEUE_E_TABLE and
DEQUEUE_E_TABLE.
For locking/unlocking program runnning, you can use FM ENQUEUE_ES_PROG and DEQUEUE_ES_PROG.
In addition, to lock program changes you can turn on the editor lock (Path: SE38 -> Enter program -> Select attribute option -> Click on change -> Check editor lock).
The editor lock flag prevents other users from making changes to the program. This includes attributes, documentation and text elements, as well as the functions "Rename" and "Delete". Only the last person to change the program can remove the flag.
Regards,
Ferry Lianto