Lock Objects
Understanding SAP Lock Object Mechanism
Lock objects are a mechanism to control as to how the update takes place when more than one user is updating the data in the same table.
To create lock objects you will need two function modules.
1. ENQUEUE_<LOCK_OBJECT_NAME>
This function module is used to generate a lock entry in the table making it only accessible to only one user. Incase, for any reason if the lock object function module is not able to lock the table. It will reflect in the return code.
2. DEQUEUE_<LOCK_OBJECT_NAME>
This function module is used to release the locks.
Now, If you want to end up having different programs trying to update the same database table. To avoid problems code your database updates between 1 & 2.
There are basically two types of lock:
Types of Lock
Shared Lock : Is a read only lock that prevents the data from being changed when another user is reading it.
Exclusive Lock: Is a write lock that prevents data from being changed when another user is updating it.
COPYRIGHT SAP Database : Repository of all the freely available information on SAP.
If you like this post, you may as well like these too:
- List of local objects in the SAP system This Program provides you with a list of all the objects in SAP System. *---------------------------------------------------------------------- * Report ZLOCAL * Author: Swarna.S. (Tata Consultancy Services) *---------------------------------------------------------------------- * AS: List of...
- Simple ALV Report - Details of Y or Z Objects *&---------------------------------------------------------------------* *& Report Z_OBJECT_TRACKER * *& Author :Swarna.S. *&---------------------------------------------------------------------* *& *& AS: *& Simple ALV report -- Details of Y or Z objects *& showing lists of all the...
- How to define types and data objects REPORT CHAP0101. * Elementary type character, length 20DATA CUSTOMER_NAME(25) TYPE C. * Non-elementary typeTYPES T_NAME(25) TYPE C.DATA NEW_CUSTOMER_NAME TYPE T_NAME.* Reference to a data objectDATA VENDOR_NAME LIKE CUSTOMER_NAME. *...
- Not Yet Using ABAP Objects? Eight Reasons why every ABAP Developer should give it a second look. SAP Introducted ABAP objects for a while ago now. Many ABAP Developers turned in and tapped the...
- ABAP Programs: Copying structured objects * Using move-corresponding to copy fields with the same nameDATA: BEGIN OF MY_CUSTOMER, ID(8) TYPE N, NAME(25), CITY(25), END OF MY_CUSTOMER, BEGIN OF CITY_OF_CUSTOMER, CITY LIKE MY_CUSTOMER-CITY, TEXT(30), ID...

















Leave a Reply