cancel
Showing results for 
Search instead for 
Did you mean: 

Sap OData $count not return correct number of rows

zhanyu2023
Explorer
0 Kudos

Sap OData $count API should return number of all rows in sap table. I tried with $count api but get wrong number of count.

I have a big sap table with 23.803.107 rows of data. When I call api to $count, only 50339 returned instead of 23.803.107.

I look into the odqmon and find below img. my table seems dived into 473 unit, 472*50339+43099=23.803.107.

So is there any problem with $count api? how can I get total number of rows(23.803.107) instead of single unit(50339).

junwu
Active Contributor
0 Kudos

what is count api? never heard....

Accepted Solutions (0)

Answers (3)

Answers (3)

zhanyu2023
Explorer
0 Kudos

jun.wu5, thank you to give related support and help.

Today we build OData Service against SAP ODP (https://techcommunity.microsoft.com/t5/azure-synapse-analytics-blog/extracting-sap-data-using-odata-...), so we cannot follow https://blogs.sap.com/2017/12/06/display-countfilterorderbyinlinecounttop-and-skip-operations-using-... to set/write related function ($count, $top...) in SAP server.

$count, $top... can only work in None-ODP-OData-Service, right? Could we support them in ODP-OData-Service? If yes, could you give detailed guidance?

Thanks for your time and help.

junwu
Active Contributor
0 Kudos

/sap/opu/odata/sap/ZSBOOK_ODP_SRV/FactsOfZSBOOKODP/$count

it is count request,

you have to do the counting in your odata service.

select count(*) into *** from ***

https://blogs.sap.com/2017/12/06/display-countfilterorderbyinlinecounttop-and-skip-operations-using-...

zhanyu2023
Explorer
0 Kudos

jun.wu5 , recently we follow SAP public doc to use OData as protocol to extract data from SAP server side. Here we want to get the total row number, but $count does not work as expect when it is big SAP table. Could you guide us how to solve the issue?

/sap/opu/odata/sap/ZSBOOK_ODP_SRV/FactsOfZSBOOKODP/$count

Thanks for your time and help.