SAP Knowledge Base Article - Public

2675265 - OData API: Using the $top and $skip tokens


In this document we will review the '$top' and '$skip' tokens in the context of constructing OData API Query structures.

Occasionally when running OData API queries, you do not always retreive the number of records you are expecting. For example, you are querying the EmployeeTime records for an employee. This employee has 5 EmployeeTime records, but the query is only returning 1 record.


  • BizX
  • OData API

Reproducing the Issue

1. Create a query - EmployeeTime as an example as REQUEST:$select=externalCode,userId,startDate,endDate,cust_StartTime,cust_EndTime,approvalStatus&$filter=lastModifiedDateTime%20ge%20datetimeoffset%XXXXXX-XX-XXTXX:XX:XXZ


  You are not getting the number of records expected.


  • For the query there's more than one page data to be returned.
  • For each page, the maximum page size is 1000.
  • Please use $top and $skip token to fetch the pages of data.


The $top Keyword:



   The first 5 User Entries are returned where the Collection of User Entries are sorted using a schema determined by the OData service.

The $skip Keyword:



   The set of proxy Entries (associated with the User Entry identified by key value 1) starting with the third User.

Query with $top and $skip:

      Using the $top and $skip options together in a request URI creates a pagination query. The response is a subset of the whole result, from $skip to $top. $skip indicates the starting row for the query. $top limits the size of the query.

   For example, if the URI uses $top=50, $skip=20, the response is a subset from numbers 21 to number 70 of the whole result set.

EmployeeTime with $top and $skip tokens example:  

   For example, to fetch the second page with 1000 records:$select=externalCode,userId,startDate,endDate,cust_StartTime,cust_EndTime,approvalStatus&$filter=lastModifiedDateTime%20ge%20datetimeoffset%XXXXXX-XX-XXTXX:XX:XXZ%XX&$top=1000&$skip=1000

See Also

SAP SuccessFactors HCM Suite OData API: Developer Guide:


  • OData API
  • $top
  • $skip
, KBA , LOD-SF-INT-ODATA , OData API Framework , LOD-SF-INT , Integrations , How To


SAP SuccessFactors HCM Core 1805