Ansicht
Dokumentation

ABENABP_MAP_MESSAGES_ABEXA - ABP MAP MESSAGES ABEXA

ABENABP_MAP_MESSAGES_ABEXA - ABP MAP MESSAGES ABEXA

ROGBILLS - Synchronize billing plans   rdisp/max_wprun_time - Maximum work process run time  
This documentation is copyright by SAP AG.
SAP E-Book

Example for RAP Saver Method map_messages

This example demonstrates the RAP saver method map_messages within a RAP saver class using unmanaged RAP BOs.

Data model

The CDS data model consists of the root entity DEMO_UNMANAGED_MAP_MESSAGES, which represents the exposed RAP BO, and the foreign entity DEMO_UNMANAGED_FOREIGN_ENTITY, i. e. the RAP BO that is not exposed.

CDS data model of the exposed BO:

CDS data model of foreign entity:

Behavior definition

The following CDS behavior definitions, that are defined in CDS BDL, are relevant for the example:

Behavior implementation

For each of the above CDS behavior definitions, one ABP is created:

The ABPs purposely include only a few method implementations to keep the example small. In this case, only the create method is implemented on handler side. On saver side, only the save method is implemented. The ABP of the exposed BO also includes the implementation of the map_messages method.

In this simple example, the map_messages method is implemented as follows: The messages that are available in the REPORTED LATE table of the foreign entity are sequentially processed within a LOOP AT statement. Here, the message from the foreign entity is first replaced, and then inserted into the REPORTED LATE table of the exposed BO. After the loop, the content of the REPORTED LATE table of the foreign entity is deleted.

Source Code

Execute

Description

Access with ABAP using EML

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

The example includes two MODIFY requests within one RAP LUW. Each of the MODIFY requests includes a create operation using CREATE statements that create two instances for the exposed BO and the foreign entity. A COMMIT ENTITIES statement triggers the save sequence and terminates the RAP LUW.

The output shows the result of the MODIFY requests. The instances that have been saved to the database table are selected from the database table into an internal table. The COMMIT ENTITIES statement includes the REPORTED response. The content of this response is output, too, demonstrating the effect of the map_messages method. The original messages for the instances of the foreign entity are available for the exposed BO. Furthermore, the messages have been changed and the REPORTED table of the foreign entity does not show any entries since the content has been deleted.






ROGBILLS - Synchronize billing plans   PERFORM Short Reference  
This documentation is copyright by SAP AG.

Length: 5001 Date: 20240511 Time: 104745     sap01-206 ( 69 ms )