SAP Knowledge Base Article - Public

2914686 - How to perform RFL (Return From Leave) using OData API

Symptom

You have an employee which has one or more LOA (Leave of Absence) records.

Due to this, the Employee Status was set to "Unpaid Leave", as shown below:

You want to make the Return From Leave of this employee via API, in order to update his Employee Status back to "Active".

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


    • OData API

Cause

This sample employee has 4 LOA records:

You need to end them in order to make his Employee Status go to Active again.

Resolution

Each one of those LOA records are objects under EmployeeTime OData entity. Each one has an externalCode.

To perform the RFL and make the employee Active again, you need to end its latest LOA record (the most recent one). In the previous employee sample, it would be the one with Start Date = Mar 20, 2020.

To end that record, you need to update the following fields in the EmployeeTime object:

"loaExpectedReturnDate": "/Date(1586736000000)/",
"endDate": "/Date(1586736000000)/",
"loaActualReturnDate": "/Date(1586822400000)/"

The value of "loaActualReturnDate" needs to be one day after the values of "endDate" and "loaExpectedReturnDate" so it can work properly.

If the value passed is a valid date (a non-future date at moment that the API call is sent), the LOA record will be ended and employee will return to "Active" status:

Note that you have to Upsert these values in the latest LOA record, hence you need to refer its externalCode in the Upsert payload.

See Also

SAP SuccessFactors HCM Suite OData API: Developer Guide

Keywords

loa, rfl, return from leave, leave of absence, time off, EmployeeTime, Employee Time, odata, api, call, successfactors, success factors, upsert, back to work, job history, job info,  , KBA , LOD-SF-INT-EC , Employee Central SFAPI & OData Entities , LOD-SF-INT , Integrations , How To

Product

SAP SuccessFactors HCM suite all versions