Ansicht
Dokumentation
ABENEML_MODIFY_OP_FIELDS_ABEXA - EML MODIFY OP FIELDS ABEXA
BAL Application Log Documentation General Material DataThis documentation is copyright by SAP AG.
- MODIFY, Field Specification Expressions
This example demonstrates various standard operations and variants of field specification expressions to set up internal tables for MODIFY ENTITY statements to manipulate a simple managed RAP BO.
The following standard operations and field specification alternatives are covered in the example:
Operations
- CREATE
- CREATE BY association
- UPDATE
- DELETE
Field specification alternatives
- FROM
- FIELDS (...) WITH
- SET FIELDS WITH
Data model
The CDS data model consists of the root entity DEMO_MANAGED_ROOT
and its child entity DEMO_MANAGED_CHILD. Furthermore, it contains an association to an entity
(DEMO_MANAGED_ASSOC) that is not part of the
composition tree.
Root entity:
Child entity:
Behavior definition
The CDS behavior definition DEMO_MANAGED_ROOT is defined in CDS BDL as follows:
Behavior implementation
For the above CDS behavior definition, there is no ABAP behavior pool (ABP) created and needed since only standard CRUD operations are used in the example.
Source Code
Description
Access with ABAP using EML
The above source code uses EML to access the RAP business object from an ABAP program:
- Modify operations with FROM
- Two MODIFY ENTITY operations are executed with FROM for both root and child entity. To cover several operations in one go, four new data sets are created for the root entity of which one is updated and deleted in the same MODIFY statement. Furthermore, two data sets are created for the child entity via a create-by-association operation.
- Modify operations with FIELDS (...) WITH
- A CREATE, CREATE BY and UPDATE operation is demonstrated within one MODIFY ENTITY statement using the addition FIELDS (...) WITH.
- Modify operations with SET FIELDS WITH
- A CREATE, CREATE BY and UPDATE operation is demonstrated within one MODIFY ENTITY statement using the addition SET FIELDS WITH.
For demonstration purposes, several internal tables with the required BDEF derived type are created to be used with the modify operations. They include demo values to be shown in the output. The RAP framework reads the data from the respective database tables into a managed transactional buffer in which the operations take place. The changes are saved with the statement COMMIT ENTITIES, and, thus, the changed data are persisted to the database tables.
Addresses (Business Address Services) ROGBILLS - Synchronize billing plans
This documentation is copyright by SAP AG.
Length: 4540 Date: 20240425 Time: 070053 sap01-206 ( 37 ms )