cancel
Showing results for 
Search instead for 
Did you mean: 

xsodata and sap:aggregation

ianfmccallum
Explorer
0 Kudos

Hi:

I have a stupid simple SAP Cloud Platform Calculation View that has three dimensions (Employee, Calendar Year, and Calendar Month) and one measure (Number of calls). I have also created a .xsodata file to expose this as an OData service. In the .xsodata file, I've added the following:

annotations {
	enable OData4SAP;
}

I am seeing the sap:label in the EDMX file, but am I also able to add/see the sap:aggregation-role, too?

Thanks in advance, Ian.

Accepted Solutions (1)

Accepted Solutions (1)

ianfmccallum
Explorer

The key is to specify the aggregation in the .xsodata file with the 'aggregates always' clause.

The complete service description is:

service namespace "CCO.com.sap.nacco.service" { 
       "CV_CONTACT_BYMONTH_V2" as "ContactByMonthSet" with ("CALMONTH", "CALYEAR", "CONTACT_COUNT", "ContactType", "FullName") key generate local "GenID" aggregates always (SUM of "CONTACT_COUNT");
}

annotations {
		enable OData4SAP;
}

Answers (1)

Answers (1)

Joseph_BERTHE
Active Contributor

If you want aggregation to your properties, put this annotation above the property :

@DefaultAggregation: #SUM

Regards,

Joseph