SAP EML RESPONSES ABEXA



Get Example source ABAP code based on a different SAP table
  



ABAP_EML - Responses
This example demonstrates the response parameters that follow the ABAP words FAILED, MAPPED and REPORTED in a managed RAP BO. The scenario provokes errors while trying to modify RAP BO instances using the MODIFY statement. The output results are displayed for showcasing purposes.
Data model
The CDS data model consists of the root entity DEMO_MANAGED_ROOT _CUSTOM and its child entity DEMO_MANAGED_CHILD_CUSTOM.
Root entity:
DDLS DEMO_MANAGED_ROOT_CUSTOM
Child entity:
DDLS DEMO_MANAGED_CHILD_CUSTOM
Behavior definition
The RAP behavior definition DEMO_MANAGED_ROOT_CUSTOM is defined in RAP BDL as follows:
BDEF DEMO_MANAGED_ROOT_CUSTOM
Behavior implementation
For the above RAP behavior definition, there is an ABAP behavior pool (ABP) available. The global class of the behavior pool is BP_DEMO_MANAGED_ROOT_CUSTOM. This global class implements the local handler class LHC_DEMO_MANAGED_ROOT_CUSTOM. The actual implementation takes place in the BP_DEMO_MANAGED_ROOT_CUSTOM===CCIMP. The details of the behavior implementation are not relevant for this example since no custom operations are used.

ABAP_SOURCE_CODE
DEMO CL_DEMO_RAP_EML_RESPONSES

ABAP_DESCRIPTION
The above source code uses EML to access the RAP business object from an ABAP class.
The example covers multiple ABAP_EML modify requests. Some of them are successful. For both, root and child entity, there are data sets defined that will cause an error.
As a consequence, apart from the mapping information, the responses for FAILED and REPORTED that are displayed in the output cover the information of the affected data sets for which errors occurred. Furthermore, tables display the data sets for which the create, update and delete operations were successful for both, root and child entity.