Skip to Content
Technical Articles
Author's profile photo jaideep shetty

EC Time Off – Time Type Independent of Work Schedule

Overview

This blog post will provide an overview on building a time type which is independent from the work schedule assigned to the employee.
A time type which can exclude weekends and public holidays.
As per the current available SuccessFactors features, certain limitations are restricting in developing a time type which counts only weekdays excluding the weekends and public holidays. This should work irrespective of the work schedule.

Problem

Example:
If employees work schedule is 15 days working and 15 days off.
With available feature we would go with creation of time type with below parameters:
Duration Display According To = ‘Deduction Quantity’
Counting Method = Custom (this will exclude weekend and holidays)
Requesting on Non-Working Days Allowed = Yes
This would work fine in case if there are no absence validation rules.
As soon as we use an absence validation rules, where the time type should not be able to request time off less that 4 days. The rules behavior does not satisfy our requirement.

Example:
If employee applies for leave from Monday to Sunday on a Non-Working day, the validation rule fails.
Reason:  when we submit the leave request in the non-working days as per work schedule.
The EmployeeTime.NumberOfDays returns Zero instead of the number of days we selected in leave request. (when Requesting on Non-Working Days Allowed = No)
The EmployeeTime.NumberOfDays returns 7 instead of just weekdays. (when Requesting on Non-Working Days Allowed = Yes)
Hence the validation fails.

If we use rule function GetNumberOfCalendarDaysForPeriod() this return all days including weekends between start date and end date and there is no function to subtract weekends.
The available rule functions either return zero, work schedule days or calendar days.
Also we do not have the flexibility to SET EmployeeTime.NumberOfDays using the business rule.

Another limitation is, the ‘deduction quantity’ and ‘counting method’ cannot be used for time types without posting rules.

What is a way to achieve this requirement until SuccessFactors releases a standard solution?

  1. FOR TIME TYPE WITH POSTING RULES

Create Time type with below parameters-
Duration Display According To = ‘Deduction Quantity’
Counting Method = Custom (this will exclude weekend and holidays)
Requesting on Non-Working Days Allowed = Yes
Posting Priority = Post to time accounts by posting rules only

How to build a rule?

Assume, if we want to apply a rule where employee cannot request this time type for less than or equal 4 days.
The normal rule will fetch employeetime.numberofdays = all calendar days(including public holidays) since we have enabled requesting on non-working days.
If it was disabled, employeetime.NumberOfDays will return Zero.
Hence, we need to find a way to overcome this restriction.

Below is the way I did it.
I decided to use the below logic in rule.
If NumberOfCalendarDaysForPeriod – (NumberOfHolidaysForPeriod + NumberOfWeekendsForPeriod ) <=  4 days

SuccessFactors has already provided us with function NumberOfCalendarDaysForPeriod()  and NumberOfHolidaysForPeriod() but there is no function to count the number of weekends.
Therefore, I developed a lookup object WeekendCountLookUp table which counts number of weekends between a period.

For this it required 3 columns.
DayOfWeek
NumberOfCalendarDays
NumberOfWeekends

Day of week is to find out which day of the week the start date of request falls. Based on that primary parameter and number of calendar days, we could count the number of weekends between that period.
Below is the sample of table entry for when Start date falls on Monday i.e. DayOfWeek = 1.

*Find the complete import file of lookup object for the upload here.


Similarly, we would import entry for all DayOfWeek from Monday to Sunday for 365 days.

Therefore the table will have 365*7 = 2555 entries.

Finally, the rule will be

Now the above method will help us for the time type having posting rules.

         2. FOR TIME TYPE WITH POSTING RULES

In this case, we must create a new dummy time account type.
I created a time account type named OTHER (Other Leaves)

The accrual will always be zero for this time account and keep the Balance Cannot Fall Below as -50 or -100 or -200 as per the requirements up to you.
Assign this time account type in to the time types in posting rules.

Now use the same logic as the one used for time types with posting rules as explained above.

Conclusion

Please highlight if you find any flaw or loophole in the above solution.
Also please vote the below improvement idea in case you believe a standard solution is required for this problem.
https://influence.sap.com/sap/ino/#/idea/235049

Thank you. Have a Good day.

 

Assigned Tags

      7 Comments
      You must be Logged on to comment or reply to a post.
      Author's profile photo baladeba behera
      baladeba behera

      Nice ..

      Author's profile photo VijeyAananth SR
      VijeyAananth SR

      Good One !!

      Author's profile photo Joao Pinto
      Joao Pinto

      Hello jaideep shetty,

      During the article you placed a link that directs us to Enhancement Request / Idea / Improvement no. 235049.

      I was wondering if it was you who created it, or at least if you know who did it, because it is with "Need More Info" Status as the Coach Frans Smolders left a question there asking if the Author had considered to use "Calendar Days" option on "Duration Display According to" field.

      It is clear the assigned Coach did not completely understand the issue there, as "Calendar Days" will consider both Weekends & Holidays. The new Time Type is not supposed to consider them.

      As it is said on Example no. 3 of "Implementing Employee Central Time Management" SAP Implementation Guide,

      • «Example 3: If you choose deduction quantity and define an absence counting method with calculation based on calendar days where Monday to Saturday count, 6 days are displayed.»

      When in our scenario based on what we want/need, 5 days should be displayed.

      Thank you in advance.

      Best regards,

      Author's profile photo jaideep shetty
      jaideep shetty
      Blog Post Author

      Hi Joao Pinto ,

      Yes It is me who raised that improvement request. I delivered the requirement of client by a custom solution as explained in the document attached in the same request.

      But yes, if SAP provides the flexibility of having Time types independent of work schedule, the same will help many different requirements put forth by clients

      Thank you,

      Jaideep Shetty

      Author's profile photo Shikha Agrawal Sah
      Shikha Agrawal Sah

      Hi Jaideep,

       

      Nice blog

      I have a query:

      How to create accrual rule based on scenario:

      *Working days = No. of days in month - weekend - public holidays/16

      then rounding off the figure.

       

      Please help.

       

      Thanks

      Author's profile photo Evangelia Panagiotou
      Evangelia Panagiotou

      Hi Jaideep, I am reading your article and I find very interesting the different perspectives that people may have on designing something on Time Management. That is why I love this module!!

      Just some for thought - maybe you could develop something even easier, without the need to have the massive lookup table, which you most probably need to update every year.

      If you use the two functions: Get Number of Calendar Days - Get Number Of Working Days Or Hours For Period() (inc. Holidays) --> you should get the number of Non Working Days, which should be the weekends!

      BR,

      Evangelia

      Author's profile photo jaideep shetty
      jaideep shetty
      Blog Post Author

      Thanks Evangelia.

      Of course deriving new solution for tricky requirement is always fun 🙂

      I am not sure whether I have thought of this logic or may be the rule functions were not available back in 2019, but yeah your suggested solution might work just fine.