cancel
Showing results for 
Search instead for 
Did you mean: 

How to pass values to parametrized CDS views from PowerBI?

TrusPatel
Participant

Hi Experts,

How to pass parameters to CDS view ( Exposed via OData ) from PowerBI?

I am using powerBI for analysis on Standard Fiori App : Inventory KPI Analysis

In PowerBI, I am using this URL "/sap/opu/odata/sap/MMIM_STKKPITIMESERIESCOMPRN_SRV/?$format=xml" in "OData Feed" option. It fetches all the entities and tries to call them one by one. in few of the entities, PowerBI throws below error.

Error on PowerBI.

Error in /iwfnd/error_log

I found that Below CDS view is getting used and it has parameters.

Accepted Solutions (1)

Accepted Solutions (1)

juliandanho
Participant

Hi trushitpatel1727_6

try this: C_StkKPIGroupComparisonResults(P_StartDateOfPreviousPeriod='<startdate>',P_EndDateOfPreviousPeriod='<enddate>,P_StartDateOfReferencePeriod='<startdate2>,P_EndDateOfReferencePeriod='<enddate2>,P_PeriodType='<periodType').

You call the $metadata to see the parameters of the entity

Kind regards

Julian Danho

TrusPatel
Participant
0 Kudos

Hi Julian,

Thanks for the help.

What worked for me is adding "datetime" keyword and "Results" navigation as below

/sap/opu/odata/sap/MMIM_STKKPITIMESERIESCOMPRN_SRV

/C_StkKPIGroupComparisionQry(

P_StartDateOfPreviousPeriod=datetime'2021-06-01T00:00:00',

P_EndDateOfPreviousPeriod=datetime'2022-05-31T00:00:00',

P_StartDateOfReferencePeriod=datetime'2022-06-01T00:00:00',

P_EndDateOfReferencePeriod=datetime'2023-05-31T00:00:00',

P_PeriodType='M'

)/Results

juliandanho
Participant
0 Kudos

Hi trushitpatel1727_6

yes because of the Edm Type. This is OData Microsoft standard - see SAP Docu.

The same is still the case for Edm.Guid. There you also need $filter=UUID eq guid'00000000-0000-0000-000000000000'.

Kind regards
Julian Danho

TrusPatel
Participant
0 Kudos

Hi Julian,

Thanks for taking out your time and helping me. Actually the link you shared really helps.

Answers (0)