cancel
Showing results for 
Search instead for 
Did you mean: 

SAP CPI - CDS with parameters Odata consumption

deuzemaizz
Explorer

I´m trying to expose a OData service on CPI.

This Odata coming from a CDS view with parameters....

For READ operation, it´s ok.

For QUERY, CPI doesn´t accept parameters in ResourcePath.

The URL seems like that

https://<URL>/sap/opu/odata/sap/YY1_<ODATA-SERVICE>/YY1_<NAME>(P_1='<WHATEVER-VALUE>',P_2='<WHATEVER-VALUE>')/<RESULTNAME>?$top=1

I already read the sap note "2600276 - Exposing a CDS view with parameters as OData error code LCX_MISSING_PARAMETER"

0 Kudos

Hi,

can you please let me know how did you perform the read?

i am still getting the lcx* exception since i am not able pass the parameter value in my odata call to the entity read.

Accepted Solutions (0)

Answers (2)

Answers (2)

0 Kudos

Hi,

I am facing the issue similar that i have created the custom extension for standard CDS view with 3 parameters. Now, when i created custom OData service,it is not loading the data and exception thrown with LCX_MISSING_PARAMETER at get_entityset() for one of CDS view parameter. how to trigger call for this custom OData service?

i am in s4hana 1711 version, the note is not helping me even to fix this issue. this i need to create custom fiori application.

#s4hanacloud #customcdsodata

0 Kudos

Hi, i got this issue fixed. with SAP note. s4hana 1709

bhalchandraswcg
Contributor
0 Kudos

Hi Daniel,

As per the documentation for Configuring OData V2 Receiver Adapter, "Navigation entities in the resource path are not supported".

Here are some options which may be helpful for you.

Option 1:

Read operation with

  • Resource Path as YY1_<NAME>(P_1='<WHATEVER-VALUE>',P_2='<WHATEVER-VALUE>')
  • $select=<ALL FIELDS OF <RESULTNAME>>
  • $expand=<RESULTNAME>
  • $top=1

Option 2:

Query operation with

  • Resource Path as YY1_<NAME>
  • $select=<ALL FIELDS OF <RESULTNAME>>
  • $expand=<RESULTNAME>
  • $filter=P_1 eq '<WHATEVER-VALUE>' and P_2 eq '<WHATEVER-VALUE>'
  • $top=1

Option 3:

HTTPS Adapter with

  • Address as https://<URL>/sap/opu/odata/sap/YY1_<ODATA-SERVICE>/YY1_<NAME>(P_1='<WHATEVER-VALUE>',P_2='<WHATEVER-VALUE>')/<RESULTNAME>?$top=1

HTTPS Adapter would not provide nice XML payload in response.

Hope this helps,

Bala