Enqueue and Dequeue Function Module
Enqueue and Dequeue Function Module
- SAP Lock
Mechanism –
X_
A further parameter X_ that defines the lock behavior when the initial value is passed exists for every
lock field . If the initial value is assigned to and X_, then a generic lock is initialized with respect to . If
is assigned the initial value and X_ is defined as X, the lock is set with exactly the initial value of .
Well , this means if you need a parameters initial value to lock , you must set X_ = 'X' for this purpose
otherwise it locks entire values.
_SCOPE
1: Locks or lock releases are not passed to the update program. The lock is removed when the
transaction is ended.
2: The lock or lock release is passed to the update program. The update program is responsible for
removing the lock. The interactive program with which the lock was requested no longer has an
influence on the lock behavior. This is the standard setting for the ENQUEUE function module.
3: The lock or lock release is also passed to the update program. The lock must be removed in both the
interactive program and in the update program. This is the standard setting for the DEQUEUE function
module.
MODE_
S (read lock)
E (write lock)
X (extended write lock)
O (optimistic lock)
Locks Modes
Type of Lock Lock mode Description
Shared lock S (Shared) Several users (transactions) can access
locked data at the same time in display mode.
Requests from further shared locks are
accepted, even if they are from different
users. An exclusive lock set on an object that
already has a shared lock will be rejected.
Exclusive lock E (Exclusive) An exclusive lock protects the locked object
against all types of locks from other
transactions. Only the same lock owner can
reset the lock (accumulate).
Exclusive but not X (eXclusive non- Whereas exclusive locks can be requested
cumulative lock cumulative) several times by the same transaction and
released one by one, an exclusive, non-
cumulative lock can only be requested once
by the same transaction. Each further lock
request will be rejected.
Optimistic lock O (Optimistic) Optimistic locks initially behave like shared
locks and can be converted into exclusive
locks. See Optimistic Locks.
_COLLECT
Initial Value: The lock request or lock release is sent directly to the lock server.
X: The lock request or lock release is placed in the local lock container. The lock requests and lock
releases collected in this lock container can then be sent to the lock server at a later time as a group
by calling the function module FLUSH_ENQUEUE.
_WAIT
Initial Value: If a lock attempt fails because there is a competing lock, the exception FOREIGN_LOCK is
triggered.
X: If a lock attempt fails because there is a competing lock, the lock attempt is repeated after waiting
for a certain time. The exception FOREIGN_LOCK is triggered only if a certain time limit has elapsed
since the first lock attempt. The waiting time and the time limit are defined by profile parameters.
_SYNCHRON
If X is passed, the DEQUEUE function waits until the entry has been removed from the lock table.
Otherwise it is deleted asynchronously, that is, if the lock table of the system is read directly after the
lock is removed, the entry in the lock table may still exist.
Tcode DB01 - Used to identify/trace the deadlocks of your tables. Tcode SM12 - Used to check any other
objects or any other user is locking the table or object. Goto SM12 -> put user name = "*" and execute.
Now, check for your table which showing the lock in the
Tcode DB01 - Used to identify/trace the deadlocks of your tables.
Tcode SM12 - Used to check any other objects or any other user is locking the table or object.
Now, check for your table which showing the lock in the entries.
https://www.youtube.com/watch?v=rFaoKzpu3s8
https://www.youtube.com/watch?v=IU2NjcDLybU
https://www.youtube.com/watch?v=VG0S2vnZWg4
https://www.youtube.com/watch?v=RVhJcj2fWEM
51 - ABAP Dictionary - Lock Objects - Lock Modes Part2
https://www.youtube.com/watch?v=Qu5K2uA43u4
52 - ABAP Dictionary - Lock Objects - Creation
https://www.youtube.com/watch?v=OxTUUc8Q9LM
EZ or EY
https://www.youtube.com/watch?v=U-46bA6lrAo
54 - ABAP Dictionary - Lock Objects - Use of Lock Object in a Program Part1
https://www.youtube.com/watch?v=fVIIS6dhYz8
55 - ABAP Dictionary - Lock Objects - Use of Lock Object in a Program Part2
https://www.youtube.com/watch?v=EfqiCOAAjMk
https://www.youtube.com/watch?v=bgZoZdCOAI4
57 - ABAP Dictionary - Lock Objects - Use of Lock Object in a Program Part4 (Debug)
https://www.youtube.com/watch?v=VkBUFlj-t14
58 - ABAP Dictionary - Lock Objects - Use of Lock Object in a Program Part5 (Write lock)
https://www.youtube.com/watch?v=xIkbLuGU_Oo
https://www.youtube.com/watch?v=0s0gqbpxpcg
https://www.youtube.com/watch?v=BcZBSRHhtVw
61 - ABAP Dictionary - Lock Objects - Practical Difference of Write Lock and Enhanced Write Lock
https://www.youtube.com/watch?v=bu1IbkPPuyg
https://www.youtube.com/watch?v=VpiOag_ICFI
lock object creation
https://www.youtube.com/watch?v=PEyci4WmUgU
https://www.youtube.com/watch?v=pB7y8D4H4K4
32:12
SM12