SAP Knowledge Base Article - Public

2768749 - Termination Date excluded in calculation for Number of Months in Termination Rule

Symptom

Get Number Of Months From Start Date Until End Date() rule function excludes termination date in number of months calculation of Termination rule

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 - All versions
  • SAP SuccessFactors Employee Central Time Off

Reproducing the Issue

1. Configure termination rule where accrual is calculated based on number of months that the employee is going to work before his/her last day in the company using Get Number of Months from Start Date until End Date() rule function.

terminationRule.png

2. Go to Manage Time Off Structures > Time Account Type then assign the rule under Termination Rule by making a correction on the configuration.

TimeAccountType.png

3. On People Profile > Time Off section, click on Administer Time link then go to Time Accounts tab to check existing accrual postings of Additional Leave (NL) time account. Existing accrual for the account is 28 days.

TimeAccount_AddtlLeaveNL.png

4. In People Profile, click Actions button > Terminate action, set termination date of employee on May 31,2019 then select a Termination Reason. Time Account Balance as of Termination Date section shows recalculated balance for Addditional Leave (NL) time account as 9.5 days. Click Save.

TerminateAccrualBalance.png

5. Go to Time Accounts tab in Workbench then check the time account postings for the Additional Leave (NL) time account. Existing accrual is recalculated from 28 days to 9.5 days.

TimeAccountRecalculedAccrual.png

Expectation is that number of months calculation should return 5 months (January 1, 2019 - May 31, 2019), therefore, calculation should be (5 x 2.33) x 2 / 2 = (11.65 x 2) / 2 = 23.3 / 2 = 11.65 days ~ 12 days. 

However, the rule function does not include the termination date itself during the calculation of number of months using the Get Number of Months from Start Date until End Date function, as it only return 4 months, resulting to 9.5 days.

RuleTrace1.png

Cause

The rule function is working as designed.

Get Number Of Months From Start Date Until End Date() function determines the number of months between two given dates with end date excluded from calculation, hence, period January 1, 2014 - December 31, 2014, for example, will be counted as 11 months instead of 12 months. If period is from January 1, 2014 to Jan 1, 2015, number of months will be counted 12 months. See Functions A-Z section of EC Business Rules Implementation Guide.

Resolution

To include end date in the calculation, use Date Plus() function on the End Date parameter inside Get Number Of Months From Start Date Until End Date() function and set Number of Days parameter to 1.

terminationRule_updated.png

During termination, Time Account Balance as of Termination Date for Additional Leave (NL) time account is recalculated from 28 days to 12 days.

Term2.png

After termination action, existing postings for Additional Leave (NL) time account is now recalculated with the expected amount since Number of Months calculation now includes the termination date.

AccrualPosting2.png

RuleTrace2.png

See Also

Functions A-Z - Employee Central Business Rules Implementation Guide

Keywords

Get Number Of Months From Start Date Until End Date(), Number of Months, incorrect termination calculation, incorrect termination accrual, , KBA , LOD-SF-EC-TIM , Time Off , LOD-SF-EC-RUL , DO NOT USE - Business Rules & Event Derivation , Problem

Product

SAP SuccessFactors Employee Central all versions