cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

OVP Application using CDS View with parameters

abhi1185
Product and Topic Expert
Product and Topic Expert
0 Kudos
3,254

Hello,

I have created OVP application using Consumption view CDS, with multiple chart cards. It was working.

Now I have requirement to add parameter to CDS which will be passed as filter criteria in where clause of CDS. But as soon as I added parameter to CDS , nothing is visible on charts. Metadata is reflecting parameter entity created , parameter is also coming in app, however nothing is visible on charts. I also changed the card settings, added "addODataSelect": true, but still no use.

CDS parameter (CDS is fetching data correctly, if I check data in data preview)

Odata Service(generated) Metadata

Card settings.

OVP Application, with blank cards. parameter is reflecting.

Accepted Solutions (0)

Answers (5)

Answers (5)

harishkollipara
Explorer
0 Kudos

Iam doing almost the same. Overview Page with couple of Analyticals cards using CDS with parameters.

But for me, I see two blank cards but missing selection screen. The CDS parameters does not show up on the Filter area.

Here is my CDS:

harishkollipara_0-1715282230561.png

harishkollipara_1-1715282271243.png

And here is my output.

harishkollipara_2-1715282305804.png

Can anyone provide any thoughts? #SAP Fiori Elements Overview Page #CDS with parameters

raveeshsaurabh3
Active Participant
0 Kudos

Hi abhi1185

Were you able to resolve the issue? I am facing exactky the same problem.

Thanks

Raveesh

diego_a
Participant
0 Kudos

Hello,

What may be happening that instead of passing the parameters as a key, it happens to me with filter, I use CDS models

$ filter = p_EKORG eq '' and p_LIFNR eq '108000' and p_MATKL eq '' and p_MATNR eq '' and p_EKGRP eq '' and p_WERKS eq '' and p_date_start eq datetime'2020-01-01T00: 00: 00 'and p_date_e eq datetime'2020-05-08T00: 00: 00 '

where I am using two models one for the filter and one for the data

"sap.ovp": { "globalFilterModel": "ZCDS_FILTROS_PROVEEDORES_CDS", "globalFilterEntityType": "zcds_filtros_proveedoresParameters", "enableLiveFilter": true, "considerAnalyticalParameters": false, "cards": { "card00": { "model": "ZSD_PROV_COND_COM_SRV", "template": "sap.ovp.cards.table", "settings": { "title": "{{card00_title}}", "subTitle": "{{card00_subTitle}}", "entitySet": "condComercialesSet", "addODataSelect": false } } } }

when from the chrome console it would have to show me / zcds_filters_providers (p_EKORG = '', p_LIFNR = '108000', p_MATKL = '', p_MATNR = '', p_EKGRP = '', p_WERKS = '', p_date_start = datetime'2020-01-01T00: 00: 00 '= p_date_end eq datetime '2020-05-08T00: 00: 00') / zcds_filters_providersSet

regards,

abhi1185
Product and Topic Expert
Product and Topic Expert
0 Kudos

Main issue seems to be this one 'The caller violated a precondition for method call', which I think is coming as CDS is having parameters, which is not getting passed.

As for CDS with parameters , we need to use below URL format for fetching data passing parameter, so is generated OVP template is equipped to do so ?

/sap/opu/odata/sap/ZRMT_C_ASSIGNMENT_OVERVIEW_CDS/ZRMT_C_ASSIGNMENT_OVERVIEW(p_date='20191105')/Set

former_member289890
Participant
0 Kudos

Hi Abhishek -

Struggling with exact same problem. Did you find a solution ?

Thanks,

Tanveer

raveeshsaurabh3
Active Participant
0 Kudos

Hi Abhishek,

I am facing exactly the same problem. Can you please let us know if it is possible to create an overview page with a parameterized CDS view?

Any help will be appreciated.

Thanks

Raveesh

abhi1185
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hello Prasita,

I tried what is there in link, but facing some other issues.

Once I added parameters to my CDS, OData Metadata is looking something like this.

it is now having two entities

ZRMT_C_ASSIGNMENT_OVERVIEWResult

ZRMT_C_ASSIGNMENT_OVERVIEWParameters

Now in WEB IDe, I created one local annotations for selectionvariant

and changed card settings accordingly.

However now when I run the OVP application for first time, cards don't show any data, and then its goes to some kind of error.

Console shows lot of errors including errors related to identification annotations, I dont have any navigation defined from cards as of now, is it mandatory ?

Assaf
Discoverer
0 Kudos
did you solve it?