ABAP Keyword Documentation → ABAP − Reference → ABAP RESTful Programming Model → Entity Manipulation Language
ABAP EML - COMMIT ENTITIES
Other versions:
7.31 | 7.40 | 7.54
Syntax
COMMIT ENTITIES
[RESPONSE OF root_name_1
[FAILED it_failed | DATA(it_failed)]
[REPORTED it_reported | DATA(it_reported)]]
[RESPONSE OF root_name_2
[FAILED
it_failed | DATA(it_failed)]
[REPORTED it_reported | DATA(it_reported)]].
Effect
If MODIFY statements are not executed within a behavior pool and are executed by an ABAP report instead, they would be ignored by the database at first. This is because they are applied only to the transactional buffer (by definition) and the buffer content disappears at the end of the ABAP session. This means the save sequence must be triggered in this scenario. The statement COMMIT ENTITIES is used to do this.
The statement COMMIT ENTITIES saves all business objects that are changed within the LUW.
In its simplest form, the statement COMMIT ENTITIES does not have any parameters.
RESPONSE can be used to obtain the response information of one or more business objects manipulated previously using MODIFY. A RESPONSE clause is then created for each root entity involved (root_name_1, root_name_2, ...):
The response variables are structures with n component (one component for each entity in the business object). Up to two variables can be specified for holding the response information for each root entity in question. FAILED and REPORTED. There are no key assignments in the statement COMMIT, which is why the response structure MAPPED is not used. The response variables must either have the matching type (for example, FAILED it_failed) or be declared inline (for example, FAILED DATA(it_failed)). These are the late response types: Instances are identified using the keys valid in the save phase.
The row type of the response structures FAILED and REPORTED has the type ABP_BEHV_RESPONSE_TAB and consists of the following fields:
- ROOT_NAME Type ABP_ROOT_ENTITY_NAME
- ENTITY_NAME Type ABP_ENTITY_NAME
- ENTRIES Type REF TO DATA
Contains the derived table type for FAILED|REPORTED
Note
Within a behavior implementation, COMMIT ENTITIES is one of the forbidden statements. This restriction is also checked dynamically. If violated, the runtime error BEHAVIOR_ILLEGAL_STATEMENT occurs.