Symptom
- The "/rest/timemanagement/absence/v1/events" API is used to fetch data for upcoming absences, holidays, and non-working days for employees. Only PUBLIC_HOLIDAY and NON_WORKING_DAY data are being fetched, ABSENCE data is not retrieved despite the employee having multiple absences during the query period.
- Only the top 10 records are being fetched by the API.
Disclaimer: Image/data in this KBA is from SAP internal systems, sample data, or demo systems. Any resemblance to real data is purely coincidental.
Environment
- SAP SuccessFactors HXM Suite
- API & Adhoc API Framework
- REST API
- API & Adhoc API Framework
Reproducing the Issue
- Run the API query: https:/<api-url>/rest/timemanagement/absence/v1/events?assignmentId=*****&types=ABSENCE,PUBLIC_HOLIDAY,NON_WORKING_DAY&startDate=2024-01-01&endDate=2024-12-31
- Only the top 10 records are visible, although there are more than 10 records.
Cause
Without the $top parameter, by default, the object will fetch only the top 10 records.
Resolution
- To fetch more than 10 records, use the $top parameter.
Eg: https:/<api-url>/rest/timemanagement/absence/v1/events?assignmentId=******&types=ABSENCE,PUBLIC_HOLIDAY,NON_WORKING_DAY&startDate=2024-01-01&endDate=2024-12-31&$top=50 - In one API call, a maximum top 50 records can be fetched.
- To fetch the next 50 events, make use of the $skip parameter, for example, $top=50&$skip=50 (to fetch records between 50-100) and so on.
See Also
Keywords
SuccessFactors, Timeoff, API, ABSENCE, PUBLIC_HOLIDAY, NON_WORKING_DAY, $top parameter, $skip parameter, fetch records, REST API, Upcoming Time Off, Holidays, Non-Working Days, maximum 10 records. , KBA , LOD-SF-INT-API , API & Adhoc API Framework , Problem
Product
SAP SuccessFactors HCM Core 2511 ; SAP SuccessFactors HCM Suite 2511
SAP Knowledge Base Article - Public