sapui5tutors SAPUI5 • Fiori • SAP BTP Step-by-step tutorials Real project examples Interview Q&A
Practical SAPUI5 • Fiori • SAP BTP tutorials and interview prep

CAPM Fiori Elements UI: Generating List Reports

From OData to app in one command

You have a CAP service. Now you need a UI. The fastest path: generate a Fiori Elements list report + object page straight from your service metadata — then refine with annotations instead of code.

Fiori Elements apps are 90% annotations. The generator scaffolds the app; your CDS annotations design it.


Step 1: Generate the app

cds add fiori --for production

Or use the Fiori generator in VS Code: pick List Report Page, point it at your running service's $metadata, select the main entity. The generator creates the app/ folder with manifest, views, and routing.


Step 2: Design with UI annotations

The list report reads its columns from UI.LineItem:

annotate CatalogService.Books with @(
  UI.LineItem : [
    { Value : title,  Label : 'Title' },
    { Value : price,  Label : 'Price' },
    { Value : author.name, Label : 'Author' }
  ],
  UI.SelectionFields : [ title, author_ID ]
);

Save, refresh — the table reshapes itself. No XML edits, no controller changes. This annotation-driven loop is the whole Fiori Elements productivity story.


Step 3: The object page

Click a row and the object page opens, built from UI.FieldGroup and UI.Facets:

annotate CatalogService.Books with @(
  UI.FieldGroup #Main : {
    Data : [
      { Value : title },
      { Value : price },
      { Value : stock }
    ]
  },
  UI.Facets : [
    {
      $Type  : 'UI.ReferenceFacet',
      Label  : 'Details',
      Target : '@UI.FieldGroup#Main'
    }
  ]
);

Facets become the object page's sections; compositions become subsections automatically.


What you get for free

  • Filtering and search — from UI.SelectionFields.
  • Draft UI — edit/save/discard buttons appear when the entity is draft-enabled.
  • Value helps — from @Common.ValueList annotations.
  • Actions as buttons — bound actions render in the toolbar.
  • Navigation — associations become clickable links between pages.

If you're writing XML views by hand for standard list/object scenarios, stop. Annotations do it faster and survive upgrades better.


When to leave Fiori Elements

Fiori Elements covers list reports, object pages, and analytical views brilliantly — but not everything. Reach for freestyle UI5 when you need custom visualizations, drag-and-drop, complex wizards, or pixel-level layout control.

The good news: it's not either/or. Embed a freestyle component as a custom section inside a Fiori Elements object page, or use building blocks for the custom parts. Keep the standard shell and add custom where it counts.


Generate, annotate, refine

The workflow: generate once, then live in the annotations. Reserve freestyle UI5 for the screens that genuinely need it — most don't.

Generating your first Fiori app? Tell me how it goes in the comments.