Ansicht
Dokumentation

ABENBDL_DEFINE_BEH - BDL DEFINE BEH

ABENBDL_DEFINE_BEH - BDL DEFINE BEH

SUBST_MERGE_LIST - merge external lists to one complete list with #if... logic for R3up   Addresses (Business Address Services)  
This documentation is copyright by SAP AG.
SAP E-Book

- Entity Behavior Definition

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

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


Effect

Defines the behavior for a RAP business object in the CDS BDL. A CDS behavior definition can consist of one or more entity behavior definitions that start with define behavior for, each one referring to a different node of the business object. An entity behavior definition for the business object's root entity RootEntity must be included, whereas entity behavior definitions for child entities are optional. If an entity does not have its own entity behavior definition, the entity does not have a transactional character. It is then not modifiable within the ABAP RESTful application programming model.

In a managed RAP BO, the possible root entities RootEntity are CDS view entities or (deprecated).

In an unmanaged RAP BO, the possible root entities RootEntity are CDS view entities, CDS custom entities, or (deprecated). Custom entities serve as data model basis for RAP unmanaged queries.

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 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.

Notes

  • If BDEF strict mode is enabled, no gaps are allowed in the behavior enablement of a composition tree. For example, if a composition tree consists of entities 1 (root), 2 (child), and 3 (grandchild), the definition of a behavior for entities 1 and 3 but not for entity 2 is not allowed, as that would be a gap.

Example

The following example shows a managed BDEF based on the CDS root view entity DEMO_RAP_MANAGED_ASSOC_ROOT. The CDS composition tree consists of the root entity and one child entity. For both entities, an entity behavior definition is defined.

Example

The following example shows an unmanaged BDEF based on the CDS root view entity DEMO_RAP_UNMANAGED_DRAFT_ROOT. The CDS composition tree consists of the root entity and one child entity. For both entities, an entity behavior definition is defined.

The behavior is defined in the BP_DEMO_RAP_UNMANAGED_DRAFT_ROCCIMP of the ABAP behavior pool.






CL_GUI_FRONTEND_SERVICES - Frontend Services   CL_GUI_FRONTEND_SERVICES - Frontend Services  
This documentation is copyright by SAP AG.

Length: 7345 Date: 20240427 Time: 042256     sap01-206 ( 89 ms )