Skip to Content
Technical Articles
Author's profile photo Parthiban Sukumar

Employee Central Time-Off : How to solve Mandatory block leave scenario (Blog 1/2)

Hello readers,

Firstly, thanks to Neelesh Kamath  for a great partnership (since 2018) in brainstorming ideas to resolve various issue and especially this Mandatory Block Leave scenario. We discovered a lot more interesting aspect of EC Time capability.

Secondly, this is just the core idea on how to solve the famous “Mandatory Block Leave” scenario. Each customer can use this core logic to build their own use case around it. The solution is flexible 🙂

Lastly to keep the interest in reading, I have logically split the solution into two parts:

  1. Block leave absence management (this blog)
  2. Block leave alert management – https://blogs.sap.com/2021/02/15/employee-central-time-off-how-to-solve-mandatory-block-leave-scenario-blog-2-2/

The solution is simple and automatic. We will also try to deliver this as part of Best Practice so that customers can simply download this solution rather than setting it up.  Click here to know more on Best Practice solution

Global mandatory block leave scenario:

Many organisations especially from financial sector have a policy that mandates their employee to take at least 2 weeks of mandatory block leave each year. The leave block needs to be continuous 14 days (2 weeks) and can constitute one or many absences. This can also include public holiday in between absences. As long as the employee doesn’t come to office for 14 days in block at least once a year, that’s adherence to compliance policy.

Scope of this solution proposed in this blog:

  • Allows customer to choose any type of absence w.r.t duration – Days or Hour or both combined
  • Allows customer to choose any type of absence w.r.t account – Leaves with and without quota.
  • Automatically adjust the block leave balance if the employee cancels one or multiple absence that formed a block leave post approval.
  • Automatic notification to employees who have not taken mandatory block leave to take one.
  • No manual admin maintenance required once the setup is done.
  • Allows employee to take or cancel absence is any order or in any period gap.
  • People Analytics dashboard to show how many have taken and/or not taken with percentage coverage and chart is possible. However, this is not covered in this blog as the idea is to only solve the issue and reports can be created by consultants based on the customer’s requirement. Goal here is to tell that the necessary data for dashboard is available with this solution.

Nudge your employees to take mandatory block leave like this ! Send “alert” emails ! Be compliant 🙂

Quick dismissals for other generic solutions that might be as below:

  • Solution 1: Some might solution that by asking employee to update a “custom field or conditional field” in Time Type object e.g., “Mandatory Block Leave” when creating an absence and run a report for to see if employees are missing block leave at regular intervals.
  • Con: Firstly, employees using mobile for taking absence will not have conditional or custom field available to choose. Secondly, you cannot expect all employee to be aware of using such fields based on a logic (e.g., use it only for continuous absence, make sure to string absences to cumulate 14 days in case of multiple absences or choose a start date exactly after previous absence end date even though it’s a weekend etc). There is ton of options to make mistake here and lastly there is no alert to employee to take such leave unless an admin runs a report and send manual email notification.
  • Solution 2: Some create a time type called “Mandatory Block Leave” and add Time Accounts that are eligible for block leave. Then make sure every employee creates this Time Type in a year.
  • Con: Employees will only have account based absence types and cannot choose the deduction amount for multiple absences. This is not the expectation in most organisations.

So, let’s see how we can achieve the optimum solution.

Block leave absence management

Step 1: Create a “block leave counter” in object EmployeeTime

This is automatically filled so no need for employee intervention in any manner. In fact, you can hide this field to avoid confusion with employee, however, in this blog I will keep it visible for better explanation.

Create custom field (e.g.) BlockLeaveCounter as Number in object “EmployeeTime”.

Step 2:  Create “onSave” rule in EmployeeTime object

The below rule updates the “BlockLeaveCounter” with number of absent days (in calendar days) and will include any previous leave taken without any gap, including holidays in between.

Don’t worry about the vice versa logic of what happens if there is an absence immediately after current end date as we are only querying previous balance – this is handled automatically in step3 😉

 

 

Step 3:   Integration Center (IC) to keep EmployeeTime object updated

This is the key setup in this solution which keeps tab of absence taken in different order, changes made post approval and any cancellations scenarios to keep block leave counter correct. The idea is to execute the above ‘onSave’ rule on regular interval to track for any changes and update the counter balance automatically.

Go to Admin Center -> Integration Center (IC) -> Create -> Choose “More Integration Types”

Choose the options as show in the screenshot below:

Choose the EmployeeTime as “source”.

Give some name that you can identify.

In the below step, “target” is also EmployeeTime. Idea is to re-run the rule regularly to see for changes done by employee. Use + button to choose the target.

Drag the External Code field from target to source. Save it.

Choose Next and setup the filter

Schedule this integration to run regularly based on your business need. Note that this is the frequency in which your block leave counter is kept correct in case of any changes done by employee post approval or creating of absences in different order (non-sequential creation) or for that matter any changes.

Important to note:

May be you can run EmployeeTime IC every week, preferably on weekends when system usage is minimal. Remember we have used “lookup” of EmployeeTime object in the onSave rule which effectively being re-run by this IC execution for all eligible employees. The rule is written mindful of performance; however, I still would recommend exercising caution on how often you want to run the IC. Decide based on your need.

Save and Schedule the Integration Center.

Now this completes the 1st part of the solution. Now let’s test it.

 

This is a perfect world scenario, now let’s assume the employee cancels one of the leave. E.g., in the above example, the sick leave is cancelled.

Now lets look at Military leave which had 14 days earlier. It is still 14 which is wrong and this is where out Integration Center comes to rescue.

This is where the IC comes to rescue; execute the IC created. In real world, all this happens on the background (e.g. weekly job)

Now the counter has been reset by the IC to 4 days because now there is gap as the continuous leave was broken in between.

Now let’s test a bit further, now I re-instate the sick leave that we cancelled. Now the first two leaves are considered and cumulative is showing 10 days until sick leave.

But the 3rd leave has not counted as it was reset to 4 while the IC was run the first time.

Now lets run the IC again to see if it re-instates the total counter back to 14.

Counter is re-calculated

 

Considering the length of this blog, I’m not adding all the scenarios but it has been tested for variations like reducing the number of days after approval, combing time types with hours and days (the rule reads only start date & end date and hence will consider 40 hours as 5 days) and much more. Customise the rule based on your needs.

With this data you can already run reports to see employees who have not taken a block of 10 or 14 calendar days. However, all of this is also automated :).

Now comes the part 2 of the solution – https://blogs.sap.com/2021/02/15/employee-central-time-off-how-to-solve-mandatory-block-leave-scenario-blog-2-2/

Assigned tags

      4 Comments
      You must be Logged on to comment or reply to a post.
      Author's profile photo Chithra Harihara
      Chithra Harihara

      Hi Prathiban,

      Thank you for sharing this solution. 🙂

      Can we add this integrations to run through Employee Time -Intelligent services to make this a real time activity rather than scheduled jobs? Is there any limitation for this?

      Author's profile photo Parthiban Sukumar
      Parthiban Sukumar
      Blog Post Author

      Hi Chithra,

       

      Technically feasible, yes, but its not good for performance. Imagine running the full IC every time an employee changes something. You cannot set a dynamic filter in IC and even so, running IC multiple times in a day is not a good idea.

      Author's profile photo Volker Ruof
      Volker Ruof

      Thanks a lot Parthiban - this will serve many customers and from a solutioning point of view this is close to brilliancy.

      Volker

      Author's profile photo Parthiban Sukumar
      Parthiban Sukumar
      Blog Post Author

      Vielen Dank Volker ! 🙂