SAP Knowledge Base Article - Public

2863033 - Time Off Rule Function Related Errors When Start Date Is After End date

Symptom

Time Off rule functions like below raises error if Start date is greater than End date.

  • Get Number of Calendar Days() 
  • Get Number Of Working Days Or Hours For Period()

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 Employee Central -  Time Off

Reproducing the Issue

1. Time off rule function (Eg: Get Number of Calendar Days()) is configured as shown in the screenshot.

Get Calendar Days.png

2. When the rule is processed, if the rule function retrieves Start Date & End Date where the value of Start Date is greater than End Date, then it throws errors such as:

  • "getCalendarDays: Error happened when invoking rule function: getCalendarDays, root cause: Start Date <> is after End Date <>" OR
  • "Error executing rule <Rule Name> - numberofWorkingdaysForPeriod: Error happened when invoking rule function: numberofWorkingdaysForPeriod, root cause: Rule function numberofWorkingdaysForPeriod start date after end date. Please check rule definition."

Resolution

  • The function(s) will throw a validation error when Start Date is greater than End Date during rule execution.
  • The existing rules will need to be modified to accomodate this validation if there is a possibility of start date being greater than end date. Therefore, add an IF condition to the rule to check if End Date is on or after the Start Date. Refer example screenshot:

additional check in rule.png

Keywords

Time Off, take rule, TMRE, Time Management Recalculation Event, recalculation, numberofworkingdays, Get Number Of Working Days Or Hours For Period, Get Number of Calendar Days, getCalendarDays, TIM-10774, Error executing rule, the start date is, after end date, start date after end date, Please check rule definition , KBA , LOD-SF-EC-TIM-RUL , TAT Rules, Validation & Take rules , Problem

Product

SAP SuccessFactors Employee Central all versions