In a lock object we define the tables in which data records must be locked with a lock request, and the key fields of these tables as Lock parameters.
When we activate the lock object, the two function modules ENQUEUE_<lockobjectname> and DEQUEUE_<lockobjectname> are generated from its definition to set and release locks respectively.
If you want to lock records in more than one table with the lock object,further tables (secondary tables) can also be added using foreign key relationships.(the foreign key fields must be key fields of the foreign key table).
Types of Lock modes :
Exclusive lock/Write lock : The locked data can be read or processed by one user only. A request for another exclusive lock or for a shared lock is rejected.
Shared lock/Read Lock : Several users can read the same data at the same time, but as soon as a user edits the data, a second user can no longer access this data. Requests for further shared locks are accepted, even if they are issued by different users, but exclusive locks are rejected.
Exclusive but not cumulative lock : Exclusive locks can be requested by the same transaction more than once and handled successively, but an exclusive but not cumulative lock can only be requested once by a given transaction. All other lock requests are rejected.