Lock Object is a feature offered by ABAP Dictionary that is used to synchronize access to the same data by more than one program. Data records are accessed with the help of specific programs. Lock objects are used in SAP to avoid the inconsistency when data is inserted into or changed in the database.

Which type of lock is used for read write in SAP?

1. Shared Lock (S) : Shared lock is also called read lock, used for reading data items only.

How do you lock an object in SAP ABAP?

How to create Lock Objects in ABAP

  1. Open the SAP System.
  2. In transaction code input, enter ‘SE11’ to go to the Data Dictionary.
  3. Select ‘Lock Object’ from the radio button options.
  4. Now since we are creating a new one, enter a name for the object (beginning with ‘E’).
  5. Select button ‘Create’.

What is lock mechanism in ABAP?

The SAP system is equipped with a special lock mechanism that synchronizes database access. The purpose of the lock mechanism is to prevent two transactions from changing the same data in the database simultaneously. Locks are defined generically as “lock objects” in the Data Dictionary.

What is SAP lock?

The SAP system is equipped with a special lock mechanism that synchronizes database access. The purpose of the lock mechanism is to prevent two transactions from changing the same data in the database simultaneously. The SAP lock mechanism is closely related to the Update Mechanism in SAP System.

What type of locks are available in SAP ABAP?

There are four types of locks in the SAP System:

  • Shared lock.
  • Exclusive lock.
  • Exclusive but not cumulative lock.
  • Optimistic lock.
  • → see also.

What is the use of lock object in SAP ABAP?

Lock objects locks a table temporarily till the operation is performed on the table. Lock Objects in SAP ABAP are global reusable component which generates function modules that are used to set and release locks on data record. This lock mechanism is important to synchronize access of same data record by multiple programs/users.

How to create a lock request in SAP?

A lock request is first generated by the program. Then this request goes to the Enqueue server and the lock is created in the lock table. The Enqueue server sets the lock and the program is finally ready to access data. Step 1 − Go to transaction SE11. The following screen opens. Step 2 − Click ‘Lock Object’ radio button.

How to remove a lock object from a table?

DEQUEUE_ . To remove the object is being queued through above FM. You have to use these function module in your program. The tables in which data records should be locked with a lock request are defined in a lock object together with their key fields.

What is a lock object in accesstables?

Tables data records that are required to be locked during its insertion or updation must be defined in a Lock Object with their key fields. For simplest example, Table with primary key have the lock object because the primary key of the table is the table lock object.