ABAP Keyword Documentation → ABAP - Dictionary → ABAP CDS in ABAP Dictionary → ABAP CDS - Annotations → ABAP CDS - Specifying Annotations
ABAP CDS - Scopes for Annotations
Annotations can be specified for the following scopes in source code in ABAP CDS: The annotation @Scope is used in the associated annotation definition to specify in which scopes an annotation can be specified.
- Annotation definition annotations for a
CDS annotation definition
In the statement DEFINE ANNOTATION
- Entity annotations for a CDS entity
In front of the statement DEFINE VIEW, DEFINE TABLE FUNCTION, DEFINE ABSTRACT ENTITY
- View annotations for a CDS view
In front of the statement DEFINE VIEW
- Extension annotations for a CDS view extension
In front of the statement EXTEND VIEW
- Function annotations for a CDS table function
In front of the statement DEFINE TABLE FUNCTION
- Hierarchy annotations for a CDS hierarchy
In front of the statement DEFINE HIERARCHY
- Parameter annotations for a
parameter of a CDS view
In front of and after the parameter
- Parameter annotations for a
parameter of a CDS table function
In front of and after the parameter
- Parameter annotations for a
parameter of an abstract CDS entity
In front of the parameter
- Element annotations for an
element of the SELECT list of a
CDS view
In front of and after the element
- Element annotations for an
element in the
element list of a CDS table function
In front of and after the element
- Metadata extension annotations for a
CDS metadata extension
In front of the statement ANNOTATE
- Role annotations for a CDS role
In front of the statement DEFINE ROLE
- PFCG mapping annotation for a PFCG mapping
In front of the statement DEFINE PFCG_MAPPING
The ABAP annotations that are possible for a scope are documented here. For framework-specific annotations by SAP, see the tables in the document Framework-specific annotations.
Other versions:
7.31 | 7.40 | 7.54
Note
The annotations specified in the source code of a CDS entity can be annotated or overridden using the annotations of CDS metadata extensions.