Get Example source ABAP code based on a different SAP table
• DEFINE BEHAVIOR FOR ABAP_BDL_EXTENSION • ALIAS ABAP_BDL_EXTENSION
ABAP_RAP - Extension Entity Behavior Definition
ABAP_SYNTAX ... define behavior for ExtNode $[using$]>> ... >
ABAP_PREREQUISITE As a prerequisite, the extended RAP behavior definition> must explicitly allow BDEF extensions as described in topic RAP BDL - Extensibility Enabling for Base BOs>. ABAP_PREREQ_END
What does it do? Defines the behavior for an extension node> in a BDEF extension using the statement define behavior for>. As a prerequisite, the node must be added to the RAP data model via RAP data model extensions>. The BDEF extension can add behavior for this extension node. The behavior for the extension node is defined in the same way as for RAP BOs, see section Entity Behavior Definition >, with the following differences:
A CDS transactional interface> can be specified with the syntax addition using>> (instead of using interface>>, which is used for RAP BO extensions).
No explicit pointing to a RAP authorization master entity>. Use authorization dependent> instead of authorization dependent by _Assoc>>.
No explicit pointing to a RAP lock master entity>. Use lock dependent> instead of lock dependent by _Assoc>>.
No explicit pointing to a RAP ETag master entity>. Use etag dependent> instead of etag dependent by _Assoc>>. ABAP_NOTE As a best practice, SAP recommends that an ETag master field is defined for each individual entity. As a consequence, the syntax etag dependent> should not be used at all.
Declare ancestor associations>, so that the path to the authorization master, lock master, and ETag master entities can be derived. If an ABAP behavior pool is specified, the rules for extension ABPs apply. See topic RAP BDL - implementation in class unique, Extension>.
Latest notes:
A short syntax form is available: ( lock, authorization, etag ) dependent>. Each of the three components lock>, authorization>, and etag> is optional but at least one of them must be specified within the parentheses.
Currently, only root entities can be defined as authorization master and lock master entity. An extension node can therefore not be specified as authorization master or as lock master entity.
Currently, RAP business events> can only be defined in RAP BO root entities>. Since extension nodes are usually below the root node, they cannot define any new RAP business events. NON_V5_HINTS ABAP_HINT_END
ABAP_EXAMPLE_VX5 The BDEF extension DEMO_RAP_EXTENSION_1 >> extends the RAP behavior definition DEMO_RAP_EXTENSIBLE_ROOT>>. It behavior-enables an extension node using the syntax define behavior for>. It defines behavior and multiple ancestor associations. Lock, authorization, and ETag master are not specified explicitly, but derived implicitly. BDEF DEMO_RAP_EXTENSION_1 ABAP_EXAMPLE_END
ABAP_EXAMPLE_ABEXA The executable example Node extension> explains the example above in detail. ABAP_EXAMPLE_END