ABAP Keyword Documentation → ABAP - Dictionary → ABAP CDS in ABAP Dictionary → ABAP CDS - Annotations → ABAP CDS - Specifying Annotations → ABAP CDS Metadata Extensions
ABAP CDS - Evaluation of Metadata Extensions
Annotations from metadata extensions are evaluated first in the evaluation of annotations with the class CL_DD_DDL_ANNOTATION_SERVICE. If there are different metadata extensions for the same CDS entity, priority is determined by the following criteria:
- CDS variant
- A metadata extension can be assigned a CDS variant in its definition with ANNOTATE with the addition VARIANT.
- The name of a CDS variant can be transferred to the methods of the class CL_DD_DDL_ANNOTATION_SERVICE to select the metadata extension.
- Layer of metadata extension
- #CUSTOMER
- #PARTNER
- #INDUSTRY
- #LOCALIZATION
- #CORE
The methods of the class CL_DD_DDL_ANNOTATION_SERVICE collect the annotations they have returned, depending on the variant and the layers, according to the following hierarchy:
If an existing CDS variant is specified for the evaluation, but there are no metadata extensions that are joined to the variant, processing continues with step 2, in the same way as when no variant is specified. If a non-existent CDS variant is specified, the methods of the class CL_DD_DDL_ANNOTATION_SERVICE return empty internal tables.
If there are several metadata extensions in a layer for the same variant or for no variant, the annotations of the first metadata extension to be found are used. The metadata extensions are evaluated according to an undefined but stable order.
Other versions:
7.31 | 7.40 | 7.54