ABAP for Cloud Development
AS ABAP Release 914, ©Copyright 2024 SAP SE. All rights reserved.
ABAP - Keyword Documentation → ABAP Core Data Services (ABAP CDS) → ABAP CDS - Data Definitions → ABAP CDS - DDL for Data Definitions → ABAP CDS - Common DDL Elements →
CDS DDL - element_annot
Description
Specifies an annotation annotation
as an element annotation for the following CDS entities:
- Elements in the
SELECT
list of a CDS view entity - Elements in the element list of a CDS projection view
- Elements in an element list of a CDS table function
- Elements in an element list of a CDS external entity
- Elements in an element list of a CDS hierarchy
- Elements in an element list of a CDS custom entity
- Elements in an element list of an CDS abstract entity
- Elements in the
SELECT
list of a CDS DDIC-based view (obsolete)
The elements of the SELECT
list or element list of a CDS entity define the components of the result set of database accesses using SELECT
and of structured data types in ABAP. The annotations enrich these components with additional semantic properties. The annotation should be defined as a CDS object in a CDS annotation definition In the annotation definition, the annotation @Scope
should be specified using the value #ELEMENT
.
Element annotations can be specified before and after the element:
- In front of the element, the character
@
must be placed before the nameannotation
of the annotation. - After the element, the characters
@<
must be placed before the nameannotation
of the annotation. - This notation is possible for all CDS entities listed above, except for CDS view entities. For CDS view entities, all annotations, including element annotations, are possible only in front of the element they refer to.
For annotation
, both ABAP annotations and framework-specific annotations can be specified that are available for this scope. For framework-specific annotations, refer to Framework-Specific Annotation Syntax.
The following is a list of the ABAP annotations for the current scope:
- Aggregation Annotations
- API Annotations
- EndUserText Annotations
- Environment Annotations
- Semantics Annotations
Semantics.amount.currencyCode
Semantics.currencyCode
Semantics.quantity.unitOfMeasure
Semantics.unitOfMeasure
- ObjectModel Annotations
Hints
- The semantics annotations are used to define the currency fields and quantity fields of CDS views, CDS table functions, CDS abstract entities, and CDS custom entities.
- If a CDS entity selects from a DDIC database table or from another CDS entity, the above semantics annotations are propagated and they do not have to be defined again explicitly.
- Exception: in CDS views with set operators, the annotation
Metadata.ignorePropagatedAnnotations: true
is mandatory, propagation is switched off and therefore, reference annotations must be redefined explicitly. - In addition to the ABAP annotations shown here, there are also framework-specific semantics and object model annotations.