Lock Object SAP ABAP Web Dynpro

We create a Lock Object for the database table YPERSON. The lock object name has to begin with the prefix E (from “Enqueue”).

Lock object

Lock object

Our case consists of exactly one table, and the lock argument is the primary key of this table. The lock mode is set to write, but can be overwritten.

After the lock object activation, the ABAP Dictionary generates two Function Modules, named ENQUEUE_ and DEQUEUE_. The Function Modules with enqueue prefix help us to set a lock, and the Function Modules with dequeue prefix help us to release the locks.

With the SE37 transaction we can see the two generated Function Modules: ENQUEUE_EYPERSON and DEQUEUE_EYPERSON. Figure shows the structure of the Function Module required to set a lock.

Function Module for lock setting

Function Module for lock setting

SAP offers a lock mechanism required to provide two transactions by simultaneously changing the same data in the database.The lock table represents a table in the memory of the enqueue server and is used to manage all the locks in the system. This lock table is checked every time when the enqueue server receives a lock request. A program sends, to the lock table, the key of the table entries it wants to lock; if no lock is set, the request is accepted and the new lock is written in the lock table. If a lock is set, the request collides with an existing lock and the request is rejected.


All rights reserved © 2018 Wisdom IT Services India Pvt. Ltd DMCA.com Protection Status

SAP ABAP Web Dynpro Topics