Ansicht
Dokumentation
ABENEML_RESPONSES_DYN_ABEXA - EML RESPONSES DYN ABEXA
Addresses (Business Address Services) ROGBILLS - Synchronize billing plansThis documentation is copyright by SAP AG.
- Responses (Dynamic Forms of Statements)
This example demonstrates responses for the dynamic form of the MODIFY and READ statements with a simple managed
RAP BO.
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. It is not used in the example.
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.
Source Code
Description
Access with ABAP using EML
The above source code uses EML to access the RAP business object from an ABAP program:
- Dynamic modify operations using MODIFY ENTITIES OPERATIONS
- Various operations on data sets of the root and child entity are executed. For that purpose, an internal table with type ABP_BEHV_CHANGES_TAB must be defined. This table includes parameters (in this case, among others, other tables holding demo data and being typed with the required BDEF derived type) to carry out the modifications. Errors are intentionally caused for the modify operations so that the response parameters for FAILED and REPORTED are filled with entries. Furthermore, the MAPPED response is included. All three response parameters are of type ABP_BEHV_RESPONSE_TAB. The program provides methods to display selected parts of those responses that are put into internal tables that are displayed in the output screen as well as the database table entries after the modifications. The saving of the modification is triggered by a COMMIT ENTITIES statement.
- Dynamic read operations using READ ENTITIES OPERATIONS
- Various read operations on data sets of the root and child entity are executed. For that purpose, an internal table with type ABP_BEHV_RETRIEVALS_TAB must be defined. This table includes parameters (in this case, among others, other tables holding demo data and being typed with the required BDEF derived type) to carry out the reading. Errors are intentionally caused for the read operations so that the parameter for FAILED is filled with entries (the REPORTED parameter does not get filled by the RAP BO provider in this example). Also here, the response parameter is of type ABP_BEHV_RESPONSE_TAB. Same as above, the responses are put into an internal table that are displayed in the output screen (note that this internal table is shared for the output of failures for the modify and read operations in this example, i. e. the columns for create, delete and update are not relevant for read operations and must be ignored) as well as the database table entries after the read operation.
BAL_S_LOG - Application Log: Log header data Vendor Master (General Section)
This documentation is copyright by SAP AG.
Length: 4447 Date: 20240426 Time: 162525 sap01-206 ( 102 ms )