Ansicht
Dokumentation
ABENBDL_ACTION_NONFACTORY - BDL ACTION NONFACTORY
General Data in Customer Master SUBST_MERGE_LIST - merge external lists to one complete list with #if... logic for R3upThis documentation is copyright by SAP AG.
- action, Non-Factory
$[internal$]$[static$] action
$[(
$[
features: ${instance $| global$}$]
$[precheck$]
$[authorization:none$]
$[
authorization:update$]
$[lock:none$]
)$]
ActionName $[external 'ExternalName'$]
$[InputParameter$]
$[OutputParameter$]
Additions
1. ... lock:none
2. ... external
Effect
Defines a RAP action which offers non-standard behavior. The custom logic must be implemented in the RAP handler method FOR MODIFY. An action per default relates to a RAP BO entity instance and changes the state of the instance.
If the optional keyword static is used, the action is defined as static action. Static actions are not bound to any instance of a RAP BO entity but relate to the complete entity. The default is that an action is related to an instance, so the keyword static overwrites the default.
The following CDS BDL operation additions are possible:
- internal to make the respective action accessible only from within the business object implementation.
- Dynamic feature control with (features:instance). This enables or disables the action depending on preconditions within the business object. For example, the action Accept_Order might be offered only if the status is not Rejected already.
- Global feature control with (features:global) enables or disables the action depending on BO-external preconditions.
- precheck prevents unwanted changes from reaching the application buffer.
- authorization:none excludes the operation in question from authorization checks.
- For static actions, the addition authorization:none is available only in case of global authorization.
- authorization:update delegates the authorization control to the authorization check that is implemented for the update operation.
- Input parameters InputParameter and output parameters OutputParameter can optionally be added to the action signature.
Availability
- In a projection BO, actions from the base BDEF can be reused. For details on reuse, see topic CDS BDL - use, projection BDEF. It is also possible to specify new actions as described in topic CDS BDL - actions and functions, projection BDEF.
Development guide for the ABAP RESTful Application Programming Model, section about Actions.
Example
The following example shows a managed BDEF based on the CDS root view entity DEMO_CDS_PURCH_DOC_M. The business object represents a purchase order with purchase order items. If an employee wants to order equipment, the manager can approve or reject this purchase. Therefore, the two actions Approve_Order and Reject_Order are defined.
The actions are implemented in behavior pool BP_DEMO_CDS_PURCH_DOC_M. The program DEMO_CDS_PURCHASE accesses the business object using EML and performs the Approve_Order action on one entity instance.
Result: column Status of the respective instance is filled with A for Accepted.
IMAGE @@ABDOC_ACTION.png@@305@@114@@
The example above is explained in detail in the executable example CDS BDL - action.
Addition 1
... lock:none
Effect
Prevents the locking
mechanism for the entity instance for which an action is executed. Since static actions are not
related to a specific instance, they are non-locking by definition and this syntax element is not applicable.
The locking mechanism is only prevented for the action itself. Possible modify calls in the action
implementation are not affected by the non-locking specification in the action definition. Consequently, an instance is locked if it is modified by an action even if the action is defined as non-locking.
Addition 2
... external
Effect
The optional addition external can be
used to provide an alias name for the action for external usage. This external name is exposed in the OData metadata, but it is not known by ABAP. It can be much longer than the actual action name.
BAL Application Log Documentation BAL Application Log Documentation
This documentation is copyright by SAP AG.
Length: 10289 Date: 20240512 Time: 000441 sap01-206 ( 92 ms )