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 - BDEF Extension → RAP - Base BDEF Extension → RAP - extension →
RAP - EntityBehaviorExtension
Syntax
extend behavior for EntityName
implementation in class ClassName unique
with additional save with full data
{
ExtensionBody
group
}
...
Description
Extends the behavior of an existing RAP BO entity.
Syntax additions and components:
implementation in class ClassName unique
: Specifies an ABAP behavior pool for the extension behavior of the particular entity.with additional save
with full data:- Adds additional steps to the default save sequence.
- As a prerequisite, the extended BDEF must explicitly allow extensions with additional save (see the topic RAP - Extensibility Enabling for Base BOs).
- Possible only if the underlying BO has implementation type
managed
. Currently not supported for unmanaged RAP BOs. - The saving options
SavingOptions
specified in the original BO do not affect the additional save of the extension. The original BO can specify an additional save, an unmanaged save, or use the default save sequence. The original saving option is applied to original behavior and the additional save specified in the extension is applied to extension behavior. - In an extension, an additional save can be specified per entity in the entity behavior characteristics. Notation in the behavior definition header, like in the extended BDEF, is not allowed.
- The implementation takes place in the
save_modified
method of the RAP saver class in the respective extension ABP. The method parameters of thissave_modified
method are typed according to the particular BDEF extension that enables the additional save. In other words, the ABP reflects exactly the BDEF components of the BDEF it belongs to and not the entire RAP BO. Furthermore, the rules for extension ABPs apply. Data is passed to thesave_modified
method. It works as described in topic RAP -SavingOptions
. If this addition is specified either in the original RAP BO or in an extension, then it is enabled each time an additional save is implemented. Multiple extensions may exist and all of them may specify an additional save, but only one of them may specifywith full data
. In this case, full instance data is passed each time thesave_modified
method is called, even for extensions which do not specify this addition. - The addition
with additional save
in a BDEF extension works as described in topic with full dataRAP -SavingOptions
. ExtensionBody
: Extends the entity behavior body.group
: Divides the implementation-relevant parts of an extended RAP BO's business logic into multiple groups for behavior implementation, each with its own implementation class.