‎2006 Oct 28 6:33 PM
Hi all
can anybody please explain me briefly abt lock objects,,
Thanks and regards
vijaya
‎2006 Oct 28 6:48 PM
Yes, Lock objects are used to set locks on database tables. Usually the lock is applied using the key of the database table. This insures that only one user can change a specific record in a database table at one time. You create the lock object in SE11, once defined, there will be two function modules created, an ENQUEUE function module and a DEQUEUE function module. The naming convention is ENQUEUE_E<name of lock object>, DEQUEUE is the same, but replace ENQUEUE with DEQUEUE.
Regards,
Rich Heilman
‎2006 Oct 28 6:59 PM
Hi rich heilman
Thanks for ur answer..can u also please explain me abt this lock table.
thanks and regards
vijaya
‎2006 Oct 28 7:03 PM
Lock Table? Do you mean transaction SM12? This transaction allows you to look at all of the locks currently applied to db tables system wide. These entries are the result of calling the ENQUEUE function module that I described above. The DEQUEUE function module will release the lock. I hope this answered your question.
Regards,
Rich Heilman
‎2008 Feb 28 7:15 AM
Hi Vijaya,
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.
Please also check this link
http://help.sap.com/saphelp_40b/helpdata/en/cf/21eea5446011d189700000e8322d00/content.htm
Regards,
Sravanthi