In a simple language when multiple people try to access a same record in SAP, we can restrict others and allowing only one person to access the data. This can be achieved by lock objects.
Lock objects check in runtime whether anyone is using the same data, if so no one else can access the same unless first user came out of that data. This secures the data access.
There are mainly Three Types of locks
– Shared Lock (Read lock)
– Exclusive Lock (write lock)
– Exclusive but not Cumulative Lock
Note: By default lock objects are shared lock.
When you create a lock object, the system automatically generates two function modules with the names ENQUEUE_<lock object name> and DEQUEUE_<lock object name>.You can then set and release SAP locks in your ABAP program by calling these function modules in a CALL FUNCTION statement.
You can create a lock object from SE11 transaction by selecting the Lock object radio button. The name should always start with "E".