cancel
Showing results for 
Search instead for 
Did you mean: 

'Feature not supported: SELECT statement with .groupBy'

sujitsingh5191
Explorer
0 Kudos
564

I am trying to call a remote service on CAP with following path v2/PlanningData/TSINH1?$filter=UOMTOID eq 'EA'&$format=json⊤=100&$select=PRDID,CUSTID,CONSENSUSDEMAND,UOMTOID,VERSIONID,SCENARIOID,ID,PERIODID4_TSTAMP

and getting the response as 'Feature not supported: SELECT statement with .groupBy'

oliver.klemenz

vansyckel

Sandra_Rossi
Active Contributor
0 Kudos

Did you search in SAP Support?

Ivan-Mirisola
Product and Topic Expert
Product and Topic Expert
0 Kudos

Could you please include the version of your cds modules with the following command:

cds version

Best regards,
Ivan

sujitsingh5191
Explorer
0 Kudos

Yes I have searched in SAP support but didn't get much clue.

This are the dependencies used.

"@sap-cloud-sdk/core": "1.54.2", "@sap-cloud-sdk/http-client": "2.9.0", "@sap/cds": "6.1.3", "cds version "@sap/cds-odata-v2-adapter-proxy": "1.9.10", "@sap/hana-client": "^2.8.22", "passport": "^0.6.0"
Ranjith
Participant
0 Kudos

Hello,

I'm also facing the same issue. is there any solution?

Is it not supported because of the oData Version. In my case also it is V2?

Thanks,

Ranjithkumar

sujitsingh5191
Explorer
0 Kudos

ranjith13119-gmail.com You can go for CQN queries in CAP to achieve this. But CQN queries do not support contains if filter so that's another issue.

Ex:

results = await master.run( SELECT.from(TAB) .where(queryWhere) .columns([ "ABC", "XYZ"
])

);

you need to form the dynamic columns from the $select coming from request path

Accepted Solutions (0)

Answers (2)

Answers (2)

sujitsingh5191
Explorer
0 Kudos

pavangolesar This will work but the columns need to be fetched dynamically, hence it requires a $select.

Pavan_Golesar
Active Participant
0 Kudos

sujitsingh5191 Check if this answer from Ravi helps! group by syntax does not work in inner join statement | SAP Community

sujitsingh5191
Explorer
0 Kudos

No Pavan it doesn't help and I am stuck in CAP, the $select is coming as $apply and I am getting the response as 'Feature not supported: SELECT statement with .groupBy' when calling the API

Pavan_Golesar
Active Participant
0 Kudos

Hi sujitsingh5191,

The error seems to be talking on $select usage hence check below if works.

Try using below (trimmed) URL, the only difference is that it won't restrict the total columns/fields in output but should work ideally:

v2/PlanningData/TSINH1?$filter=UOMTOID eq 'EA'&$format=json⊤=100

Hope it works as expected 🙂

Pavan Golesar