Skip to Content
0
Jul 15, 2020 at 11:31 AM

Error using SmartTable/AnalyticalTable aggregation without CDS

124 Views

Hello,

I'm using the Smart Table in my application. Because I need to do some grouping and sorting as well as displaying the totals and subtotals of the quantity I disovered that the TableType Analytical Table would be the best.

I followed these instructions of SAP Using OData Analytics in SADL-Based Services. The entity has the GENERATED_ID as a key, was mapped to a data source and in the MPC_EXT Class I added the semantics:aggregation as well as the dimensions and measures.

I tried to set the aggregation-role for all of the properties to dimension or measure and I tried to set just the ones I need but there was no difference.

As the next step, I redefined the method IF_SADL_GW_QUERY_CONTROL~SET_QUERY_OPTIONS and set the query options in the DPC_EXT class.

I redefined the get_entityset method of my entityset and filled the et_entityset. I discovered that I need to call the method super->prodstatisticsse_get_entityset so that the set_query_options are called.

I didn't get any generated id so I just looped through my table to set it by myself.

The result ist, that I don't get any aggregation and this error:

The aggegated row just shows the value of the first row and also the grouping doesn't work properly.

Here is the metadata of the EntityType:

and the metadata of the EntitySet:

Maybe there is a problem with my measure and the aggregation but I can't find a way, where it is working.

Attachments

mpc.png (31.9 kB)
mapping.png (25.5 kB)
query-options.png (13.8 kB)
error.png (10.0 kB)
metadata1.png (73.5 kB)
metadata2.png (6.8 kB)
mpc.png (40.9 kB)