Ansicht
Dokumentation

ABENBDL_ASSOC_EXT_ABEXA - BDL ASSOC EXT ABEXA

ABENBDL_ASSOC_EXT_ABEXA - BDL ASSOC EXT ABEXA

BAL_S_LOG - Application Log: Log header data   SUBST_MERGE_LIST - merge external lists to one complete list with #if... logic for R3up  
This documentation is copyright by SAP AG.
SAP E-Book

- Node Extension

This example demonstrates how to add an extension node with behavior to a RAP BO.

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.

Extension RAP BO

CDS data model extension

One extension node is added to the RAP BO on the hierarchy level of the great-grandchild: DEMO_RAP_EXTENSIBLE_EXT. It defines associations to all four original nodes.

The direct parent entity of the extension node DEMO_RAP_EXTENSIBLE_GRCHLD is extended. The extension defines and exposes a composition association to the extension node.

BDEF extension

The BDEF extension DEMO_RAP_EXTENSION_1 adds the extension node to the RAP BO. It adds behavior to the extension node with the define behavior for syntax. It uses the syntax ancestor association for all associations except the one that leads to the direct parent node.

Source Code

Execute

Description

Access with ABAP using EML

The above source code uses and ABAP EML to access the RAP business object from an ABAP program and performs the following steps:

  • It performs a deep create, that means, it creates an instance of each entity of the composition tree, including the extension node.
  • It performs an update operation on the extension node. The instance authorization control for update operations, which is implemented in the ABP of the extended RAP BO, is checked and the update operation succeeds.
  • All five database tables used to store the entity data are displayed.





CPI1466 during Backup   TXBHW - Original Tax Base Amount in Local Currency  
This documentation is copyright by SAP AG.

Length: 4010 Date: 20240512 Time: 030001     sap01-206 ( 71 ms )