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.