Technology Blogs by SAP
Learn how to extend and personalize SAP applications. Follow the SAP technology blog for insights into SAP BTP, ABAP, SAP Analytics Cloud, SAP HANA, and more.
cancel
Showing results for 
Search instead for 
Did you mean: 
horst_keller
Product and Topic Expert
Product and Topic Expert

ABAP CDS annotations add metadata to a CDS object (mainly CDS entities) that goes beyond the syntax features of the SQL (DDL) part of its definition. An annotation is specified in the CDS source code of a CDS object using the annotation syntax @... that is defined by a CDS annotation definition. As a rule, only annotations can be used that are delivered by SAP as a predefined set of SAP annotations, because only those are evaluated when a CDS object is used.

SAP annotations are divided in:

  • ABAP annotations that are evaluated when the object defined in the CDS source code is activated or when the object is used in the ABAP runtime framework.
  • Framework-specific annotations that are evaluated by frameworks of other software components.

Any annotations that are specified with @... but not evaluated by a framework lead to syntax warnings and are ignored at runtime.

Annotations can be released as APIs under the C1 contract. As such they should be sufficently documented. For the API documentation of an annotation, ADT offers a so called Knowledge Transfer Document (KTD). You can reach the KTD documentation of an annotation for example by using F2 on an annotation in ADT. While a KTD is sufficient as long as you work in ADT, it might also be helpful to reach the annotation documentation from other environments, as e.g. programming guides or other framework-specific documentation. Since for the time being, the native display of KTDs is restricted to ADT, an effort was undertaken to integrate the content of annotation documentation that is available in KTDs into the ABAP Keyword Documentation. There it can be linked from within that documentation and becomes also available for general usage in form of the upload of the keyword documentation to the SAP Help Portal:

ABAP CDS - Annotation Documentation

This is the upload of the ABAP Keyword Documentation of the current ABAP Cloud release 2402, where all annotations that are released by SAP for ABAP Cloud are listed.

For each annotation, there is a topic that contains:

  • A table of the annotation properties as found in a metadata table in the system.
  • The content of the respective KTD if available.
  • A link to the annotation documentation in SAP Help portal if the annotation is documented there additionally to or instead of KTD (if available).
  • Optional further information, especially for ABAP annotations

Example: AbapCatalog.entityBuffer.definitionAllowed

We hope that it might be helpful.