Get Example source ABAP code based on a different SAP table
• IMPLEMENTATION IN CLASS ABAP_BDL_EXTENSION • UNIQUE ABAP_BDL_EXTENSION
ABAP_RAP - implementation in class unique>, Extension
ABAP_SYNTAX ... implementation in class ClassName unique;>
What does it do? Specifies an ABAP behavior pool> for the extended RAP business object. Valid abbreviations are extension> ABAP behavior pool or extension ABP. An extension ABP is an optional component of a BDEF extension and only required if the BDEF extension specifies implementation-relevant components. An extension ABAP behavior pool can be specified in different positions:
Extension header>
Entity behavior extension>
Extension entity behavior definition>
Implementation group> The mandatory addition unique> defines that each operation can be implemented exactly once.
Original ABPs and Extension ABPs An original ABP and an extension ABP are separate artifacts that do not depend on each other. An original ABP and an extension ABP consider each other external consumers. The following rules apply:
Internal operations>: RAP BO operations defined as internal>> can be accessed only from within the same ABP that implements them. An internal operation from the original BDEF cannot be extended, since it is not visible in the extension ABP. In the same way, internal actions from an extension are not visible to the original BO.
IN LOCAL MODE>>: The addition IN LOCAL MODE> grants privileged access rights only to the particular RAP BO itself. The original BO can be accessed in local mode by its own implementation classes or other classes that are called from its own implementation. The extension BO can be accessed in local mode from its own class implementations. An original BO and an extension BO consider each other external consumers.
Field usage
An extension ABP can use fields from the extended RAP BO.
The original RAP BO can use fields from an extension, if the extension is created in the same software component.
Field attributes, such as readonly>>, must be respected between the original ABP and the extension ABP. For example, if an extension ABP tries to update or delete readonly > fields of the original RAP BO, a runtime error> occurs. ABAP_NOTE A runtime error also occurs when trying to modify a read-only field using dynamic EML.
Feature control>:
The original ABP implements feature control for original fields and operations.
The extension ABP implements feature control for extension fields and extension operations from the same software component.
The request parameter> for the handler methods> for global> and instance feature control> contains the fields and operations from the directly related BDEF, that means, either original or extension. It does not contain operations from both extended and extension BDEF, even if they concern the same RAP BO entity. This means that a strict separation of feature control for original and extension fields and operations is enforced.
Authorization control>:
RAP authorization control> can be defined only in the extended RAP BO, but it may be implemented in both the original and the extension ABP, if required.
The original BO implements authorization control for actions defined in the original BO.
The extension BO implements authorization control for extension actions, if specified.
The request parameter for the handler methods> for global> and instance authorization control> contains only the operations from the directly related BDEF, that means, either extended or extension. This means that a strict separation of authorization control for original and extension operations is enforced.
If an operation, for example update> , is protected from unauthorized access and this is implemented in the original RAP BO, then it is checked during all update operations, updates on original nodes as well as updates on extension nodes. That means that the implementation of original and extension components is strictly separated, but the original implementation also applies to operations against extension nodes.
The following cases require a separate implementation for authorization control in the extension behavior pool of the master entity and of the authorization-dependent entity: actions> of authorization dependent entities, create-enabled cross-BO associations>, create-enabled associations which are not compositions.
BDEF Derived Types
The BDEF derived type> of a RAP BO includes all original and all extension fields.
An extension BDEF must not be used as global data type or part of a data type.
Related Information
The implementation rules for ABAP behavior pools are described in topic ABAP Behavior Pools (ABP)>.
A complete list of BDEF derived types is provided in section ABAP for RAP, BDEF Derived Types>.
ABAP_EXAMPLE_ABEXA The executable example Behavior Extension> implements authorization control, feature control, a validation, a determination and two actions. These implementations are distributed between original ABP and extension ABP. Further executable examples