Skip to Content
avatar image
Former Member

ABAP CDS - Aggregation

Hi,

I need to aggregate a particular measure on the fly based on the selected attributes - Is it possible using @DefaultAggregation: #SUM? Or we need to use SUM() and GROUP BY?

What is the difference between the two?

Example,

@DefaultAggregation: #SUM

vbap.klmeng as OrderQty


OR

SUM(vbap.klmeng) as OrderQty


Thanks,
Remya

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Jun 24, 2017 at 04:09 PM

    The annotation will be used by framework or tools, e.g. the Analytical Engine or TCode RSRT,which means the aggregation behavior will be decided by the annotation you specified.

    in order to reach the similar behavoir in your own code, you have to interpretated the annotation by your self. however, if you're directly use the CDS in your ABAP code, then the SUM, groupby is needed in your Open SQL.

    Best Regards,

    Sean

    Add comment
    10|10000 characters needed characters exceeded