SAP BDL EXTEND BEH



Get Example source ABAP code based on a different SAP table
  


• WITH ADDITIONAL SAVE ABAP_BDL_EXTENSION
• WITH FULL DATA ABAP_BDL_EXTENSION
• EXTEND BEHAVIOR FOR ABAP_BDL_EXTENSION

ABAP_RAP - Entity Behavior Extension

ABAP_SYNTAX
extend behavior for EntityName
$[implementation in class ClassName unique$]
$[with additional save $[with full data$]$]
{
extension_body
$|$[implementation_grouping$]
}
...

What does it do?
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 topic TITLE ).
Possible only if the underlying BO has implementation type managed.
The saving options 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 this save_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 the save_modified method. It works as described in topic RAP BDL - Saving Options. 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 specify with full data. In this case, full instance data is passed each time the save_modified method is called, even for extensions which do not specify this addition.
The addition with additional save $[with full data$] in a BDEF extension works as described in topic RAP BDL - Saving Options.
extension_body: extends the entity behavior body.
implementation_grouping: 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.