Guide

CDS View Annotations — A Complete Guide

CDS annotations control UI rendering, OData exposure, search, and authorization. This guide covers the most important annotation namespaces.

What Are CDS Annotations?

Annotations are metadata declarations prefixed with @ that control how a CDS View behaves at runtime. They can be applied at the view level or at the field level, and they drive everything from Fiori UI rendering to OData service behavior.

Key Annotation Namespaces

@UI — User Interface

Controls Fiori Elements rendering: which fields appear in list reports, object pages, filter bars, and selection fields.

  • @UI.lineItem — Field appears in the list table
  • @UI.headerInfo — Title and description on object pages
  • @UI.selectionField — Field appears in the filter bar
  • @UI.chart — Defines chart visualizations

@Analytics — Analytical Processing

Marks views for analytical processing on SAP HANA:

  • @Analytics.dataCategory: #FACT — Fact table with measures
  • @Analytics.dataCategory: #DIMENSION — Master data dimension
  • @Analytics.dataCategory: #CUBE — Multidimensional query

@OData — OData Protocol

Controls OData service behavior:

  • @OData.publish: true — Automatically exposes the view as an OData service (legacy approach)
  • @OData.entityType.name — Override the OData entity type name

@ObjectModel — Business Object Modeling

Defines transactional behavior for RAP:

  • @ObjectModel.modelCategory: #BUSINESS_OBJECT — Marks as a business object
  • @ObjectModel.compositionRoot: true — Root entity for draft and CRUD

@Search — Enterprise Search

Enables full-text search on CDS View fields:

  • @Search.searchable: true — View is searchable
  • @Search.defaultSearchElement: true — Field is included in default search

@AccessControl — Authorization

Links the view to an access control object that defines row-level authorization based on the user's role.

Explore Annotated Views