OData Query for Parameterised CDS

Quite a few Analytical queries using CDS are parameterised. Check out how to create an OData query for parameterised CDS.

Consider this analytical query C_SalesVolumeAnalyticsQry which has parameter exchange rate type and display currency.

The first thing you need to do is get the metadata of the service. Now locate three different pieces of information.

EntityType Name = C_SALESVOLUMEANALYTICSQRY (drop the Parameters)

Parameters = P_ExchangeRateType and P_DisplayCurrency

Navigation Property Name for Results = Results

Using the above three pieces of information you then construct the query

/sap/opu/odata/sap/C_SALESVOLUMEANALYTICSQRY_CDS/C_SALESVOLUMEANALYTICSQRY(P_ExchangeRateType=’M’,P_DisplayCurrency=’GBP’)/Results

Leave a Reply