0% found this document useful (0 votes)
207 views

Lock Object SAP Lock Object ABAP Lock Object

SAP lock objects are used to synchronize access to shared data across multiple users. They lock table data and ensure only one user can edit or view locked records at a time. Lock objects begin with EY or EZ and create enqueue and dequeue function modules. All tables must be linked with foreign keys on their key fields. The lock argument specifies the key fields and lock mode determines if the lock is exclusive, shared, or exclusive but non-cumulative.

Uploaded by

Sahil Malhotra
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
207 views

Lock Object SAP Lock Object ABAP Lock Object

SAP lock objects are used to synchronize access to shared data across multiple users. They lock table data and ensure only one user can edit or view locked records at a time. Lock objects begin with EY or EZ and create enqueue and dequeue function modules. All tables must be linked with foreign keys on their key fields. The lock argument specifies the key fields and lock mode determines if the lock is exclusive, shared, or exclusive but non-cumulative.

Uploaded by

Sahil Malhotra
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

Lock Object / SAP Lock Object / ABAP Lock Object

Email This BlogThis! Share to Twitter Share to Facebook

SAP Lock Objects are used to lock the table data which is accessed by the multiple
users. It is used to synchronize the user request.The objects which synchronizes
simultaneous access of several users to the same data records with lock mechanism.

•Lock objects name starts with EY or EZ.

•Every lock object when activated creates two function modules:

Enqueue_<lock object name>: For setting locks.

Dequeue_<lock object name>: For releasing locks.

•All tables included must be linked with FK. FK fields must be key fields of FK table.

•The lock argument of a table in the lock object consists of the key fields of the table.

•Use TCODE SU01 for creating new user name.

Lock Modes

•Exclusive & cumulative : The locked data can only be displayed or edited by a
single user. It can be requested several times from the same transaction and
are processed successively.

•Shared : More than one user can access locked data at same time in display mode.

•Exclusive not cumulative : The locked data can only be displayed or edited by a single
user but it can be called only once from the same transaction.
Lock Object Function Module Parameters

•Field name

•X_<field name>: If <field> = initial value & X_<field> = initial value -> generic lock.If
<field> = initial value & X_<field> = X ->lock is set with exactly initial value of
<field>.

•Mode_<tab>: E,S,X for each table.

•_Scope : 2 for enqueue & 3 for dequeue.


•_Wait : If _wait = initial value & if there is competing lock,a lock attempt
fails. If _wait = X & if there is competing lock,lock attempt fails for first time.

Lock attempt is repeated after waiting for certain time. FOREIGN_LOCK


exception is triggered only if certain time is elapsed.

•SYSTEM_FAILURE exception is triggered when problem occurred while setting lock.

You might also like