Skip to Content
0

xsodata and sap:aggregation

Dec 19, 2017 at 06:33 PM

76

avatar image

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.

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

2 Answers

Best Answer
Ian McCallum
Dec 27, 2017 at 05:23 PM
1

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;
}
Share
10 |10000 characters needed characters left characters exceeded
Joseph BERTHE Dec 21, 2017 at 08:48 AM
1

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

@DefaultAggregation: #SUM

Regards,

Joseph

Share
10 |10000 characters needed characters left characters exceeded