Seniority calculation based on “Calculation Process” functionality for Absence Quota Generation via time evaluation
I had personally encountered issues while doing the implementation for the client. This seems to be the most common issue where the correct absence quota number [via time evaluation] was not generated at the seniority date, if the seniority date maintained in the date specifications infotype is before the hire date.
The most common solution is to attach a day balance to the base entitlement rule in the selection rule section of the table T559L and once the seniority date is arrived, push the seniority entitlement hrs/days to this day balance. This is then passed on to the QUOTA function and the accrual is processed as per the requirement.
In this document, I have briefed the SAP standard solution to address the requirement [This answers my query posted in the forum earlier – Leap year]. Without any further delay, let us move forward.
Client had 3 different types of leave quotas (Annual Leave Quota, Statutory Leave Quota and Sick Leave Quota) and they had different conditions under which they accrue. But for the scope of this document, I have restricted myself to Annual leave quota grant based on the seniority date. The requirement is as below:
|Years of Service||Annual Leave (Days)|
|1st to 5th year||15|
|6th to 9th year||17|
|10th to 14th year||19|
|Since 15th year||20|
The catch here is that the service (Seniority) date is before the hire date for most of the employees.
Issue encountered during standard configuration
As per the service date (01.09.2009), the employee completes 5 years of service on 31.08.2014. Hence, effective 01.09.2014, his base entitlement should be 17 days/year (0.4645 days/day). Let us see whether the employee accrues this entitlement:
The employee’s entitlement has not changed as on 01.09.2014. Let us see below when it gets accrued & why:
Ideally, the system should have calculated the 5 year completion date as 31.08.2014. But as shown above, the 5 year completion date is calculated as 31.08.2019. The system has arrived at this date based on the first base period that is formed (01.09.2013 to 31.08.2014 i.e. 31.08.2014 + 5 = 31.08.2019). The first base period is formed based on the hire date of the employee (16.08.2014), immaterial of the seniority date type S2.
First base period formed based on hire date
In order to address the requirement, the custom solution explained in the introduction section is commonly implemented. However, we can build the solution via SAP standard configuration. Please have a glimpse of the solution section which will give you a snapshot of the SAP standard solution and the custom solution.
SAP Standard solution using Calculation Process functionality:
Similarly, the other seniority bands have been created as highlighted above:
We will have to use the calculation process functionality to build the SAP standard solution for our requirement.
Calculation process overview:
For configuration purpose, we need to adapt bottom to top approach. For easy understanding, I have taken the examples from standard definitions provided in SPRO:
1. Selection Rules
The selection rule determines which employee data is selected for the employment period calculation by the system. Each selection rule is attached to a selection class.
An Example – You want to determine how long an employee has worked at your company. The periods when the employee’s employment status is flagged as active are taken from the actions (0000) infotype. Since the data in the actions infotype may not cover the complete history of the employee, a technical entry date is to be evaluated from the date specifications infotype (0041). If such a technical entry date exists for the employee, the time interval from the technical entry date to the first personnel action entered in the system should also be included in length of service.
Two selection rules are required for our case:
– A selection rule with the status to determine the periods in the actions infotype
– A selection rule with the start date category to determine the period using the date type from the date specifications infotype and the first personnel action in the system.
2. Selection class
The selection class is a combination of selection rules that are evaluated in the same way. You use the selection class to group together these selection rules.
An Example – In the system, you can store leave balances under different absence types. If all types of leave absences are to be included in an evaluation, you must define a separate selection rule for each absence type. You can group together these selection rules in a selection class with the name leave absences. If required, you can then define an upper or lower threshold (maximum value or threshold value) for all leave absences.
3. Valuation Model
Valuation model is a combination of all the necessary selection classes. The evaluation of each selection class is also defined within the valuation model. The valuation model determines how the employee data from the individual infotype records is evaluated in the calculation of the employment period.
4. Calculation Process
A calculation process is created for calculation of an employment period.
5. Rounding rules
The valuation model specifies time data such as years, months, days and, if required, decimal days. With the help of rounding rules, you can round decimal days, days and months up or down. The system always rounds to the upper limit.
The rounding rule converts 30 days to 1 month and 12 months to 1 year. Only use a rounding rule if the calculation process is evaluated in years, months and days using the conversion rule. Otherwise, the rounding rule will generate unwanted results. If the evaluation only uses days, the rounding rule would round a result of 80 days to months, 20 days.
6. Assign Valuation Model and Rounding Rule to Process Step
The valuation model and rounding rule is assigned to calculation process or to its process steps. One can use the feature SENOR to perform a differentiated assignment of the valuation model and the rounding rule based on the employee’s organization assignment. For our requirement, the maintenance of this feature is not required.
Let us now look into the configuration steps and how we realize our requirement.
SPRO -> Personnel Management -> Personnel Administration -> Evaluation Basis -> Calculation of Employment Period -> Valuation Model -> Selection Rule -> Define Selection Rule
We will create a selection rule for choosing the start date (as service date S2). So, we will only use the start date tab and leave all the other tabs untouched.
We will use the standard selection rule ST23 as it is, for checking the employment status.
SPRO -> Personnel Management -> Personnel Administration -> Evaluation Basis -> Calculation of Employment Period -> Valuation Model -> Selection Class
Since we have a custom selection rule, we will have to create custom selection class to map our selection rules.
SPRO -> Personnel Management -> Personnel Administration -> Evaluation Basis -> Calculation of Employment Period -> Valuation Model -> Define Valuation Model
Again, we will have to create custom valuation model as we have a custom selection class and this is also applicable to further processes like creating custom calculation process and its mapping.
Mapping selection class to the valuation model
SPRO -> Personnel Management -> Personnel Administration -> Evaluation Basis -> Calculation of Employment Period -> Valuation Model -> Define Rounding Rule
We will have to use a rounding rule as our calculation process will be evaluated in years, months and days using conversion rule (you may see this in the next SPRO step). We will be using standard rounding rule as this matches our requirement.
SPRO -> Personnel Management -> Personnel Administration -> Evaluation Basis -> Calculation of Employment Period -> Calculation Process -> Define Calculation Process
SPRO -> Personnel Management -> Personnel Administration -> Evaluation Basis -> Calculation of Employment Period -> Calculation Process -> Assign Valuation Model and Rounding Rule to Process Step
Now we will map this calculation process to our base entitlement in the table T559L:
Please see below the time evaluation output:
On 31.08.2014, the employee completes 5 years of service as per the service date (01.09.2009).
On 01.09.2014, the employee enters into the 6th year of service, so the entitlement should be 17 days/year:
As on 31.08.2018, the employee completes 9 years of service.
As on 01.09.2018, the employee enters into 10th year of service.
Just would like to show the custom solution (away from standard solution), which is generally implemented:
T559L (All the configurations are same as earlier configuration except the ones shown below)
Attach day balance to the base entitlement
Create a custom rule as below:
In the schema, please place the custom rule above the functions CUMBT and QUOTA.
Please see below the time evaluation output:
5 years completion
9 years completion
Start of 10th year
Hence, for this type of requirement as per my knowledge we can have 3 types of solution:
– SAP standard solution using calculation process
– SAP standard solution using base entitlement [Choose the radio button for Base period under T559L -> Selection rule -> Base entitlement tab -> seniority calculation section -> Base period] for seniority calculation
– Custom solution
The 2nd solution is possible if your client agrees to load all the employee hire dates equal to the service date.
Please note that there are different ways of arriving at a solution (not restricted to above). But always give it a thought before proceeding with custom solution as the best practice of providing solution is the standard way.
Hope you had a wonderful time going through this document. Thanks for your patience and time!!!