cancel
Showing results for 
Search instead for 
Did you mean: 

Analytical Table Example

0 Kudos
10,726

Can someone share a working example of a analytical table?

I am trying to create a smart table type AnalyticalTable that will have subtotals for certain columns.

After searching the SAPUI5 documentation https://sapui5.hana.ondemand.com/#/topic/3d33684b08ca4490b26a844b6ce19b83

were I only found fragments views which I wasn't able to figure out.

Since I did not find a concrete tutorial for this online, I am asking anyone if he can be so kind as to share a simple example. Many thanks in advance!

Accepted Solutions (1)

Accepted Solutions (1)

maggie_zhang5
Explorer

Hi,

I have created one example by using the List Report template of Fiori.

i.e., the smart table will consume the data from CDS view ZDEMO_CDS_SOI_WD, and we want to sum the value for the column "Amount".

1. Add annotation @DefaultAggregation: #SUM for "Amount".

2. Create the OData service. The CDS entity is marked as Analytical".

And for the "Amount", you will see following information in the metadata:

2. If your smart table is added by breakout, then in the fragement.xml, we also need to set the tableType as "AnalyticalTalbe" for the smart table:

Hope this will be helpful.

BRs, Maggie

Answers (1)

Answers (1)

Joseph_BERTHE
Active Contributor
0 Kudos

Hello,

There is some blogs talking about this subject such as those :

If your problem is the starting point in freestyle application, you can first play with Fiori Elements List report floorplan. To do it, in the easiest way, you will have to do :

  1. Create de CDS view with aggragation annotation such as @Aggregation.default: #SUM and UI annotation such as @UI.LineItem
  2. Expose this CDS as OData service with the annotation @OData.publich: true
  3. In WebIDE create an application from Fiori Element template (by choosing List Report floorplan) and connect this application to you service

If you follow all those steps in 30 minutes (even less) you will have Analytical table.

Regards,

Joseph

0 Kudos

Hi Joseph,

Thanks for providing a solution above, but this won't work for me since we are operating in a public cloud ( S4HANA Cloud ) environment and we do not have access to the backend system. We can only create CDS's using the "Custom CDS" Tile but I failed to see any way to set the aggregation for the fields.

In my app, I already exposed the CDS, but I wanted to implement the ALV and it would be nice to see a sample code for the UI implementation using smarttable.TableType.AnalyticalTable .