Explaining Metadata Extension


After completing this lesson, you will be able to:

  • List the steps for implementing a metadata extension

Metadata Extension

The syntax of CDS will grow if complex annotations are needed. That may reduce the readability of CDS.

A metadata extension separates annotation from business logic.

Perform the following steps to implement a metadata extension:

  1. Add an annotation of @metadata.allExtensions:true to the CDS view.
  2. Create a Metadata extension and write annotations for the view and its fields.
  3. Use ";" to separate fields.
Metadata extensions only allow annotation of JSON style.

Some annotations relevant to the activation of CDS, like @odata.publish, @AbapCatalog.sqlViewName are not supported in a metadata extension.

If there is more than one metadata extension annotation for the same CDS, refer to https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abencds_meta_data_extension_eval.htm to know how to determine which metadata extension is used.

Log in to track your progress & complete quizzes