Product Information
Converting Allowance to Time Off in Lieu (TOIL) in SuccessFactors Time Management
Background
We have heard of a very common requirement where an employee works on a public holiday, and this needs to be converted to TOIL. We all know this can be achieved in current times.
But what if we have a twist to this story? There are companies where they request employees to record this special overtime on public holidays as allowances (Decimal value). The decimal value then needs to be converted to hours in a TOIL Account. Have you ever wondered if this can be achieved? Currently, there is no direct way of moving Allowance to TOIL or a standard setting to do so.
I would be demonstrating a process that can be used as a workaround to move the allowances recorded in a timesheet as time account balances.
Approach
This is the high-level approach to this solution
- Introduce two custom fields in the Allowances MDF Object : User and allowance amount to be moved to TOIL. We need to store the user again because the allowance is a child object of employee timesheet object. Hence we would need to know the user details of each such allowance recording when moving them to TOIL
- Make the user field in the employee timesheet MDF Object from not visible to read-only.
- Adhoc Time Account type to handle multiple TOIL
- Integration Center to Map allowance fields (including custom user field created in the first step) to an Adhoc TOIL Account
- The Integration Center job can be scheduled on a daily basis to move these allowance hours
Please note we will use a similar Integration Center approach to Multiple TOIL which was discussed in one of the previous blogs.
For reference, you can read through here
https://blogs.sap.com/2021/04/30/employee-central-time-off-multiple-time-off-in-lieu-toil-solution/
We will use the below sample requirement to demonstrate the approach
At a company, ABC people can select if they work on a specific public holiday to get an 8 or 16hrs added to their TOIL/Flextime account. And because people can decide for themselves, and because the account amount is fixed, (8 or 16hrs) you want to handle this via Allowances.
This means that:
- if employees record an Allowance with a 1 in the time sheet, that we transform/convert this via the Integration Center into an 8hr TOIL account update
- If employees record a 2 that they then get 16hrs added and so On
Hope this is clear
Now to next steps one by One
Custom Fields in Allowance Object
- The cust_user stores the user details from parent object Employee time sheet
- Cust_AllowanceAmountToil stores the actual hours to be credited to Adhoc TOIL account
User Field in Employee Time Sheet Object
Make the user field in employee time sheet object as ‘read only’ from ‘not visible’
On Save Rule on Allowance Object
Next create a onSave rule which stores the values of these two custom fields. The onSave rule is attached to Allowance MDF Object
Allowance Time Account (Adhoc Toil Account)
Create an Adhoc account for storing the TOIL Hours
Integration Center
Create an SF to SF OData integration center definition.
The starting entity would be Allowance
And target entity would be Time Account
The mapping is similar to the process defined in (Multiple TOIL blog shared above)
There are subtle differences like
The external code for time account and details both is calculated like the below
Account Valid Start and End Date should be mapped to Allowance Date
Booking Start Date is also mapped to Allowance Date
Cust_user field from allowance is mapped to user field of time account
Cust_AllowanceAmountToil is mapped to bookingAmount field
Booking End Date is calculated field which can be set to say Allowance Date + 12 months for example. It is quite flexible. You can decide booking end date based on your requirement
Rest of the mappings are like the ones mentioned in multiple TOIL blog.
I will add a payload for your reference here.
[
{
"entityName": "TimeAccount",
"payload": [
{
"externalCode": "Jgoh2023-07-24EXTRA",
"accountType": "FLEX_ALLOW_MY",
"bookingEndDate": "/Date(1721779200000)/",
"bookingStartDate": "/Date(1690156800000)/",
"endDate": "/Date(1690156800000)/",
"startDate": "/Date(1690156800000)/",
"userId": "Jgoh",
"timeAccountDetails": [
{
"TimeAccount_externalCode": "Jgoh2023-07-24EXTRA",
"externalCode": "Jgoh2023-07-24EXTRA",
"bookingAmount": 16,
"bookingDate": "/Date(1690156800000)/",
"bookingType": "INTERIM_UPDATE",
"bookingUnit": "HOURS",
"__metadata": {
"type": "SFOData.TimeAccountDetail",
"uri": "TimeAccountDetail(TimeAccount_externalCode='Jgoh2023-07-24EXTRA',externalCode='Jgoh2023-07-24EXTRA')"
}
}
],
You would then need to add appropriate filters to ensure that only special allowances are picked up by the IC job and not all allowances.
Also you need to add last modified since filter to pick only recently modified records
This is it w.r.t the configurations. Now let us test some scenarios
Testing
Let’s say then you run the Integration Center job.
This would then translate into appropriate Adhoc Toil Accounts
Just some things to note about:
- In the end, this is a workaround solution. Please do not expect 100% fitment as standard.
- If someone deletes an allowance after it is credited to Adhoc Account, then it would need a manual intervention from admin to clean up that account. This scenario might not be very common though.
- Please do your own analysis before recommending this solution to customers. Test them with your use cases.
- This solution only works for special allowances type which are recorded not so often. Ex: Special occasions, Holidays, etc. If you create this solution for each allowance type, this will lead to a plethora of Adhoc time accounts. So please only do this for special allowances. I would not recommend this approach for daily use cases of allowances
Best of Luck
Neelesh
Hi
Excellent blog. The question I have is if it is possible, when inserting working time, the system automatically creates the allowance in the timesheet and if there is a way, when inserting the allowance in the timesheet, if it is possible to integrate directly into the one time payment
Thanks
I think the first part may not be possible . The second one i.e Mapping allowance to one time payment should be possible using Integration center.. Similar to this one..you can have allowance as starting entity and one time payment as the target entity and map the fields..You can try that
Hi Neelesh,
Thanks for sharing excellent blog. Question I have here is can't we use permanent time account rather than creating multiple adhoc time accounts for a single user?
Thanks,
Foram Gandhi
Hi Foram
Thanks for the feedback
Yes ideally we can deal with this using Permanent Accounts but there is no way currently in IC to know what is the external code for existing permanent accounts for an employee. The IC would not be able to fetch the correct permanent account for the employee
hence in my logic, I create a new ad-hoc time account with a predetermined external code always
But I will research a bit if it is possible to use permanent accounts for this. If I find a way I will update the blog
Also considering that this is only for special holidays which on Avg can be 8-12 in year, the number of adhoc accounts would be way less compared to daily use cases.. And you can have PEP rule to adhoc accounts to close them out after a certain period
Hi Neelesh,
Thanks again for coming up with yet another excellent blog. Have a question here, time account we are creating here is adhoc and bookable period timeframe is for one year. PEP rule can close those time accounts if the bookable period end date is today or less than today.
Requirement here is to close the time account on daily basis if the balance is zero. Can PEP rule still handle our requirement. If not any other way we can achieve this.
Thanks,
Sriram
Hi Sriram
Thanks for the feedback.
For your requirement, you can schedule an Intermin update rule on a daily basis from "Manage time off calendars" . In the rule you can check the balance and close the account if the balance is zero..
You can try the above
Having said above, I dont think this should matter much. As balance is zero anways, the employees cannot book from this account. It will just show up in the UI in time account workbench
Hi Neelesh,
Thanks for your reply, we indeed tried closing it via interim update rule, but unfortunately it is not closing as per our below configuration.
Thanks,
Sriram