SAP BDL DEFINE BEH PROJECTION



Get Example source ABAP code based on a different SAP table
  


• DEFINE BEHAVIOR FOR ABAP_BDL_PROJECTION
• ALIAS ABAP_BDL_PROJECTION

ABAP_RAP - Entity Behavior Definition, Projection BDEF

ABAP_SYNTAX
define behavior for ProjectedEntity $[alias AliasName$] $[external ExternalName$]
${$[implementation in class ClassName $[unique$]$]$}
entity behavior characteristics
{
entity behavior body
}

$[behavior for ChildEntity1$]$[, behavior for ChildEntity2$]$[, ...
$]

What does it do?
Defines the behavior for a RAP projection business object in the RAP BDL . A RAP projection behavior definition can project a subset or all of the nodes of its underlying base BO. The root entity ProjectedEntity must be a CDS projection view.
Syntax additions and components:
An alias name can be specified using the keyword alias. This name can be clearer than the entity name itself, since it does not need to be uniquely global in ABAP Dictionary . The alias name is visible in the method syntax of the ABAP behavior pool of the business object and in the derived types. The length of an alias name AliasName is restricted to 30 characters.
The optional addition external can be used to provide an alias name for external usage. This external name is exposed in the OData metadata, but it is not known by ABAP. It can be much longer than the alias name.
An ABAP behavior pool, referred to using implementation in class ClassName unique , can be specified for each entity that defines new actions or functions and thus requires an implementation. It can be specified either in the BDEF projection header or as part of the projection behavior definition.
Entity behavior characteristics define general properties for each entity.
The entity behavior body can expose a subset of the transactional behavior or the base BDEF, for example, standard operations or field properties. It is also possible to define new actions or functions, or new field properties.

ABAP_EXAMPLE_VX5
The following example shows a projection BDEF. The projected BO is DEMO_SALES_CDS_BUPA_2. It exposes the standard operations and associations of the underlying BO.
ABAP_NOTE This example does not fully meet the requirements of the RAP BO contract. It is intentionally kept short and simple and serves demonstration purposes only. See more information on the RAP BO contract in the Development guide for the ABAP RESTful Application Programming Model.
BDEF DEMO_RAP_PROJECTION_1
ABAP_EXAMPLE_END