Get Example source ABAP code based on a different SAP table
• GROUP BY ABAP_CDS_SELECT_V1
ABAP_CDS_DDL - DDIC-Based View, SELECT, GROUP BY
ABAP_SYNTAX ... GROUP BY field1, field2, ... path_expr1, path_expr2, ...
What does it do? Groups those rows in the result set of a ABAP_CDS_V1_VIEW that have the same content in the elements specified by the fields field1, field2, ... or path expressions path_expr1, path_expr2 ... as a single row. The fields must be specified using the same names as the fields in the data source data_source. It is not allowed to use the alias names defined in the current CDS view using with AS. The GROUP BY clause is mandatory if the SELECT list contains any aggregate expressions. All elements that are not defined using an aggregate expression must be listed after GROUP BY . Literals and other expressions cannot be specified after GROUP BY . When the CDS view is accessed, the results of the aggregate expressions are calculated from the values of the corresponding fields of the combined rows and the results are placed in the element of the resulting row in the result set. The fields specified after GROUP BY cannot be of the type LCHR, LRAW, STRING , RAWSTRING, or GEOM_EWKB.