ABAP for Cloud Development
AS ABAP Release 914, ©Copyright 2024 SAP SE. All rights reserved.
ABAP - Keyword Documentation → ABAP RAP Business Objects → RAP - Behavior Definitions → RAP - BDL for Behavior Definitions → RAP - Managed and Unmanaged Behavior Definitions → RAP - BehaviorDefinitionHeader →
RAP - extensible
Syntax
...
extensible {
with validations on save;
with determinations on save;
with determinations on modify;
with additional save;
}
...
Description
The addition extensible
can be used to allow BDEF extensions. If it is not specified, then extensions are not allowed. As a prerequisite, BDEF strict mode must be switched on.
The keyword extensible
must be specified in two places:
- It must be declared in the BDEF header
- It must be declared in the entity behavior characteristics for each individual entity that allows BDEF extensions.
In the header declaration, the following optional additions are available:
with validations on save
with determinations on save
with determinations on modify
with additional save
These additions explicitly allow the kinds of validations, determinations, or a RAP additional save in a RAP entity behavior extension. If not declared explicitly, the respective type of determination, validation, and the additional save must not be defined in an extension to an existing RAP BO entity.
Note: This declaration refers only to extensions of existing RAP BO entities (extend behavior for
). In extension nodes (define behavior for
), validations, determinations, and an additional save are always possible and no explicit permission is required.
Availability
Currently, the keyword extensible
is available for
- managed RAP BOs
- projection BDEFs
- interface BDEFs
- abstract BDEFs
- BDEF extensions: A BDEF extension itself can be extended with further extensions. This is referred to as extension layering. As a prerequisite, extensions must be explicitly allowed.
In projection BDEFs, interface BDEFs, abstract BDEFs, and BDEF extensions, only the keyword extensible
is possible, without any further additions.
In interface BDEFs, extensible
can be specified only in the BDEF header and strict mode is not available.
In BDEF extensions, strict mode is not available.
Further Information
A complete overview of extension points and extensibility enabling for behavior definitions is described in section Extensibility Enabling.
Example
The RAP behavior definition for DEMO_RAP_EXTENSIBLE
enables BDEF extensions by specifying multiple extension points.
Note: This example is intentionally kept short and simple and serves demonstration purposes only. For example, some RAP handler methods of the ABAP behavior pool are not implemented here.
managed implementation in class bp_demo_rap_extensible unique;
strict(2);
with draft;
extensible
{
with validations on save;
with determinations on save;
with determinations on modify;
with additional save;
}
define behavior for DEMO_RAP_EXTENSIBLE
persistent table demo_dbtab_root
draft table demo_dbtab_draf1
lock master
total etag Timestamp
authorization master ( global )
extensible
{
create;
update;
delete;
draft action Edit;
draft action Activate optimized;
draft action Discard;
draft action Resume;
draft determine action Prepare extensible;
field(readonly:update) KeyField;
field(readonly) Timestamp;
determination setID on save { create; }
determine action trigger_all extensible
{
determination ( always ) setID;
}
mapping for demo_dbtab_root corresponding extensible
{
KeyField = key_field;
DataField = data_field;
Timestamp = crea_date_time;
}
}
The extension DEMO_RAP_EXTEND1
extends the RAP behavior definition DEMO_RAP_EXTENSIBLE
.
extension implementation in class bp_demo_rap_extend1 unique;
extend behavior for DEMO_RAP_EXTENSIBLE {
determination MyDet1 on save { create; update; }
extend determine action trigger_all {determination MyDet1; }
}