Ansicht
Dokumentation

ABENCDS_SIMPLE_MANAGED_BO_ABEXA - CDS SIMPLE MANAGED BO ABEXA

ABENCDS_SIMPLE_MANAGED_BO_ABEXA - CDS SIMPLE MANAGED BO ABEXA

General Data in Customer Master   Addresses (Business Address Services)  
This documentation is copyright by SAP AG.
SAP E-Book

- Simple Managed RAP Business Object

This example demonstrates a simple managed RAP business object and uses EML to access it.

Data model

The CDS data model consists of one single root entity without child entities:

Behavior definition

The CDS behavior definition DEMO_CDS_SIMPLE_MANAGED_BO is defined in CDS BDL as follows:

One CRUD operation is specified with update.

Behavior implementation

For the above CDS behavior definition, one ABAP behavior pool (ABP) is created. The global class of the behavior pool is BP_DEMO_CDS_SIMPLE_MANAGED_BO. There is no self-defined behavior implementation in the BP_DEMO_CDS_SIMPLE_MANAGED_BO=CCIMP of the behavior pool and the global class has no components. For managed RAP business objects, the managed RAP BO provider can take over all operations. In fact, you don't need to create an behavior pool at all.

Business service

There is no business service and no service binding defined for the above root entity. The business object should be accessed by EML only.

Source Code

Execute

Description

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

  • A read operation is executed with the statement READ ENTITY.
An internal table fields specifies the data to be read. The RAP transactional engine reads the data from the respective database table into a managed transactional buffer and returns them in internal table read_data.
  • An update operation is executed with the statement MODIFY ENTITY.
With the addition SET FIELDS the data to be updated are passed to the business object. For that the flight price is enhanced by an amount given by the input value percentage. The update takes place in the internal buffer of the business object.
  • The changes are saved with the statement COMMIT ENTITIES.
The internal buffer of the business object is used to update the respective table on the database.

No self-written code of the ABAP behavior pool is involved here. All actions are performed by the managed RAP BO provider. ABAP SQL queries before and after using EML show, that the prices are increased according to the input.






TXBHW - Original Tax Base Amount in Local Currency   PERFORM Short Reference  
This documentation is copyright by SAP AG.

Length: 4229 Date: 20240426 Time: 062311     sap01-206 ( 53 ms )