CDS Annotations for UI Part 2: The Essential @UI Annotations Cheat Sheet
Lessons are open to try during our launch period. Some advanced content may move to Pro later. AI practice limits apply separately.
Learn the annotations you use in every Fiori elements app — headerInfo, lineItem, selectionField, identification, facet, fieldGroup, dataPoint, hidden and chart — with what each controls and common pitfalls.
In this lessonShow sectionsHide sections
Visual overview
The situation: a real project scenario
Two forms on an object page kept showing the same fields. Both field groups had been defined without qualifiers, so the second overwrote the first. Adding qualifiers 'General' and 'Pricing' and referencing them in the facets fixed the page.
Explanation
Part 1 explained where annotations live; Part 2 is the practical reference for the core @UI annotations themselves.
On the list report side, @UI.selectionField with a position adds filters to the filter bar, while @UI.lineItem with position, label and importance defines table columns, and line items of type for-action add toolbar buttons. @UI.presentationVariant can also define default sorting and grouping for the table.
On the object page side, @UI.headerInfo sets the typeName, typeNamePlural and title — the object's title and type. @UI.identification lists key fields and header actions on the object page. @UI.facet defines the page's sections, each referencing a target, with facet types including identification references, field group references, and line item references. @UI.fieldGroup, used with qualifiers, creates the forms within those sections.
@UI.dataPoint presents a value with criticality, target or trend, and is used both in headers and in tables. @UI.chart defines microcharts and charts for analytical floorplans and overview cards. Both need their measures and dimensions defined correctly to render properly.
For visibility and behavior, @UI.hidden hides fields that are technically needed but shouldn't be shown to users, and @UI.multiLineText renders long texts appropriately. Field control and side effects, meanwhile, come from behavior definitions or their own dedicated annotations rather than from these UI annotations.
Qualifiers come into play whenever the same annotation is used more than once on one entity — for example, two field groups or two charts — and facets then reference them by qualifier. Missing a qualifier in that situation causes annotations to overwrite each other silently, which is a common source of confusing bugs.
In practice, this means annotating an entity with headerInfo, lineItem and selectionField, adding two field groups with qualifiers and referencing them in facets, adding a dataPoint with criticality to the header, and hiding a technical key with @UI.hidden — building toward being able to write the core annotations for a list report and object page from memory.
How the SAP process fits together
SAP PROCESS EXPLORER · Fiori: from service to user
ERPClimb.comCDS Annotations for UI — process breakdown
Topic-specific conceptual flow: how key objects and decisions fit together. SAP configurations and exceptional cases can follow different paths.
Selected process stage
Choose
Annotations live in CDS, metadata extensions or local files
Representative SAP learning flow, not a guarantee of system runtime sequence in every scenario.
Watch out
Common mistakes
Defining two field groups (or other repeated annotations like data points) without qualifiers is the exact bug in this lesson's example: without a qualifier, the second definition silently overwrites the first instead of coexisting as two distinct groups, so a page that's supposed to show two separate forms shows the same fields twice — and there's no error, just confusing duplicate content.
Showing technical keys (internal GUIDs, raw status codes) directly to end users, rather than using @UI.hidden on them or exposing a text/description association instead, forces users to memorize or look up meaningless codes to do their job.
Not setting importance on LineItem columns removes the responsive table's ability to intelligently hide lower-priority columns on smaller screens, leaving it to either cram everything in or hide the wrong things.
Building charts without properly modeled measures and dimensions (treating a dimension as a measure, or vice versa, or omitting the aggregation behavior CDS expects) produces charts that render but show misleading or nonsensical aggregated values.
Do this
Best practices
Use qualifiers consistently on any annotation that can legitimately repeat for the same entity (multiple field groups, multiple data points) — this is what lets you have, say, a 'General' and a 'Pricing' field group on the same object page without one silently overwriting the other.
Hide technical fields (internal keys, raw codes) from the UI with @UI.hidden, or better, expose the associated text/description field instead, so users interact with meaningful values rather than internal identifiers. Set importance and a deliberate position on LineItem columns so the responsive table can make sensible decisions about what to show at narrower widths.
Model chart-relevant fields with correct measure/dimension semantics and aggregation behavior in the CDS view itself, so the chart annotation can rely on the underlying data already being shaped correctly for aggregation.
In the interview
Interview angle
Interviewers frequently probe this exact scenario: 'Two sections on an object page show the same fields instead of two different forms — what's the likely cause?' The correct, specific answer is a missing qualifier on a repeated annotation (most often @UI.fieldGroup) — without it, the second definition overwrites the first rather than creating a distinct group, and the fix is adding qualifiers like #General and #Pricing and referencing them explicitly from the relevant facets.
Being able to name this specific pitfall, rather than giving a generic 'check your annotations' answer, is a strong signal of hands-on CDS/UI annotation experience.
Practice this lesson
Original educational case studies for SAP consultants, not official SAP certification exam questions. Verify product edition and implementation details against the current SAP documentation.
Quick check
0 of 3 questions attempted
Question 1 of 3
Which annotation sets the object page title and type name?
Question 2 of 3
Two field groups on one entity overwrite each other. What is missing?
Question 3 of 3
Which annotation presents a KPI-like value with criticality in a header?
Practise this in an interview
Answer in your own words and get instant feedback, the way an interviewer would judge it.
1Which UI annotations do you need for a basic list report and object page, and what pitfalls do you watch for?
Frequently asked questions
Which annotations build a Fiori list report?
@UI.selectionField with position adds filters, @UI.lineItem with position, label and importance defines columns, line items of type for-action add toolbar buttons, and @UI.presentationVariant can set default sorting and grouping.
Which annotations build a Fiori object page?
@UI.headerInfo sets the type names and title, @UI.identification lists key fields and actions, @UI.facet defines sections, and @UI.fieldGroup with qualifiers creates forms.
Why do Fiori annotations sometimes overwrite each other?
When two field groups or charts exist on one entity without qualifiers, they collide silently. Qualifiers distinguish them, and facets reference them by qualifier.
Was this lesson helpful?
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.