cancel
Showing results for 
Search instead for 
Did you mean: 

How can we use OData 2.0 custom query options with 'srv.send' with CQN?

shatsijev
Explorer

Hi,

For our current project we are working with CAP as it's showcased by SAP; using cds external service based on the OData V2 service definition.

We are trying to retrieve data from SuccessFactors API using CQN however for one of the request we need to add a query parameter to reproduce the following API call :

GET https://apiXXX.successfactors.eu/odata/v2/User
?$select=[REQUIRED_FIELDS]
&$expand=[RELATED_ENTITIES]
&$filter=[SOME_FILTERS]
&fromDate=1900-01-01

`fromDate` is not a User entity's property or any other related entities one but it is required to get the needed data.

We looked in the documentation and we couldn't find any solution.

gregorw
Active Contributor
0 Kudos

I would suggest that you file an incident via SuccessFactors Support how this what I think not OData compatible query parameter can be handled in CAP. I guess you're using CAP Node.JS?

shatsijev
Explorer
0 Kudos

gregorw I am indeed using CAP Node.JS

SebastianEsch
Active Participant

I guess using srv.send instead of cds.ql with the method & path approach might be a solution, or the plain REST usage examples of srv.get.

I don't know if cds.Request is able to handle 'query' and 'params' at the same time. If yes, then adding your cds.ql query to request.query and non-OData parameters to request.params might work, if you srv.send(request). But I have not tried that myself.

Kind regards,

Sebastian

pieterjanssens
Active Participant
SebastianEsch
Active Participant
0 Kudos

CAP can handle the custom query option "search" in CQN - see https://cap.cloud.sap/docs/releases/aug22?q=custom+query+option#improved-consumption-of-remote-odata...

I don't know if there is support for custom "custom query options". 😉

pieterjanssens
Active Participant

david.kunz2 SAP will not change this on SFSF side, please support any custom query option and not only 'search'.

Accepted Solutions (0)

Answers (1)

Answers (1)

Oleks
Discoverer
0 Kudos

We also have problems with the query parameters available in Successfactors: For example, there are two parameters are widely used in SSF:

  • asOfDate
  • toDate

which allows timetraveling. In our setup we are not able to pass these parameters to the SSF backend from UI5 frontend: UI5(OData V4) -> CAP (NodeJS) -> SSF(OData V2).

For now we have to implement a custom handler for each and every entity to add manually these params to the query: CAP -> SSF.