cancel
Showing results for 
Search instead for 
Did you mean: 

CAP CDS-Rest like operator missing

sdebaerd
Participant
583

Hi

We use CAP, which calls a custom CDS, when using a filter condition like startswith, this get's translated to an object like:

[
  { ref: [ 'Column' ] },
  'like',
  { func: 'concat', args: [ { val: 'VAL' }, "'%'" ] }
]

Then a dump occurs with the following error message:

[2020-07-03T15:27:13.365Z | ERROR | 1810204]: Feature not supported: Method .func of fluent API
[2020-07-03T15:27:13.366Z | ERROR | 1810204]: Error stacktrace: Error: Feature not supported: Method .func of fluent API     at nodeapplocation\node_modules\@sap\cds-runtime\lib\cds-rest\cqnToQuery\index.js:21:15     at Array.forEach (<anonymous>)     at compile (nodeapplocation\node_modules\@sap\cds-runtime\lib\cds-rest\cqnToQuery\index.js:16:31)     at nodeapplocation\node_modules\@sap\cds-runtime\lib\cds-rest\cqnToQuery\index.js:35:23     at Array.map 
(<anonymous>)     at compileNextExpression (nodeapplocation\node_modules\@sap\cds-runtime\lib\cds-rest\cqnToQuery\index.js:35:11)     at nodeapplocation\node_modules\@sap\cds-runtime\lib\cds-rest\cqnToQuery\index.js:19:9     at Array.forEach (<anonymous>)     at compile (nodeapplocation\node_modules\@sap\cds-runtime\lib\cds-rest\cqnToQuery\index.js:16:31)     at nodeapplocation\node_modules\@sap\cds-runtime\lib\cds-rest\cqnToQuery\index.js:35:23

Also trying to parse, the following command throws different errors, in this set up.

select column from table where column like 'VAL%'

However when running a CAP application, that calls genuine objects residing in a HDB Container, the like works fine.
To me there seems some functionality missing in the cds-rest library, to support like as an operator.

Accepted Solutions (0)

Answers (1)

Answers (1)

gadirov
Participant
0 Kudos

Hi Steven,

see my blogpost in here:

https://answers.sap.com/questions/13320866/sap-cap-external-service-filter-startswithendswith.html

SO, basically there is the possibility to modify query.SELECT.where properties. I will post my solution soon.

BR
Rufat