Register Login

Lock Entries Managing, Displaying, Deleting

Updated May 18, 2018

Managing Lock Entries 

Function of Lock Management

The lock management purpose is to monitor the lock logic of your system. You can determine the locks that are currently set. Locks for which the backup flag is set (because they have already been transferred to the update task) are highlighted (see Choosing and Displaying Lock Entries).

This enables you to detect and rectify problems, for example, by deleting locks that are no longer required.

Lock Entries Integration

The SAP lock concept works in close conjunction with the SAP update facility, which is described in the section entitled Update in SAP System.

Lock Management Features

The initial screen of the lock management facility is structured as follows:

You can use the lock management facility to

  • Choose and display lock entries
  • Delete lock entries
  • Test the lock management facility
  • Display the lock statistics

Activities: To access lock management from the SAP menu choose Administration System Administration Monitor Lock Entries, or enter transaction SM12.

Choosing and Displaying Lock Entries 

You can display lock entries according to the following criteria (see also Functions of the SAP Lock Concept):

  • Table in which rows are locked
  • Lock entry argument
  • Client
  • User who set the lock

The client and your user are automatically included in the initial screen. (See Managing Lock Entries). If you want to display the locks of a different user or client, you must overwrite the relevant field. if you leave the field blank or enter a *, the data is selected according to all possible entries.

The lock entry display contains the following information:

  • The Cli column contains the client in which a lock entry was created.
  • The User column contains the user who set the lock (that is, the user who executed the ABAP program that created the lock).
  • In column Time you can see when the LUW (Logical Unit of Work) began, in which the lock entry was created.
  • In column Mode you can see which type the lock object is ( S: shared lock, E: exclusive lock, X: exclusive and not cumulative, O: optimistic lock). The various lock modes are described in section Functions of the SAP Lock Concept.
  • The Table column contains the tables in which rows are locked.
  • In the Lock argument column, you can see the argument (key field) of the lock entry.

This corresponds to the entries in the lock table.

The lock entries are shown in different colours:

  • Blue means that the locks have already been transferred to the update task (see also The Owner Concept), with the result that the backup flag is set. These locks are also rewritten to the lock table when the enqueue server is restarted.
  • Black means that the lock (still) belongs to the dialog owner. The backup flag is not set.

By choosing Edit Sort by, you can display the locks according to user, time, table, or host system (host).

By double-clicking a lock entry, you can display detailed information, including the host name and number of the SAP System in which the lock was generated

Deleting Lock Entries 

Purpose of deleting lock entries

Certain problems can result in locks that cannot be released again, with the result that user cannot access the locked objects.
These locks, however, can be deleted manually.

In general, you should not delete lock entries directly with the deletion functions in lock management. Unreleased locks are almost always a symptom of a different problem. When you solve the problem, the lock entry will be released automatically.


The most frequent causes of unreleased lock entries:

1.Update problems

Locks set by the update function are maintained by the system until the database change has been processed or terminated prematurely. If a problem is preventing the update, the locks generated by the update records waiting to be processed block the system.

You can identify locks held by update records in the list of lock entries. The locks held by the V1 part of the update record are highlighted in the list. The backup flag is also set for these logs in the detailed display.


To determine whether an update problem exists, proceed as follows:

Note the lock key of the relevant lock entry. Select this entry and choose Details to display the transaction code.

Choose transaction SM13 or Administration-System Administration Monitor Update-(Update Management) to check whether any unprocessed update records (status init or auto) exist for the user. If you find any unprocessed update records, identify the transaction code and lock key to locate the update record that is holding the lock.
Note that update records with the status err do not hold locks. Locks are released automatically when an update task is terminated prematurely. If you find err update records, follow the procedure described under Analyzing and Rectifying Update Errors.

Check whether your update server is running correctly. Choose transaction SM51 or Administration-System Administration- Monitor -System Monitoring- Servers. Position the cursor on the application server on which an update server is running and choose Processes to display the work processes on the update server. If open update records exist and the update is running normally, you should be able to see the update processes changing.
If necessary, start the update server by choosing Tools-CCMS.

2.Premature SAPGUI termination

If a user switches off the PC without first logging off from the SAP System, or if the SAPGUI program is terminated prematurely for some reason, the user may remain logged onto the SAP System. The locks held by the user when the problem occurred are not released because the user is no longer active in the SAP System.


You can release these locks by logging off the user:

Choose transaction SM51 or Administration-System Administration-Monitor-System Monitoring-Servers.
Display the users of the SAP instance that are specified in the detailed display for the lock entries. To do this, use the User Overview (transaction SM04). Check when the user was last active in the system.
If the user was not active for a long time, he or she may have shut down the PC without completing his/her work or SAPGUI may have terminated prematurely.
If possible, contact the user directly. His or her work will be lost when you log him/her off.

If the user's SAPGUI was terminated prematurely, you can log off the user in the user overview. The user cannot request the lost locks again, even if he or she logs on again. In this case, he or she must repeat the work carried out on the locked objects.

Procedure of Deleting Lock Entries

Only delete lock entries if you are sure that they are invalid and can be deleted without impairing an active process (user session, update, and so on). Deleting a lock held by active users may result in data loss or inconsistencies.

If you want to delete an individual lock entry, position your cursor on the entry and choose Lock entry-Delete.

By choosing Lock entry---->Delete all, you can delete all the lock entries at once.

A warning is displayed first indicating the risks associated with deleting lock entries. Following this, a popup is displayed in which you can delete the lock entry.

Note:You can deactivate the warning for the current transaction by choosing Edit Suppress warning.

Result of Deleting Lock Entries

The locks are released and can be requested again.

Displaying Lock Statistics 

Purpose of Displaying Lock Statistics 

You can use lock statistics to monitor the locks that are set in your system. This can be useful for rectifying configuration problems.


You do not need to log onto the application server on which the lock server is running; the global statistics are always displayed.


In the initial lock management screen, choose (SM12) Extras Statistics to display the statistics. These are the statistics that have been compiled since the last time the lock server was restarted.


The information provided by the enqueue statistics is explained in the table below.

Enqueue Statistics at 1999/02/16 09:53:50

Enqueue Requests.....: 21128

Number of lock requests

Rejects...........: 209

Rejected lock requests

Errors............: 0


Dequeue Requests.....: 17820

Release requests (DEQUEUE)

Errors............: 0

Release (dequeue) errors

DequeueAll Requests..: 19402

Release of all locks for a LUW

CleanUp Requests.....: 52

Release of all locks in a server (when server is shut down)

Backup Requests......: 7

Number of requests passed to the update process

Reporting Requests...: 5

Requests to read lock entries (for example, SM12)

Compress Requests....: 0

Internal use

Verify Requests......: 0

Internal use

Writes to File.......: 3799

Write accesses to file

Backup............: 2

Write accesses to backup file

Owner Names..........: 3797

Maximum number of owner names that can be stored in the lock table

Peak Util.........: 22

Maximum number of owners stored simultaneously in the lock table

Actual Util.......: 12

Current number of owners in the lock table

Granule Arguments....: 3797

Similar: occupancy of the lock table, elementary locks - affecting arguments

Peak Util.........: 84

Actual Util.......: 14

Granule Entries......: 3797

Similar: occupancy of the lock table, elementary locks - affecting names

Peak Util.........: 84

Actual Util.......: 14

Update Queue Peak....: 2

Maximum number of accumulated update requests

Actual ...........: 1

Number of outstanding update requests

Total Lock Time......: 2407.752370s total

Total time required for lock operations

Total Lock Wait Time.: 0.000000s total

Total wait time of all work processes for accessing lock table

Total Server Time....: 4.901941s total

Total time needed for lock operations by all processes in the enqueue server


The occupancy of the lock table is important for monitoring the lock mechanism. This should never overflow. An overflow is pending if the Peak Util for Owner Names, Granule Arguments, or Granule Entries is equal to or has nearly reached the maximum value.