Lock Owners

Definition

Person who holds a lock.

Use

At the start of an SAP transaction, two owners are always created who can request locks.

A lock can have one or two owners. You use the _SCOPE parameter to specify this.

To determine in a program which user is currently holding a lock, use the ENQUEUE_  function module.  This function module puts the name of the owner into SY-MSGV1.

Structure

There are dialog owners and update owners.

An owner is identified by his or her owner ID, as described in the section entitled The Lock Table.

A lock can have one or two owners. The ABAP programmer uses the _SCOPE parameter to define this (see below).

Example

The graphic below shows how lock owners function during a dialog transaction.

SAP LUW: Dialog Transaction with Update

At the start of the dialog transaction, the system creates two lock owners: the dialog owner Owner_1 and the update owner Owner_2.

During the course of the transaction, Owner_1 requests a lock, as does Owner_2 slightly later. When the update task is called (see also Functions of the Update Task), the lock and Owner_2 are inherited by the update task. An update work process is started with two owners, in the same way as a dialog work process, and then has three owners until the update is completed. All of the locks are released with an implicit DEQUEUE_ALL at the end of the update, at the latest.

See also:

The Lock Table

Lock Collisions

Cumulation of Locks