Ansicht
Dokumentation
ABENBDL_USING_INTERFACE_ABEXA - BDL USING INTERFACE ABEXA
General Material Data BAL_S_LOG - Application Log: Log header dataThis documentation is copyright by SAP AG.
- RAP BO Extension Using Interface
This example demonstrates a RAP BO extension via a RAP BO interface.
Original RAP BO
Data model
The CDS data model consists of four nodes which form a hierarchical CDS composition tree. They are connected via CDS compositions.
Root entity:
Child entity:
Grandchild entity:
Great-grandchild entity:
Behavior definition
The CDS behavior definition
DEMO_RAP_EXTENSIBLE_ROOT is defined in
CDS BDL as shown below. It defines a managed, draft-enabled RAP BO with multiple extension points.
Behavior implementation
For the CDS behavior definition, one ABAP behavior pool (ABP) is created. The global class of the behavior pool is BP_DEMO_RAP_EXTENSIBLE_ROOT, see BP_DEMO_RAP_EXTENSIBLE_ROOT===CCIMP. It implements the method get_instance_authorizations for instance authorization control. It returns information on whether update and delete operations are allowed on instances. In this example, these operations are not allowed if CharField has a particular value.
This is a simple example that serves demonstration purposes.
RAP BO Interface
CDS data model projection
Root node projection:
Child node projection:
Projection of grandchild node:
Projection of great-grandchild node:
CDS interface behavior definition
The following interface BDEF projects the original RAP BO.
BDEF Extension
The BDEF extension DEMO_RAP_EXT_USING_INTERF extends the RAP BO via its interface. It addresses the
root node by its interface name, RootInterface. It adds one extension action to the RAP BO.
Extension ABP
The extension action setValue_ext is implemented in the extension ABP, see
BP_DEMO_RAP_EXT_USING_INTERF==CCIMP. When executed, it changes the value of field CharInt.
Source Code
Description
Access with ABAP using EML
The above source code uses and ABAP EML to access the RAP BO interface from an ABAP program and performs the following steps:
- It creates two instances of the root entity.
- It executes the action setValue_ext for one of the instances.
- The content of the database table after the create operation and after the action is displayed.
SUBST_MERGE_LIST - merge external lists to one complete list with #if... logic for R3up Addresses (Business Address Services)
This documentation is copyright by SAP AG.
Length: 3829 Date: 20240512 Time: 104857 sap01-206 ( 51 ms )