Ansicht
Dokumentation

ABENBDL_DETERMINE_ACTION - BDL DETERMINE ACTION

ABENBDL_DETERMINE_ACTION - BDL DETERMINE ACTION

General Data in Customer Master   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

- determine action

$[internal$] determine action
          $[(authorization:none  $| authorization:update)$]
           DetermineActionName $[extensible$]
          {
           determination $[(always)$] MyDetermination1;
           determination $[(always)$] MyDetermination2;
           validation $[(always)$] MyValidation1;
           validation $[(always)$] MyValidation2;
           determination $[(always)$] Child~ChildDetermination;
           validation $[(always)$] Child~ChildValidation;
           ...
          }


Effect

Determine actions allow the RAP BO consumer to execute determinations and validations on request. Whenever a determine action is executed, the determinations and validations assigned to it are evaluated and then only those determinations and validations are executed whose trigger conditions are fulfilled. A determine action can include determinations defined as on save and validations. Determinations defined as on modify are not allowed.

If the optional addition always is used, then all determinations and validations that are part of the determine action are executed regardless of their trigger conditions. After a determination with the flag always has been executed, it can be triggered again by other determinations belonging to the same determine action.

Determinations and validations of child entities can be included using the syntax child~childDetermination or child~childValidation, as long as these validations and determinations do not include the trigger operation delete.

Execution order: Determinations are executed first, validations afterwards. The execution order among determinations or validations themselves is defined by the RAP framework and is independent of the specified order within the determine action.

The following CDS BDL operation additions are possible:

  • internal to make the respective determine action accessible only from within the business object implementation.

The optional addition extensible is only available for draft-enabled BOs. It allows a RAP BO consumer to add own validations or determinations to the determine action in question via a BDEF extension. For further details on extensibility enabling, see topic Extensibility Enabling.

Availability

Not available for unmanaged, non-draft RAP BOs.

In a managed RAP BO, determine actions don't require an implementation in the ABAP behavior pool (ABP), but the determinations and validations included in a determine action must be implemented.

In an unmanaged RAP BO, determine actions require an implementation in the RAP handler method FOR MODIFY in the ABAP behavior pool.

In a projection BDEF, determine actions from the base BDEF can be reused. For details on reuse, see topic CDS BDL - use, projection BDEF. It is not possible to specify new determine actions in a projection BDEF.

Development guide for the ABAP RESTful Application Programming Model, topic Action Definition.

Note

The draft determine action Prepare is the draft pendant to determine actions. It is documented in topic CDS BDL - draft actions.

Example

The following example shows a managed BDEF based on the on the CDS root view entity DEMO_SALES_CDS_SO_3. The root view entity represents a sales order and the child entity represents a sales order item. The determine action trigger_all includes the following two determinations, one from in the root entity and one from the child entity:

  • setID assigns values to the semantic key field SalesOrderId during the save sequence whenever a new entity instance is created.
  • TotalPrice sums up the price of all items of a sales order. It is triggered whenever a new sales order is created.

The determinations are implemented in the behavior pool BP_DEMO_SALES_CDS_SO_3.

The program DEMO_CDS_DETERMINE_ACTION accesses the business object using EML and carries out the following steps:

  • It first inserts data into the BO's persistent database tables using . That means that BO entity instances are available in the database, but the determinations haven't yet been triggered.
  • The determine action trigger_all is executed with the statement MODIFY ENTITIES for two entity instances. For these two entity instances, the fields ID and TotalPrice are determined.
Code snippet:
  • The determined values are committed to the database with the statement COMMIT ENTITIES.

Result: values for the fields ID and TotalPrice are determined.

IMAGE @@ABDOC_DET_ACTION.png@@503@@263@@






Addresses (Business Address Services)   rdisp/max_wprun_time - Maximum work process run time  
This documentation is copyright by SAP AG.

Length: 11148 Date: 20240425 Time: 090750     sap01-206 ( 113 ms )