SAP CDS ABSTRACT ENTITIES



Get Example source ABAP code based on a different SAP table
  



ABAP_CDS - Abstract Entities
A CDS abstract entity is defined in the DDL source code of a CDS data definition in the ABAP Development Tools (ADT) using the statement DEFINE ABSTRACT ENTITY in the CDS DDL of the ABAP Core Data Services (CDS).
BEGIN_SECTION VERSION 5 OUT DCL source code in a CDS abstract entity can also be displayed in Repository Browser in ABAP Workbench.
END_SECTION VERSION 5 OUT
A CDS abstract entity represents all type properties of a CDS entity:
Metadata defined using CDS annotations
A structured type defined using an element list
Optionally a parameter interface defined using input parameters
Any CDS associations, CDS compositions, or CDS to-parent associations exposed in the element list
An instance of a CDS abstract entity is not created as a database object and client handling is not defined. A CDS abstract entity can be used as follows:
ABAP CDS
A CDS abstract entity can be specified as the association target of a CDS association, CDS composition, or CDS to-parent association. A CDS association, CDS composition, or CDS to-parent association of this type can be exposed only and cannot be created as an instance of a join expression.
A CDS abstract entity cannot be used as a data source of SELECT statements or used by SQL path expressions in other CDS entities, such as CDS view entities or DDIC-based CDS views.
ABAP Programs
The structured type of the CDS abstract entity is known in ABAP programs. Like the type of any CDS entity, it can be used after the addition TYPE.
BEGIN_SECTION VERSION 5 OUT The properties of the structured type can be evaluated using RTTI.
END_SECTION VERSION 5 OUT
A CDS abstract entity cannot be used as a data source of SELECT statements or used by path expressions in AB_SQL .
The statement ANNOTATE ENTITY can be used to add CDS metadata extensions to the annotations of a CDS abstract entity.
Frameworks
The annotations of a CDS abstract entity can be evaluated using the methods of the class CL_DD_DDL_ANNOTATION_SERVICE.
The parameters and the CDS associations of CDS abstract entities can be evaluated by frameworks such as the RAP framework.

ABAP_FURTHER_INFO
ABAP Data Models development guide, section about CDS abstract entities.



Latest notes:

CDS abstract entities can be employed in the following cases:
They can be used as data types whose type properties go beyond the regular DDIC structures in the ABAP Dictionary. Examples of this use case can be found in ABAP RAP.
They can be used as prototype definitions of data models without being created as instances of data objects.
NON_V5_HINTS
ABAP_HINT_END