Ansicht
Dokumentation

ABAPSET_LOCKS - SET LOCKS

ABAPSET_LOCKS - SET LOCKS

CL_GUI_FRONTEND_SERVICES - Frontend Services   BAL_S_LOG - Application Log: Log header data  
This documentation is copyright by SAP AG.
SAP E-Book

SET LOCKS

SET LOCKS ENTITY, Short Form

1. SET LOCKS ENTITY bdef FROM inst $[response_param$].

SET LOCKS OF, Long Form

2. SET LOCKS OF bdef
   ENTITY bdef1 FROM inst1
  $[ENTITY bdef2 FROM inst2$]
  $[...$]
  $[response_param$].

SET LOCKS lock_tab, Dynamic Form

3. SET LOCKS lock_tab $[response_param$].

Effect

Used to set enqueue locks for RAP BO instances to prevent the concurrent modification of instances. The locking for a subsequent modification is implicitly done by the RAP framework. However, if the RAP BO consumer requires an exclusive locking so that no other user can change the same instance in parallel, the statements can be used. The lock is active until the end of a RAP LUW.

In the BDEF, the root entity must always be specified with lock master. All child entities are always lock dependent. Consequently, when child entities are requested to be locked, their corresponding instance of the root entity is locked. See more details on the BDEF prerequisites in the CDS BDL documentation for locking.

The addition response_param is optional. If an instance is already locked in parallel, information with the failure cause IF_ABAP_BHEV-LOCKED is returned in the FAILED response parameter. See the interface IF_ABAP_BEHV.

The following variants of the statement SET LOCKS enable the exclusive locking of instances:

The short form of the SET LOCKS statement allows instances of a single entity to be locked.
The long form of the SET LOCKS statement allows instances of multiple entities to be locked.
The dynamic form of the SET LOCKS statement allows multiple instances to be collected and locked in multiple entities in one SET LOCKS statement.





ABAP Short Reference   ROGBILLS - Synchronize billing plans  
This documentation is copyright by SAP AG.

Length: 3757 Date: 20240419 Time: 065654     sap01-206 ( 46 ms )