Sub topic 10
Analytical Apps in SAP Fiori: KPI Tiles and Report Apps
This chapter assumes you can read a CDS analytical query view (see the earlier chapters on cubes, dimensions and queries) and that you can open the SAP Fiori launchpad. It covers how a query becomes a tile or a report on the launchpad, and the errors that most often block it.
From query view to Fiori content
A query view does not appear on the launchpad by itself. Three things connect it to a user:
- The query is released for analytical consumption, so front ends can read it.
- A launchpad catalog holds a tile or target mapping that points to the query.
- A role assigns the catalog to users, and an access control restricts the rows they see.
The query from the earlier chapter, ZC_NetAmountByCustomer, is the example here.
KPI tiles
A KPI tile is a launchpad tile that shows one number, such as total net amount, and optionally a trend arrow and a color. The number comes from a query, so the tile and the detail report always agree.
A tile needs these settings:
- The query that provides the value.
- The measure to show, for example
NetAmount. - Filters that limit the value, for example the current year.
- Thresholds, which set the color. A threshold can be a fixed number or a range, and it can mean "higher is better" or "lower is better".
Choose the improvement direction first. A cost KPI that turns green when the value rises will mislead users.
A tile's value is calculated on live data each time it loads. Keep tile queries narrow, with a filter and few dimensions, because every user who opens the launchpad triggers the calculation.
Report apps
A report app lets users explore the query result. SAP S/4HANA offers several, and the choice depends on what users need:
| App type | Best for | User can do |
|---|---|---|
| Analytical list page style report | Browsing and filtering a result with charts and a table | Filter, switch between chart and table, drill down |
| Query Browser style app | Ad hoc tabular analysis of any released query | Choose a query, move dimensions between rows and columns, filter |
| Web Dynpro based analytical grid | Existing pivot-style reports | Drill, filter, and export |
Which apps your system offers depends on the release. Check the app library for your version.
Users change the layout of a report at run time. They can swap a dimension from rows to columns or add a filter, and the query view only supplies the defaults you annotated with @AnalyticsDetails.query.axis. If the default layout is wrong, change the annotation. Do not expect users to fix it each time.
Drill-down and text display
Drill-down means adding a dimension to the result to see a measure split into finer parts. For NetAmount, a user can add Country to see each customer's amount by country. Drill-down only works for fields that the cube exposes through associations to dimensions. The @ObjectModel.foreignKey.association annotation on CustomerId is what lets the app offer the customer's attributes and text.
Because CustomerName carries @Semantics.text: true, the app can show the name beside or instead of the ID. If the name is missing in the app, check the text annotation on the dimension before looking at the front end.
Common errors
- The query is missing from the app. The query is not released for consumption, the catalog is not assigned to the user's role, or the query lacks
@Analytics.query: true. - The tile shows no data or a "no authorization" message. The user has no matching access control values. Test with a user who has the same role, not with a developer user.
- Amounts are added up across currencies. The measure has no currency annotation. Add
@Semantics.amount.currencyCodeso the app shows a separate total per currency. - The tile is slow. The query reads too many rows. Add a filter, remove dimensions, and check the performance practices in the last chapter.
- A change to the view does not show up. The launchpad and the app may be caching metadata. Clear the cache and reload.
Exercise
Exercise
A KPI tile for NetAmount is green when the value is high. The tile is used to show returns costs. What setting is wrong, and why does it matter?
Show answer
The improvement direction is set to "higher is better". For a cost KPI it must be "lower is better". Otherwise a growing cost shows as green, which tells users that nothing needs attention.
Exercise
A user opens a report app on ZC_NetAmountByCustomer and sees customer IDs but no names. Which annotation do you check first, and on which view?
Show answer
Check @Semantics.text: true on CustomerName in the dimension view ZI_CustomerDim, and check that the cube's CustomerId has the foreign key association to that dimension.