Users of your RAP list report want totals and grouping, like the subtotals they had in ALV. How do you give them that in a RAP UI service today?
Say your answer out loud first.
Practise another way
In the newer releases RAP supports an analytical table in a transactional-style service. I enable aggregation on the projection view with the OData annotation for full aggregation support.
I put an aggregation default such as sum or average on the measures. Then I add a presentation variant that groups, for example by status.
Fiori elements then shows totals and group subtotals. It is read-only at the moment; for editable rows I keep a normal list report, or build an analytical query for real reporting.
What SAP added. SAP's "What's new in RAP" overview lists the analytical table, read-only with release 2511 of the ABAP environment.
It brings aggregation and grouping in a Fiori elements table on a RAP service, the closest thing to ALV subtotals. An editable analytical table with draft support appears on the same deck as a future item.
How SAP's own sample does it. The Flight reference scenario has a package ana with /DMO/C_Travel_ANA:
@OData.applySupportedForAggregation: #FULL
define root view entity /DMO/C_Travel_ANA
provider contract transactional_query
as projection on /DMO/I_Travel_ANA
{
key TravelUuid,
OverallStatus,
@Aggregation.default: #SUM
TotalPrice,
@Aggregation.default: #AVG
@Semantics.amount.currencyCode: 'CurrencyCode'
BookingFee,
@Aggregation.default: #COUNT_DISTINCT
@Aggregation.referenceElement: ['CurrencyCode']
differentCurrencies,
CurrencyCode
}
@OData.applySupportedForAggregation: #FULLtells the OData V4 service to accept aggregation requests.@Aggregation.defaultper measure:#SUM,#AVG,#MIN,#MAX,#COUNT_DISTINCT(with a reference element; the sample counts currencies through a constant field).- The metadata extension adds
@UI.presentationVariantwithgroupBy: ['OverallStatus']and a sort order, so the table opens grouped. - The service definition exposes the projection, bound as OData V4 UI.
Note that the sample has no behavior definition: it is a read-only service, which matches "read-only analytical table".
Design choices
- Keep amounts with
@Semantics.amount.currencyCode; sums across currencies are meaningless, so group by currency or show a count of currencies as the sample does. - Users who must also edit rows get a normal transactional list report plus a separate analytical app, or wait for the editable analytical table on their release.
- Real reporting (many dimensions, hierarchies, pivoting) belongs to CDS analytical queries (
define transient view entity ... provider contract analytical_query) and analytics tools, not to a transactional app.
Release check. These annotations come from the ABAP environment line; confirm availability on an on-premise or Private Edition system before you promise it.
Names the projection-level aggregation annotations, the presentation variant for grouping, the release and the read-only limit, and knows when to use an analytical query instead.
Proposes calculating subtotals in ABAP and adding fake total rows, or says RAP cannot aggregate at all.
Adding totals by summing in a virtual element or a determination. That breaks paging and filtering; aggregation belongs in the OData request, driven by annotations.
- Why does the sample use a COUNT_DISTINCT on currency instead of summing amounts across currencies?
- What is a CDS analytical projection view, and when do you need one instead?
- How would you give users both editing and subtotals today?
5 official pages. Confidence: medium. Checked 3 Dec 2026.
- Official page Backs the answer.
- Official page Backs the answer.
- Official page Backs the answer.
- Official page Backs the answer.
- Official page Backs the answer.