Showing posts with label SAP Lock Concept. Show all posts
Showing posts with label SAP Lock Concept. Show all posts

Deleting Lock Entries

Certain problems can result in locks that cannot be released again, with the result that uses cannot access the locked objects.

These locks, however, can be deleted manually.

Caution Caution

In general, however, you should not directly delete locks with the delete functions offered in the lock management system. Unreleased locks are almost always the symptom of another underlying problem. When you correct the underlying problem, the locks will be released automatically.

End of the caution.

More information: Locks: Questions and Answers

Procedure

Analyzing the Problem

First try to identify and remove the problem.

The most frequent causes of unreleased locks are the following:

  • Problems in update processing.

    Locks that are held by an update are kept in place by the System until the update has been processed or has terminated abnormally. If a problem prevents updates from being processed, then the locks held by the unprocessed updates can block work in the System.

    You can identify locks that are held by updates in the list of locks display. The locks that are held by the U1 portion of an update are highlighted in the list. In the Details display, such locks also have the Backup flag field set.

    Corrective action: Check for a possible update problem. Proceed as follows:

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

    2. 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.

    3. Check that your update server is operating normally. Call transaction SM51 or choose  Administration  System Administration  Monitor  System Monitoring  Server  , position the cursor on the application server on which an update server is running, and then choose Processes. This displays the work processes on the update server. You should see activity in the update processes if there are outstanding updates and update processing is functioning normally.

      If not, try to restart the update server.

  • Premature Termination of SAP GUI. 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.

    Corrective action: You can release these locks by logging off the user. Proceed as follows:

    1. Call transaction SM51 or choose  Administration  System Administration  Monitor  System Monitoring  Server  .

    2. Display the users in the SAP instance named in the lock Details display. To do this, use the User Overview (transaction SM04). In the user display, check the time of the user's last activity in the system.

      If the user has been inactive for a long time, he or she may have left their workstation without completing a task or the SAP GUI may have ended abnormally.

      Check with the user directly, if possible. The user's work is lost when he or she is logged off.

    If the user's SAP GUI has ended abnormally, you can log off the user in the User Overview. The user cannot reclaim the lost locks even if he or she logs on again. In this case, he or she must repeat the work carried out on the locked objects.

Deleting Locks

Caution Caution

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 an active user can lead to loss of the data entered by the user or to data inconsistencies.

End of the caution.

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 display first indicating the risks associated with deleting lock entries. After this, a dialog box is displayed in which you can delete the lock entry.

Note Note

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

End of the note.

Result

The locks are released and can be requested again.

Selecting and Displaying Lock Entries

You can select lock entries for display by

  • The table in which rows are locked

  • The argument of the lock entry

  • Client

  • User who set the lock

The client and your user are added automatically on the initial screen. If you want to display the locks of a different user or client, you must overwrite the relevant field. f you leave the field blank or enter a *, the data is selected according to all possible entries.

Procedure

Information in the lock entry display includes the following:

Displaying Lock Entries

Column

Meaning

Client

Client in which a lock entry was created

User name (UNAME)

User who set the lock (that is, the user who executed the ABAP program that created the lock).

Time

Start time of the LUW (Logical Unit of Work), in which the lock entry was created.

Caution Caution

This is not the time the lock was set. The LUW may have occurred much earlier.

End of the caution.

Lock Mode

Type of lock object

Lock types are: S (shared lock), E (exclusive lock), X (exclusive non-cumulative lock), O (optimistic lock)

More information: SAP Lock Concept

Table

The table in which rows are locked

Lock Argument

Argument (key field) of lock entry; corresponds to the entries in the Lock Table.

Cum.Counter Dialog

Cumulation counter of the lock entry for the dialog owner

More information:

Cumulating Locks

Lock Owners

Cum.Counter Update

Cumulation counter of the lock entry for the update owner

More information:

Cumulating Locks

Lock Owners

Backup Flag

Locks highlighted in color are those that have already been inherited by the update task, and for which the backup flag is set.. These locks are also rewritten to the lock table when the enqueue server is restarted.

Locks not highlighted still belong to the dialog owner. The backup flag is not set.

Sorting

By choosing  Edit  Sort by  , you can sort the display by user, time, table, or host system.

Detail Informationen

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.

Managing Lock Entries

Managing lock entries lets you monitor your system with regards to lock logic. You can determine which locks are being used currently. Locks that have had the backup flag set are highlighted in color (see Choosing and Displaying Lock Entries).

You can detect and correct problems by deleting locks that you no longer want. You can also later analyze the cause of lock table overflows using the History

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.

Features

The initial screen for managing locks appears as follows:

This graphic is explained in the accompanying text.

Transaction SM12 — Initial Screen

Lock management lets you:

  • Select and display lock entries

  • Delete lock entries

  • Test lock management

  • Display lock statistics

Activities

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