Download as doc, pdf, or txt
Download as doc, pdf, or txt
You are on page 1of 1

LOCK OBJECTS

admin | May 23, 2008 | ABAP | No Comments

UNDERSTANDING SAP LOCK OBJECT MECHANISM


Lock objects are a mechanism to control as to how the update takes place when more
than one user is updating the data in the same table.
To create lock objects you will need two function modules.
1. ENQUEUE_<LOCK_OBJECT_NAME>
This function module is used to generate a lock entry in the table making it only
accessible to only one user. Incase, for any reason if the lock object function module is
not able to lock the table. It will reflect in the return code.
2. DEQUEUE_<LOCK_OBJECT_NAME>
This function module is used to release the locks.
Now, If you want to end up having different programs trying to update the same
database table. To avoid problems code your database updates between 1 & 2.
There are basically two types of lock:

TYPES OF LOCK
Shared Lock : Is a read only lock that prevents the data from being changed when
another user is reading it.
Exclusive Lock: Is a write lock that prevents data from being changed when another
user is updating it.
COPYRIGHT SAP Database : Repository of all the freely available information on SAP.

You might also like