Ansicht
Dokumentation

ABENBDL_PRECHECK - BDL PRECHECK

ABENBDL_PRECHECK - BDL PRECHECK

ROGBILLS - Synchronize billing plans   BAL Application Log Documentation  
This documentation is copyright by SAP AG.
SAP E-Book

- precheck

... precheck ...

Effect

A method that is called before a modify request is executed on the transactional buffer to prevent unwanted changes from reaching the application buffer.

A precheck can be defined for the following RAP BO operations:

An implementation in the RAP handler method FOR PRECHECK in the local ABAP behavior pool is required.

Availability

Projection Implementation

If a precheck is defined in a projection implementation, an ABAP behavior pool is required.

If the base BO defines a precheck, this is automatically reused. The projection can also define a new precheck. Also, it is possible to define a precheck for both layers. In this case, first, the precheck of the projection layer is called and afterwards the precheck of the base layer.

Development guide for the ABAP RESTful Application Programming Model, section Operation Precheck.

Note

Can not be used for internal operations using the keyword internal.

Example

The following example shows an unmanaged BDEF based on the CDS view entity DEMO_RAP_UNMANAGED_PRECHECK. It defines the RAP BO operation addition precheck for the standard operation create.

In the ABAP behavior pool BP_DEMO_RAP_UNMANAGED_PRECHECK, the precheck method implements a uniqueness check. It checks that the primary keys for new created entity instances are unique. If the primary key values already exist, an entry is written into the failed and reported structures and the respective entity instance doesn't reach the application buffer.

Code snippet:

For the complete implementation in the ABAP behavior pool, see BP_DEMO_RAP_UNMANAGED_PRECHECKCCIMP.

The program DEMO_RAP_UNMANAGED_PRECHECK accesses the business object using EML and performs the following steps:

  • It inserts data into the database using INSERT.
  • It creates two valid new entity instances with unique keys. They pass the precheck and are written to the database.
  • It creates two more new entity instances - one is valid, one has a duplicate key value (value '1' already exists).
  • The entity instance with duplicate key is written into the failed and reported structures. The valid entity instance is committed to the database.





General Data in Customer Master   CL_GUI_FRONTEND_SERVICES - Frontend Services  
This documentation is copyright by SAP AG.

Length: 4752 Date: 20240329 Time: 093740     sap01-206 ( 57 ms )