Prorated Grant of Absence Quota for Contract Period in Time Evaluation
Introduction
I recently came across a very challenging requirement where client wanted to grant prorated absence quota to a contractor for the contract period in time evaluation run on the first day of his contract. In this knowledge artifact, I will explain the requirement in detail, challenges in designing the solution and finally the actual solution and testing.
Client Situation
Our client requirement was to give pro-rated grant of annual leave absence quota to a contractor for the contract period in time evaluation run on the first day of his contract. The contract could last for any duration from few months to a year and can overlap across two years.
The annual leave absence quota for a contract period of 1 year was 20 days. Hence, if the contract period is from 01-Nov-13 till 30-Apr-14, then the contractor should be granted annual leave absence quota only for 6 months.
Also, the validity and deduction intervals for the annual leave absence quota should be from 01-Nov-13 till 30-Apr-14.
Solution Challenge
Let us go through the key challenges in meeting the client requirements. There were three key challenges in designing the solution for the requirements:
- How do we ensure that the absence quota validity and deduction intervals are for the contract period?
- How do we ensure that prorated grant of annual leave absence quota happens on the first day of contract period?
- How do we ensure that if the contract period gets extended, the new absence quota record will get validity and deduction intervals as per the new contract period?
Let us go and analyze the validity and deduction interval screen. Below is the screenshot of the screen.
Table V_T559L
Since the absence quota period will be completely dependent on the contract period, we are not left with any option but to use the date type. Using date types, we can actually specify the start and end of validity and deduction intervals based on the contract period.
We will require two date types – one for contract start date and another for contract end date. Each time the contract gets renewed, we will delimit the IT0041 record and update the new contract start date and contract end date for the date types.
Generally, the concept of proration of absence quota is done using reduction rule. The reduction rule determines the period for which the employee is inactive and accordingly, prorates the quota of the base period. Please refer the below screenshot of a sample reduction rule Z1.
Table V_T559L
Why can’t we use the reduction rule in our scenario? The reason is that there is no way to find out the contract period for which the employee is active if the contract period is spanning across two years.
The base entitlement is defined for a calendar year (Base period in above screenshot) and if both the start date and end date of the contract period fall in the same calendar year, it is easy to determine the inactive period of the employee in a given calendar year.
However, if the start date of the contract period falls in one calendar year and end of the contract period falls in next calendar year, it becomes difficult for the system to calculate the inactive period in the base period.
This was the biggest challenge for me in designing the solution to meet the client’s requirements.
To get around this, I thought of finding the prorated grant of quota for a day and then multiple it by the no. of days in the contract period and generate quota as per the contract period on the first day of contract.
Let us move onto solution design where I will explain everything in detail.
Solution Design
Let me first create two date types for contract start date and contract end date.
Table V_T548Y
We will create a daily time type ZAR3 in Table V_T555A. This time type will be generated only on the contract start date and based on this time type, the accrual and entitlement will happen only on the contract start date. The time type will store the no. of days in the contract period.
Table V_T555A
We will need to create an absence quota – Contractor Annual Leave – in Table V_T556A.
Table V_T556A
We select generation of contractor annual leave in time evaluation run in Table V_556A_B.
Table V_556A_B
Let us define the base entitlement of 20 days for a calendar year in Table V_T559E.
Table V_T559E
We will now define the quota validity and deduction intervals in Table V_T559D.
Table V_T559D
Let us now define generation rules for absence quota in Table V_T559L. The absence quota is assigned to absence quota group 03.
Table V_T559L
The setting has been set at daily accrual so that the grant will happen on a daily basis. However, the grant of prorated base entitlement will be controlled using a daily time type ZAR3. On the contract start date, this time type will get generated and the accrual will happen only on the contract start date.
The above configuration is very important one. The radio button “Pro rata calculation” is checked. This means that daily grant of 20 days for a calendar year is prorated to a daily grant for a day.
We have mentioned time type ZAR3 in day balance. Hence, the total no. of days in contract period multiplied by the daily prorated grant will give the total grant for the contract period.
The generated absence quota will be immediately transferred to the employee.
We will need to create a custom PCR ZAR3 to calculate the total no. of contract days as shown in the screenshot below:
PCR ZAR3
The PCR ZAR3 finds the difference between the date of time evaluation and date type Y1 in days using HRS=YDAAY1. It compares the value with 0 using HRS?0.
If the value is not equal to 0, it means that this is not the start of contract date and then the PCR gets processed under *.
Under *, the no. of hours is set to 0 using HRS=0.0 and added to time type ZAR3 using ADDDBZAR3Z. This means that the time type ZAR3 won’t get generated on this day and there won’t be any grant of quota on this day.
If the value is equal to 0, it means that the date of time evaluation is also the contract start date and then the PCR gets processed under =.
Under =, the PCR finds the difference between “Date of Time Evaluation – 1” and “Contract End Date” using HRS=YDRAY3. Why are we using “Date of Time Evaluation – 1”? Because the difference between contract start date and contract end date will be less than 1 day.
Let us assume that the contract start date is 01-Jan and contract end date is 31-Jan. The difference between two dates is 30 days. Hence, we need to add one more day to the difference to arrive at 31 days which is the duration of contract period.
The difference between “Date of Time Evaluation – 1” and “Contract End Date” using HRS=YDRAY3 is a negative value and hence, needs to be multiplied with – 1 using HRS*-1 to get a positive value. This positive value is finally added to time type ZAR3 using ADDDBZAR3Z and the time type gets generated on the contract start date.
We will need to add this PCR ZAR3 in our time schema before Functions CUMBT and QUOTA as shown in the screenshot below:
Now, the solution design is complete. Let us proceed to test this solution.
Solution Testing
Let us complete the master data set up to test solution.
IT0041
We will run time evaluation for 01.11.2013 using TCode PT60 as shown below:
The time evaluation run is successful.
Below is the processing of function QUOTA.
IT2006
The contracted annual leave got generated in IT2006 with the below details:
- Validity Interval: 01.11.2013 – 30.04.2014
- Deduction Interval: 01.11.2013 – 30.04.2014
- Quota Number: 9.91699 Days
So what happens if the contract gets renewed? Let us assume the contract gets renewed for the period 01.05.2014 to 31.08.2014. In such a scenario, we modify IT0041 as shown below:
This will ensure that a new quota gets generated on 01.05.2014.
IT2006
Here, I come to the end of this knowledge artifact. Thanks for your patience to go through it. I discovered a new way of granting prorated absence quota in time evaluation because of this requirement.
I hope this has been beneficial for you too.
Warm regards,
Vivek Barnwal.
**************************************************************************************************
You can also refer to other knowledge artifacts created by me at the below link:
One Stop Shop of my Knowledge Artifacts in SAP HCM
hi vivek ,
gud scenario u have explained in a detailed way
Thanks you...Please kindly rate the quality of document for the benefit of other SCN users.
Dear Vivek,
Good document,
Regards
Mohan
Thanks Mohan...
Awesome Vivek. Liked the way you drilled down the solution.
Regards
Pramod
Thank you Pramod...
Dear Vivek,
As usual a worthful contribution from you on time management business scenario.
Its helpful & beneficial too.
Regards,
Prashanti Swain
Thank you Prashanti
Dear Vivek,
This document helps a lot to explore more in Time Management.
Thanks a lot.
Santosh
Thank you Santosh...
Hi Vivek,
you have shared great configuration step, but i have few questions on it,
1. you are running schema from when to when? because i have seen Evaluation up to 01.11.2013, which is the end date isn't it??
2. as per your PCR value will become zero , and what value will HRS Hold after this operation HRS=YDRAY3, is it 181??
thanks
Sri
The time period of time evaluation run is not required here.
The requirement is to grant prorated quota on the contract start date for the total contract period. If a contractor is eligible for 20 days of annual leave for 365 contract days, then he should be granted prorated annual leave on the first day of contract if his contract days are less than 365 contract days.
HRS=YDRAY3 will hold the no. of days of contract period. I have explained it well. Let us say that the contract period is 01-Jan-13 to 31-Jan-13. Hence, your Y1 = 01-Jan-13 and your Y3=31-Jan-13.
When the time evaluation is running for 01-Jan-13, the system checks if it is the contract start date. The difference between time evaluation date and contract start date will be 0 if the time evaluation date is same as contract start date.
Then the system goes to operation HRS=YDRAY3 where it finds the difference between time evaluation date - 1 minus contract end date to calculate the contract days. This is a negative value and needs to be multiplied by -1 to get positive value.
Why we do this because the difference between 31 - 1 is 30 days. However, the contract period is for 31 days.
Hope this answers your query.
Regards,
Vivek
Hi Vivek,
Excellent one , well explained. thank you so much. all are much cleared.
Please do share us more blogs, we would love to learn it. thanks for your time once again on sharing your's
Thanks
Sriram
Thanks Sriram...Please do rate the blogs for the benefit of SCN users.
Hi vivek,
I have given my rating, thanks
I´m your fan...
Thank you for your kind words.
Regards,
Vivek
Hi Vivek,
Once again Excellent Knowledge sharing on Pro-ration , gave a very new experience ,
But Vivek have found very minor issue while transferring the quota's,
can you help me?? I have raised this question as well in thread. but no solution yet
http://scn.sap.com/thread/3624196
Thanks
Sriram
Hello Vivek
Well thought of solution. Kudos!!!
Regards
Ajay