SAP Knowledge Base Article - Public

3483593 - OData API query returning unexpected results when using $top parameter


When querying SuccessFactors data using OData API and $top parameter, the $top is not being respected.

For example, you are using $top=10 but the query is retrieving only 1 record, even existing more.


SAP SuccessFactors HXM Suite

Reproducing the Issue

This issue only occurs in a very specific scenario:

  • Deep filtering is being used with one-to-many navigation between the entities involved (e.g. $filter=otherEntityNav/otherEntityField eq 'X');
  • AND Client-side pagination is being applied on the top (e.g. $skip=100&$top=10);


This is a limitation of OData API for this specific scenario.


There are two possible workarounds:

  1. Adapt you query to not use one of the mentioned conditions (deep filtering, one-to-many navigation, client-side pagination);
  2. OR Use server-side pagination, specifically the Snapshot-Based one, where all the pages are retrieved and then displayed (instructions in the Snapshot-Based Pagination chapter);
    OBS.: It's possible to retrieve $top records using Server-side pagination using customPageSize=X parameter, however, if the first page is called multiple times without calling the following pages, a security measure will block the user. This is explained in detail in the KBA 2749091;


OData, API, query, get, retrieves, returns, retrieving, returning, unexpected, undesired, wrong, incorrect, results, response, records, $top, $skip, top, skip, server, client, side, pagination , KBA , LOD-SF-INT-ODATA , OData API Framework , Problem


SAP SuccessFactors HCM suite all versions