ABAP CDS Feature Scope Overview
Public
PUBLIC
ABAP Core Data Services (CDS) Feature Scope
Overview
PUBLIC
ABAP Core Data Services (CDS) Feature Scope
Overview
© 2024 SAP SE or an SAP affiliate company. All rights reserved. See Legal Notice on www.sap.com/legal-notice for use terms, disclaimers, disclosures, or restrictions related to this material. 2 / 5
CDS objects
Overview of available CDS objects delivered with ABAP Platform 2023.
CDS object Syntax Use
CDS entity Data modeling.
CDS entity extension extend view entity Extending CDS entities.
CDS metadata
extension
annotate entity Adding annotations to a
CDS object in a separate
repository object.
CDS annotation
definition
define annotation Adding semantic
information to CDS
objects.
CDS entity buffer define view entity
buffer on
Buffer settings for CDS
entities.
CDS type define type <name>
[enum]
User-defined data type.
CDS scalar function define scalar
function
User-defined function,
implemented in AMDP.
CDS access control define role on Authorization control.
CDS entities
Overview of available CDS entities delivered with ABAP Platform 2023.
CDS entity Syntax Use
View entity define view entity Data selection.
Projection view define view entity
... as projection on
Fine-tuning a data
model for a service-
specific use case.
Table function define table
function
Data selection using
AMDP.
Hierarchy define hierarchy Wrapping of HANA-
native hierarchy
functions.
Custom entity define custom
entity
Data selection using an
ABAP class.
Abstract entity define abstract
entity
Modeling a structure.
DDIC-based view* define view Data selection.
CDS objects
Overview of available CDS objects delivered with ABAP Platform 2023.
CDS object Syntax Use
CDS entity Data modeling.
CDS entity extension extend view entity Extending CDS entities.
CDS metadata
extension
annotate entity Adding annotations to a
CDS object in a separate
repository object.
CDS annotation
definition
define annotation Adding semantic
information to CDS
objects.
CDS entity buffer define view entity
buffer on
Buffer settings for CDS
entities.
CDS type define type <name>
[enum]
User-defined data type.
CDS scalar function define scalar
function
User-defined function,
implemented in AMDP.
CDS access control define role on Authorization control.
CDS entities
Overview of available CDS entities delivered with ABAP Platform 2023.
CDS entity Syntax Use
View entity define view entity Data selection.
Projection view define view entity
... as projection on
Fine-tuning a data
model for a service-
specific use case.
Table function define table
function
Data selection using
AMDP.
Hierarchy define hierarchy Wrapping of HANA-
native hierarchy
functions.
Custom entity define custom
entity
Data selection using an
ABAP class.
Abstract entity define abstract
entity
Modeling a structure.
DDIC-based view* define view Data selection.
© 2024 SAP SE or an SAP affiliate company. All rights reserved. See Legal Notice on www.sap.com/legal-notice for use terms, disclaimers, disclosures, or restrictions related to this material. 3 / 5
*obsolete. Use a view entity instead.
Annotations
Annotations are used to enhance the source code with meta information. There are ABAP annotations that
are evaluated by the ABAP runtime, and framework-specific annotations that are evaluated by specific
software components. Here are some examples:
ABAP annotation Framework-specific
annotation
@AbapCatalog @Analytics
@EndUserText @Consumption
@Semantics @UI
The complete list with over 1000 annotations and their documentation can be found in the ABAP Keyword
Documentation ABAP CDS - SAP Annotation Documentation. In ADT, the annotation documentation is
available under F2.
Data types and type conversions in ABAP CDS
• Built-in CDS types are written with the prefix abap., for example, abap.int4.
• Simple types and enumerated types are user-defined CDS types.
Conversions between data types are done with the cast operator:
CAST( <operand> AS <dtype> [PRESERVING TYPE] )
Associations
Associations can be used to define relationships between CDS entities. They are instantiated as a join
expression as soon as a field from the association target is included in the current entity (“join-on-demand”).
Types of associations:
• Association
• To-parent association
• To-child association
Syntax:
association [cardinality] [to] <assoc_target> as <_assoc> on <condition>
The names of associations start with an underscore (_).
To expose a CDS association for reuse, write its name in the select list (_assoc). No join is generated in this
case.
To include a field from an association source in the select list, use a path expression, i.e. a concatenation of
exposed associations. This automatically generates a join expression in the SQL CREATE statement. Example:
_assoc1._assoc2.field_name.
*obsolete. Use a view entity instead.
Annotations
Annotations are used to enhance the source code with meta information. There are ABAP annotations that
are evaluated by the ABAP runtime, and framework-specific annotations that are evaluated by specific
software components. Here are some examples:
ABAP annotation Framework-specific
annotation
@AbapCatalog @Analytics
@EndUserText @Consumption
@Semantics @UI
The complete list with over 1000 annotations and their documentation can be found in the ABAP Keyword
Documentation ABAP CDS - SAP Annotation Documentation. In ADT, the annotation documentation is
available under F2.
Data types and type conversions in ABAP CDS
• Built-in CDS types are written with the prefix abap., for example, abap.int4.
• Simple types and enumerated types are user-defined CDS types.
Conversions between data types are done with the cast operator:
CAST( <operand> AS <dtype> [PRESERVING TYPE] )
Associations
Associations can be used to define relationships between CDS entities. They are instantiated as a join
expression as soon as a field from the association target is included in the current entity (“join-on-demand”).
Types of associations:
• Association
• To-parent association
• To-child association
Syntax:
association [cardinality] [to] <assoc_target> as <_assoc> on <condition>
The names of associations start with an underscore (_).
To expose a CDS association for reuse, write its name in the select list (_assoc). No join is generated in this
case.
To include a field from an association source in the select list, use a path expression, i.e. a concatenation of
exposed associations. This automatically generates a join expression in the SQL CREATE statement. Example:
_assoc1._assoc2.field_name.