CDS Annotations for UI Part 3: Annotating CAP Services for Fiori Elements
Preview · a free account unlocks the full lesson
Apply the same UI vocabulary in SAP CAP: annotate entities in . cds files, separate annotations into annotation files, add value helps and texts, enable drafts, and preview Fiori elements apps on CAP services locally.
Visual overview
Explanation
Parts 1 and 2 used RAP CDS for annotations; Part 3 does the same job for CAP-based apps.
CAP services expose OData V4 using the same UI and Common vocabularies that RAP uses. In CAP CDS, you write annotate ServiceName.Entity with { ... } and use @UI.LineItem, @UI.SelectionFields, @UI.Facets and others, just with CAP's own syntax rather than RAP's.
It matters where these annotations are placed: annotating the service projection, rather than the database entity, keeps UI concerns in the service layer instead of leaking into the data model. Many projects keep UI annotations in separate files under the app folder, which keeps the service definition readable and mirrors the same idea behind RAP's metadata extensions.
Create a free account to keep reading
You have read the opening of this lesson. A free ERPClimb account unlocks the rest of it, every other lesson and topic, and your learning history, so you can pick up exactly where you stopped. No card needed.
- Full explanation
- Real project scenario
- Common mistakes
- Best practices
- Interview angle
One tap with Google works too. Every topic keeps its first lesson open to everyone.
Keep exploring
More lessons in this topic
Check before use: lesson examples are educational, not a guarantee of correctness for your SAP edition or release. Sample code has not been executed on your SAP system. Confirm API availability, syntax, authorizations and business impact in an approved development or test environment.