Lock Modules
If a lock is set when calling the respective lock module, the lock mode can be specified to determine the type and purpose of the lock. If no specification is made, the default in the definition of the respective lock object applies.
Lock modes used to set locks include the following:
- Mode “S”
Mode "S" can be used by a dialog program to ensure that other users cannot change the data displayed by the program during the display time. However, the mode also does not allow you to make any changes to the displayed data.
For example, the program determines a price for a flight, and displays it to a customer. While the customer considers whether or not to book the flight, you want to ensure that the price will not be changed.
Multiple "S" locks on one lock key can exist. When this is the case, no one can add any exclusive lock with the same key. As a typical use case for mode "S", do not intend to change the data but make sure that no one else performs a change. This step can be performed by many in parallel.
- Mode “O”
Mode “O” is implemented to display data in the change mode, and provides the option to edit data if necessary.
For example, while displaying a list of flights, you need to add a new booking for one of the flights. Creating a file booking impacts the number of occupied seats in the chosen flight. Therefore, you want to lock all displayed flights in a way that does not hinder other users in the system. You also need to create a real write lock if you decide to book the flight later.
Multiple "O" locks on one key can exist. When this is the case, only one user or program can add or upgrade to an exclusive lock with the same key.
As a typical use case for lock mode "O", you and other users might intend to change the data. Before changing the data, again ask the local service to ensure that no one else is in change mode by then.
- Mode “E”
Mode “E” sets a lock for changing data and can be accumulated. Accumulation occurs if the same lock is requested successfully more than once within the same program run, thus with the same lock key. This can happen, for example, if a program that asked for a lock is calling a function module or a method, which again is requesting the same lock.
For example, you want to book a flight. After you have chosen the flight you want to book, you must make sure that no other customer books the same seat on the flight. To do this, you must lock the respective seat with mode “E”.
Only a single "X" or "E" lock can exist for a key. An "E" lock can be cumulated. As a typical use case for lock mode "E", you explicitly intend to change data and therefore you lock exclusively.
- Mode “X”
Mode “X” functions similarly to mode ”E” when changing data, with the only difference being that, in mode “X”, the respective lock does not allow accumulation.
For example, navigation options in a program allow you to enter various functions to edit the flight. To ensure that the flight can be edited in only one of the dialogs, an exclusive and noncumulative lock is used.
An "X" lock cannot be accumulated. As a typical use case for lock mode "X", you explicitly intend to change data and therefore you lock exclusively.

Cumulate Locks – Additional Lock Request from Another Program Instance
If there are existing locks in the system, attempts to set additional locks may arise from the program instance (or from a method or function module called synchronously from this program instance) that has already set an existing lock. However, attempts to set additional locks may also arise from a different program instance. A different program instance may be a second instance of the same program started by the same or (more likely) any other user.
In case the program instance is a second instance of the same program, attempts to set locks are treated as follows:
- Existing exclusive locks (“E” or “X”) categorically reject every lock attempt of another program, regardless of the mode in which the other user attempts to set the lock.
-