SAP Knowledge Base Article - Public

2767202 - OData Query Doesn't Fetch all the Records

Symptom

You are trying to fetch data using an OData service, for example:

https://myxxxxx.crm.ondemand.com/sap/c4c/odata/v1/c4codataapi/AppointmentCollection

You don't find all records in the result.

Environment

SAP Cloud for Customer

Reproducing the Issue

Run an OData query for any object, for example Product for which e.g. 10000 products exist in the system. You will find only 1000 product records being fetched.

Cause

An OData query without any filter fetches only 1000 records.

Resolution

Please use a filter like $top = 10000 in this case to bring all the records.

For example:

https://myxxxxx.crm.ondemand.com/sap/c4c/odata/v1/c4codataapi/AppointmentCollection?$top=10  will fetch 10 records.

https://myxxxxx.crm.ondemand.com/sap/c4c/odata/v1/c4codataapi/AppointmentCollection?$top=50000 will fetch 50000 records.

See Also

2330688 - How to Use Methods And Filters in OData Services

Keywords

ODATA, Custom Odata, Query without filters, Odata query gives maximum 1000 entries , KBA , AP-RC-ODF , OData framework (C4C Only) , Problem

Product

SAP Cloud for Customer add-ins all versions