Sunteți pe pagina 1din 2

SM12 - Lock Concept

https://wiki.scn.sap.com/wiki/display/Basis/SM12+-++Lock+Concept

The SAP System is equipped with a special lock mechanism that synchronizes access to
data on the database. The purpose of the lock mechanism is to prevent two
transactions from changing the same data on the database simultaneously . Lock entries
are usually set and deleted automatically when user programs access a data object &
release it again. The lock mechanism is closely related to the Update Mechanism

1. You can use SM12 to check and delete lock entries.

2.In SM12 , check any lock entry older > 2 days . If any outdated entry found, check the
corresponding user is user online / offline in AL08 or SM04 (you can get the transacti on
code that been use by the user). Get the user contact from SU01 and inform about the
lock else if the user is offline , release the table from lock by deleting the lock.

Different types of Locks in SAP

http://sureshchowdarysapbasiss.blogspot.com/2013/08/different-types-of-locks-in-sap.html

The locks are used in sap to prevent concomitant change of an object by two developer.

The enque work process manages the locking system. The lock entries for data to be

Processed in lock table which is maintained in main memory.

Various Lock Modes in SAP

Shared Lock (S):


Several users can access the locked data at the same time in display mode.
Requests for further shared locks are accepted, even if they are from
other users. Exclusive locks are rejected.

Exclusive lock (E):


the locked data can be displayed or edited by one user only. Requests for
either another exclusive lock or a shared lock are rejected.

Exclusive but not cumulative lock (X): Exclusive but not cumulative

Locks can only be requested by the same transaction once only. All

Further lock requests are rejected.


https://techrelam.blogspot.com/2017/05/how-to-delete-sap-lock-entry-in-sm12.html

What is SAP lock entry.


SAP Lock is set by the executing work process when user/jobs want to change the data
in SAP.
Whenever a lock to be set the respective work process checks in the lock table. Whether
a respective lock conflicts the existing entries in the lock table.

Types of Lock
Write Lock (E) : This is also known as exclusive lock mode as the lock data can be
edited by only one user at a time.Any other request from work process to set another
Write lock or Read lock are rejected.A cumulate lock can be applied on the lock data by
the same owner again.

Read lock (S) : This is also known as shared lock mode as several user can have read
access to the locked data at the same time. Additional read lock requests are
entertained even if they are from different user.However a write lock is rejected.

Enhanced lock (X) : This is also known as exclusive non-cumulative lock mode.An
enhanced write lock can be requested only once even if it is by the same transaction.

Optimistic lock(O) : These lock are set up when the users displays the data in change
mode. Several optimistic locks can be set up on the same data.Optimistic locks are
Read locks at first and converted to Write locks when user want to save the data.if an
optimistic lock on a data changed to Write locks ,all other optimistic locks on that data
will be deleted.

Locks that are set by an application program are released by the program itself or they
released by update program once the database has been changed

S-ar putea să vă placă și