Skip to content

ABAP Keyword Documentation →  ABAP - Dictionary →  ABAP CDS in ABAP Dictionary →  ABAP CDS - Data Definitions →  ABAP CDS - DDL for Data Definitions 

ABAP CDS - element_annot

Element annotations are annotations for the following CDS DDL elements:

The elements of the SELECT list in a CDS view and the elements of a CDS table function define the components of the results 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 and the annotation definition annotation @Scope should be specified here using the value #ELEMENT.

The following tables show the possible ABAP annotations that can be specified and their meanings. The ABAP annotations are evaluated by the ABAP runtime environment for every CDS entity. Annotations with other identifiers are usually framework-specific annotations. These are not evaluated by the ABAP runtime environment but by other SAP frameworks instead.

The first column of the table displays the (possibly structured) name annotation of an ABAP annotation and the second column displays its meaning. The third column shows the possible annotation values. The fourth column shows the value set implicitly for the annotation value if the annotation is not used explicitly. The fifth column displays the default value set implicitly for value in accordance with the annotation definition if the annotation is specified without a value. If nothing is specified for the annotation value, the annotation should be specified without a value.

Other versions: 7.31 | 7.40 | 7.54


Note

For each element annotation that is not part of an annotation arrays you can specify the special value null (without quotation marks). This means that the annotations are ignored in the evaluation with class CL_DD_DDL_ANNOTATION_SERVICE by default.

API Annotations

Defines the release of the element in the restricted ABAP language versions.

Annotation Meaning Annotation Values Default Value if Not Used Default Value if Used Without Value
API.element.releaseState In a CDS entity released using a release contract, overrides the release of individual elements. #DEPRECATED:
The element should no longer be used. If accessed, the element produces a syntax check warning in restrictedABAP language versions.
- -
API.element.successor Name of a successor that replaces an element forbidden using @API.element.releaseState:#DEPRECATED. Name of an element of the type ElementRef. - -


Note

In the ABAP language versions ABAP for SAP Cloud Platform and ABAP for Key Users, accessing an element forbidden using @API.element.releaseState:#DEPRECATED in an ABAP program or CDS entity produces a syntax check warning. An element proposed by @API.element.successor should be used instead.

EndUserText Annotations

Translatable texts of the element.

Annotation Meaning Annotation Values Default Value if Not Used Default Value if Used Without Value
EndUserText.label Translatable short text of the element. Character string with maximum 60 characters - -
EndUserText.quickInfo Translatable tooltip of the element. String - -


Note

ABAP annotations introduced using EndUserText are used to define translatable semantic texts for a CDS object. The value of an annotation like this is saved in special tables that have a language key and that are translatable. The value specified in the source code should consist of text in the original language of the CDS source code and is translated into the required languages. The methods of the class CL_DD_DDL_ANNOTATION_SERVICE read these texts as specified by an input parameter for the language. If no language is passed to the input parameter, the text environment language is used as the default. If no text is found for the language, the secondary language in AS ABAP is used.

Environment Annotations

Control of value transfer when using the element in a condition of ABAP SQL.

Annotation Meaning Annotation Values Default Value if Not Used Default Value if Used Without Value
Environment.sql.passValue Specifies whether a placeholder ? or a literal values is passed tothe database in a ABAP SQL condition when the element is compared with a host variable. true:
The literal value of the host variable is passed.
false:
A placeholder ? is passed.
false true

Semantics Annotations

Semantic properties of the element.

Annotation Meaning Annotation Values Default Value if Not Used Default Value if Used Without Value
Semantics.amount.currencyCode Element is defined as a currency field to which a currency key is assigned Name of an element defined as a currency key - -
Semantics.currencyCode Element is defined as a currency key - - -
Semantics.quantity.unitOfMeasure Element is defined as a quantity field to which a unit of measurement key is assigned Name of an element defined as a unit of measurement key - -
Semantics.unitOfMeasure Element is defined as a unit of measurement key - - -


Notes


This translation does not reflect the current version of the documentation.