Ansicht
Dokumentation

ABAPCOMMIT_ENTITIES - COMMIT ENTITIES

ABAPCOMMIT_ENTITIES - COMMIT ENTITIES

SUBST_MERGE_LIST - merge external lists to one complete list with #if... logic for R3up   ABAP Short Reference  
This documentation is copyright by SAP AG.
SAP E-Book

COMMIT ENTITIES

COMMIT ENTITIES, Short Form

1. COMMIT ENTITIES $[IN SIMULATION MODE$].

COMMIT ENTITIES RESPONSE OF, Long Form

2. COMMIT ENTITIES $[IN SIMULATION MODE$] RESPONSE OF bdef1 response_param
                  $[RESPONSE OF bdef2 response_param$]
                  $[...$].


COMMIT ENTITIES BEGIN, END

3. COMMIT ENTITIES BEGIN $[IN SIMULATION MODE$]
                        $[${RESPONSE OF ... $| RESPONSES OF ... $} $[response_param$]$].
   $[CONVERT KEY OF bdef
      FROM $[TEMPORARY$] pre_key
      TO final_key.$]
  COMMIT ENTITIES END.


COMMIT ENTITIES RESPONSES, Dynamic Form

4. COMMIT ENTITIES $[IN SIMULATION MODE$] RESPONSES $[OF dyn_tab$] $[response_param$].

Effect

Triggers the RAP save sequence.

Within a RAP LUW, RAP BO instances are changed and created using MODIFY statements. These transactional changes are stored within the transactional buffer of a RAP BO. Since the content in the transactional buffer disappears at the end of the ABAP session, the saving of changed data to the database must be triggered, otherwise, modify operations would not have any effect on the database. COMMIT ENTITIES statements implicitly include COMMIT WORK after processing the save sequence and finish the RAP LUW. Thus, all RAP BO instances that were changed within the RAP LUW and that are present in the transactional buffer are persisted to the database.

COMMIT ENTITIES statements can be used for modify operations outside of a behavior pool in ABAP. In case of a natively supported RAP scenario (for example, OData), the COMMIT ENTITIES call is performed by RAP.

The following variants of the COMMIT ENTITIES statement can be used:

The short form of the COMMIT ENTITIES statement saves all instances of RAP BOs that are changed within the RAP LUW without providing any response parameters.
The long form of the COMMIT ENTITIES statement saves all instances of RAP BOs that are changed within the LUW and provides response parameters.
This form of the COMMIT statement is relevant for late numbering scenarios.
The dynamic form of the COMMIT ENTITIES statement allows the root entities for which the commit should be executed to be specified dynamically.

Notes

  • Using a COMMIT WORK statement triggers the save sequence and saves RAP BO instances from the transactional buffer to the database, too. However, the use of COMMIT ENTITIES statements is preferable in the context of RAP because they offer more features like the retrieval of responses or key conversion.

The following executable examples demonstrate the use of the respective statements.






Vendor Master (General Section)   General Material Data  
This documentation is copyright by SAP AG.

Length: 6473 Date: 20240623 Time: 190903     sap01-206 ( 73 ms )