Skip to Content

Issue while using $ count and $select at a time

Hi All,

I have to use $count and $ select at time and the URI look's like below.

/EnitytSet(ZVAR_DATE_RAG='',ZVAR_DATE_RAGTo='')/Results/$count?$SELECT=DOCNUMBER,Property2,property3

But I am getting an error

System query options '$expand,$format,$skiptoken,$inlinecount,$select' are not allowed in the requested URI

Regards

Viswa

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Apr 12 at 08:45 AM

    Hi viswateja talupula,

    I am not sure about the error, maybe SAP is not supporting that query based on the error. It makes sense as If you want to see the count using the $count option, why we need to pass the select? as we are not fetching the data.

    So even in the SAP UI5, if you using the request count SAP will send 2 requests, one with count and one with select like below:

    ....
    GET Orders/$count
    ....
    ....
    GET Orders?$skip=0&$top=25&$select=OrderID
    ....

    But what if you want to select the data and count in the same request, then you need to use inline count option. like below:

    https://services.odata.org/V2/Northwind/Northwind.svc/Categories?$select=CategoryID&$inlinecount=allpages

    BR,

    Mahesh

    Add comment
    10|10000 characters needed characters exceeded