SAP CDS F1 DEFINE ABSTRACT ENTITY



Get Example source ABAP code based on a different SAP table
  


• DEFINE ABSTRACT ENTITY ABAP_CDS_DDL_STATEMENT
• ROOT ABSTRACT ABAP_CDS_DEFINE_ABSENT

ABAP_CDS_DDL - DEFINE ABSTRACT ENTITY

ABAP_SYNTAX
$[@entity_annot1$]
$[@entity_annot2$]
...
$[DEFINE$] $[ROOT$] ABSTRACT ENTITY abstract_entity
$[parameter_list$]
element_list$[;$]

What does it do?
Defines an CDS abstract entity abstract_entity in CDS DDL. When a CDS abstract entity is activated, its metadata is created but no other object instances are created on the database or in AS ABAP. The name abstract_entity must comply with the naming conventions for dictionary types and can have a maximum of 30 characters.
@entity_annot can be used to specify optional annotations for the CDS abstract entity.
parameter_list is used to declare a list of optional input parameters for the CDS abstract entity.
element_list is used to declare elements, CDS associations, CDS compositions, and CDS-to-parent associations of the CDS abstract entity.
A CDS abstract entity can be used as a global structured type in ABAP programs. The entity is located in the namespace of all global types of an AS ABAP. The elements of the CDS abstract entity define the components of the global structured type that can be referenced in ABAP programs using TYPE . As is the case for any CDS entity, the annotations of a CDS abstract entity can be evaluated .
In ABAP CDS, the keyword ROOT is used to define the CDS abstract entity abstract_entity as a root entity of the hierarchy of a business object. The following applies to the root entity:
There is exactly one root entity in the structure of a business object.
A root entity can have child entities defined as CDS compositions using the keyword COMPOSITION, but this is not mandatory. A root entity can also be a leaf entity.
A root entity does not have a parent entity. To-parent associations are not allowed in root entities.



Latest notes:

A CDS abstract entity cannot be used as a data source in other CDS entities or in AB_SQL .
The DDL source code of a CDS abstract entity must have the same name as this entity.
NON_V5_HINTS
No ABAP Dictionary DDIC structure visible in the tools for structures is created for a CDS abstract entity.
ABAP_HINT_END

ABAP_EXAMPLE_VX5
The following DDL source code shows a CDS abstract entity:
DDLS DEMO_CDS_ABSTRACT_ENTITY
The class CL_DEMO_CDS_ABSTRACT_ENTITY demonstrates the following:
The structure of the CDS abstract entity can be evaluated using RTTI methods.
The annotations of the CDS abstract entity can be evaluated using the class CL_DD_DDL_ANNOTATION_SERVICE.
The structure of the CDS abstract entity can be used as a data type in the ABAP program.
ABAP_EXAMPLE_END