Enterprise Resource Planning Blogs by Members
Gain new perspectives and knowledge about enterprise resource planning in blog posts from community members. Share your own comments and ERP insights today!
cancel
Showing results for 
Search instead for 
Did you mean: 
vianshu
Active Contributor

Introduction


Sometimes, you come across a requirement which initially may seem not achievable in standard SAP. And there lies the challenge on how to design a solution for it using standard approach and avoiding the need to go for custom development.


I had a similar requirement from one of my clients for which I was implementing positive time management. The requirement was to grant entire annual leave quota at the start of the year and if there was a promotion in the middle of the year, then the system should automatically grant additional days of annual leave on the day of promotion.


If the annual leave was being accrued and granted daily as part of daily accrual, it would have been quite simple. Because the system would have found the prorated value to be accrued and granted per day based on the base entitlement valid on that day. However, in our scenario, the complete grant happens at the start of the year and then additional days need to be granted on the promotion date.



Client Requirement


Let me explain you the client requirements in detail. The client was implementing positive time management. The annual leave quota was to be granted on the hiring date or on 01-Jan based on the level the employee belongs to. Below are the annual leave quota entitlement based on the pay scale levels:


                   Pay Scale Level                                               Quota Entitlement


                   01 – 06                                                                   35 days

                   07 – 12                                                                   38 days

                   13 – 18                                                                   42 days

                   19 – E4                                                                   48 days


If the employee is hired in the middle of the year, then the annual leave quota granted should get prorated as per duration of employment in the given year. Also, the additional days of annual leave should be granted only when the promotion happens from level 06 to level 07 or from level 12 to level 13 or from level 18 to level 19. Also, the annual leave quota should get rounded off to the nearest integer during each grant.



Challenges


There were quite a few challenges associated in trying to build a solution for this requirement in standard way. Below are the key ones mentioned:


  • How does the system determine in time evaluation that promotion has happened and this promotion will result in additional grant of annual leave quota? If you see the requirement, you will find that only certain promotions will result in additional annual leave days grant.
  • How does the system determine the total no. of days spent in the current quota and the total no. of days to be spent in next quota in time evaluation run?
  • How does the system determine the base entitlement of current quota and next quota in time evaluation run to calculate the additional no. of days to be granted?




Solution Design


Let me take you step by step through the solution design for this requirement.

Step 1: SAP IMG > Time Management > Time Data Recording and Administration > Managing Time Accounts Using Attendance/ Absence Quotas > Setting Groupings for Time Quotas > Group Employee Subgroups for Time Quotas



Step 2: SAP IMG > Time Management > Time Data Recording and Administration > Managing Time Accounts Using Attendance/ Absence Quotas > Setting Groupings for Time Quotas > Group Personnel Subareas for Time Quotas




Step 3: SAP IMG > Time Management > Time Data Recording and Administration > Managing Time Accounts Using Attendance/ Absence Quotas > Time Quota Types > Define Absence Quota Types




Step 4: SAP IMG > Time Management > Time Data Recording and Administration > Managing Time Accounts Using Attendance/ Absence Quotas > Calculating Absence Entitlements > Automatic Accrual of Absence Quotas > Permit Generation of Quotas in Time Evaluation




Step 5: SAP IMG > Personnel Management > Personnel Administration > Payroll Data > Basic Pay > Check Pay Scale Type




Step 6: SAP IMG > Personnel Management > Personnel Administration > Payroll Data > Basic Pay > Check Pay Scale Area



Step 7: SAP IMG > Personnel Management > Personnel Administration > Payroll Data > Basic Pay > Check Assignment of Pay Scale Structure to Enterprise Structure




Step 8: SAP IMG > Personnel Management > Personnel Administration > Payroll Data > Basic Pay > Check Total Salary against Salary Range > Define Pay Grades and Levels




Step 9: SAP IMG > Time Management > Time Data Recording and Administration > Managing Time Accounts Using Attendance/ Absence Quotas > Calculating Absence Entitlements > Rules for Generating Absence Quotas > Specify Rule Groups for Quota Type Selection > Modify Feature QUOMO




Step 10: SAP IMG > Time Management > Time Data Recording and Administration > Managing Time Accounts Using Attendance/ Absence Quotas > Calculating Absence Entitlements > Rules for Generating Absence Quotas > Set Base Entitlements > Base Entitlement for Absence Quota Generation



Step 11: SAP IMG > Time Management > Time Data Recording and Administration > Managing Time Accounts Using Attendance/ Absence Quotas > Calculating Absence Entitlements > Rules for Generating Absence Quotas > Determine Validity and Deduction Periods



Step 12: SAP IMG > Time Management > Time Data Recording and Administration > Managing Time Accounts Using Attendance/ Absence Quotas > Calculating Absence Entitlements > Rules for Generating Absence Quotas > Define Rules for Reducing Quota Entitlements > Define Reduction Rules




Step 13: SAP IMG > Time Management > Time Data Recording and Administration > Managing Time Accounts Using Attendance/ Absence Quotas > Calculating Absence Entitlements > Rules for Generating Absence Quotas > Define Rules for Rounding Quota Entitlements




Step 14: TCode SM30> V_T555A



Step 15: SAP IMG > Time Management > Time Data Recording and Administration > Managing Time Accounts Using Attendance/ Absence Quotas > Calculating Absence Entitlements > Rules for Generating Absence Quotas > Define Generation Rules for Quota Type Selection > Selection Rules














Step 16: TCode SM30 > V_T511K


We require the above constants because there isn’t any standard operation available to read the base entitlement for a specific pay scale level. We can read the base entitlement using operation HRS=CZQU** in a PCR by calling the specific pay scale level.



Step 17: TCode PE02


PCR ZTK1


PCR ZTK1 checks the difference between date of time evaluation and hiring date using operation HRS=YDAA01 and compares it with 0 using HRS?0. If the difference is not greater than 0, then it gets processed under *. It implies that the given date is the hiring date and hence, a value of 1 is passed using HRS=1 and finally saved in time type ZTK1 using ADDDBZTK1Z.


If the difference is greater than 0, it gets processed under >. It checks for the current period using VARSTCURMO. If it is anything other than 01, it stops at **. If it is 01, it checks for the date of the given period using VARSTREDAY. If it is anything other than 01, it stops at **. If it is 01, a value of 1 is passed using HRS=1 and finally saved in time type ZTK1 using ADDDBZTK1Z. This time type is used to grant annual leave either on 01-Jan or on the hiring date of the employee.



PCR ZTK2




PCR ZTK2 checks the current pay scale level of the employee using OUTWPTRFST. For levels 01-06, it processes under employee subgroup grouping A and assigns a value of 1 in time type ZTK2. For levels 07-12, it processes under employee subgroup grouping B and assigns a value of 2 in time type ZTK2. For levels 13-18, it processes under employee subgroup grouping C and assigns a value of 4 in time type ZTK2. For levels 19-E4, it processes under employee subgroup grouping D and assigns a value of 7 in time type ZTK2. Also, in each case, the PCR gets processed under E and assigns a value of 1 to time type ZTK3. Time type ZTK3 is a yearly time type and will store the total no. of days for which time evaluation has run in the current year. This time type will be read to find the no. of days the employee spent in previous pay scale level (on being promoted) and accordingly, arrive at the prorated entitlement in the previous level. This is explained in the last PCR ZTK4.




PCR ZTK3



PCR ZTK3 is used to find if promotion has happened or not from Level 06 to 07 or from Level 12 to 13 or from Level 18 to 19. It first checks if the difference between date of time evaluation and hiring date (using HRS=YDAA01) is greater than 0 or not. If it is 0, it implies that the given date is the hiring date and hence, the processing stops at *. If it is greater than 0, it gets processed under > and goes to employee subgroup grouping A.


Under A, it finds the difference between current day’s pay scale level and yesterday’s pay scale level using HRS=DZTK2 and HRS-LZTK2 and compares it with 0. If the difference between current day’s pay scale level and yesterday’s pay scale level is 0, it means that no promotion has happened which will require additional annual leave grant.


If the difference is 1, it implies that the employee has moved from Level 06 (value = 1) to Level 07 (value =2) and hence, passes value 1 into time type ZTK4 using ADDDBZTK4Z.


If the difference is 2, it implies that the employee has moved from Level 12 (value = 2) to Level 13 (value = 4) and hence, passes value 2 into time type ZTK4 using ADDDBZTK4Z.


If the difference is 3, it implies that the employee has moved from Level 18 (value = 4) to Level 19 (value = 7) and hence, passes value 3 into time type ZTK4 using ADDDBZTK4Z.


PCR ZTK4





PCR ZTK4 finds the value of time type ZTK4 for the current day using HRS=DZTK4 and compares it with 0 using HRS?0.


If the value is 0, it implies that no promotion, that may require additional annual leave grant, has happened and it stops processing under =.


If the value is greater than 0, it goes for processing under * and compares the value with 1 using HRS?1. If the value is 1, it implies that promotion has happened from Level 06 to 07 and hence, it gets processed under = and goes to employee subgroup grouping A of the PCR for further processing.


If the value is greater than 1, it goes for processing under * and compares the value with 2 using HRS?2. If the value is 2, it implies that promotion has happened from Level 12 to 13 and hence, it gets processed under = and goes to employee subgroup grouping B of the PCR for further processing.


If the value is greater than 2, it goes for processing under * and compares the value with 3 using HRS?3. If the value is 3, it implies that promotion has happened from Level 18 to 19 and hence, it gets processed under = and goes to employee subgroup grouping C of the PCR for further processing.


If the value is greater than 3, it stops processing under *.


The processing under employee subgroup grouping A, B and C are similar and hence, I will explain the processing under A only.


Under A, it finds the difference between date of time evaluation and hiring date using HRS=YDAA01 and subtracts the no. of days of time evaluation till system date -1 day in the given calendar year using HRS-MZTK3 (no. of days spent in pay scale level 06 in the given calendar year). If the difference is 0, it implies that the employee is getting promoted in the hiring year itself and the PCR will get processed under =. This scenario is also valid for mid-year hiring and promotion in the hiring year.


Under =, we first read the no. of days of time evaluation till system date -1 day (no. of days in pay scale level 06) using HRS=MZTK3 and divide it by 365 days using HRS/365 and then multiply it with pay scale level 06 entitlement using HRS*CZQUQ1 to arrive at the prorated annual leave grant for the duration in pay scale level 06. This is added to time type ZTK5 using ADDDBZTK5Z.


We find the no. of days to be spent in pay scale level 07 using HRS=FV01F and HRS+1. HRS=FV01F finds the difference between quota end date and system date (date of promotion) for annual leave quota 01. This will be 1 day less and hence, we add 1 day using HRS+1. For example, the difference between 31-Jan and 01-Jan will come out to 30 days and hence, we add 1 day to arrive at 31 days. After finding the no. of days in pay scale level 07, it is added to time type using ADDDBZTK8Z. Then this no. is divided by 365 days using HRS/365 and then multiply it with pay scale level 07 entitlement using HRS*CZQUQ2 to arrive at the prorated annual leave grant for the duration in pay scale level 07. This is added to time type ZTK6 using ADDDBZTK6Z.


Then, we read the prorated value of annual leave grant in pay scale level 06 using HRS=DZTK5Z and add to it the prorated value of annual leave grant in pay scale level 07 using HRS+DZTK6Z and finally subtract the entitlement granted at the time of hiring using HRS-FE01C. This helps to arrive at the additional no. of days to be granted on promotion. The PCR then gets processed under employee subgroup grouping I and is covered later.


If the difference between HRS=YDAA01 and HRS-MZTK3 is greater than 0, it implies that the employee is getting promoted in any year other than the hiring year and the PCR will get processed under >.


Under >, we first read the no. of days of time evaluation till system date -1 day (no. of days in pay scale level 06) using HRS=MZTK3 and divide it by 365 days using HRS/365 and then multiply it with pay scale level 06 entitlement using HRS*CZQUQ1 to arrive at the prorated annual leave grant for the duration in pay scale level 06. This is added to time type ZTK5 using ADDDBZTK5Z.


We find the no. of days to be spent in pay scale level 07 using HRS=365 and HRS-MZTK3 and it is added to time type using ADDDBZTK8Z. Then this no. is divided by 365 days using HRS/365 and then multiply it with pay scale level 07 entitlement using HRS*CZQUQ2 to arrive at the prorated annual leave grant for the duration in pay scale level 07. This is added to time type ZTK6 using ADDDBZTK6Z.


Then, we read the prorated value of annual leave grant in pay scale level 06 using HRS=DZTK5Z and add to it the prorated value of annual leave grant in pay scale level 07 using HRS+DZTK6Z and finally subtract the entitlement granted at the start of calendar year using HRS-CZQUQ1. This helps to arrive at the additional no. of days to be granted on promotion. The PCR then gets processed under employee subgroup grouping I.


Under I, the PCR looks for absence quota type 01 using OUTAQTYP. If the quota type is anything other than **, it stops processing there. If the quota type is 01, the additional no. of days to be granted on promotion is rounded off using ROUNDHR01 and then added to time type ZTK7 using ADDDBZTK7Z and finally updated in annual leave absence quota 01 using UPDTQA01.


We will now introduce these PCRs in positive time schema as shown below:



We also need to introduce function CHECK with parameter BP in the positive time schema so that pay scale levels are read in the Table WPBP as shown below:



With the solution configuration completed, let us proceed to test the solution.






Solution Testing


We will test the below scenarios and see if our solution works correctly or not.



Scenario 1: For an existing employee whose hiring date is in the past years



IT0000



IT0001




IT0007




IT0008




IT0041



PT60


Run time evaluation for 01-Jan-15 for the PERNR and it should give a grant of 35 days as per entitlement.




IT2006



IT0008 – Employee promoted from Pay Scale Level 06 to 07 on 01-Jun-15



PT60


Run time evaluation for 01-Jun-15 for PERNR and it should give an additional grant of 2 days of annual leave for annual leave quota 01.



IT2006 – AL Quota got increased by 2 days due to promotion







Scenario 2: For an employee who got hired mid-year and got promoted in hiring year


IT0000



IT0001




IT0007




IT0008




IT0041



PT60


Run time evaluation to grant quota on 01-Feb-2015.




IT2006 – Prorated quota of 35 days get granted on 01-Feb-15 instead of 38 days since the employee joined mid-year.



IT0008 – Employee promoted from Pay Scale Level 12 to 13 on 01-Jun-15



PT60


Run time evaluation for 01-Jun-15 for PERNR and it should give an additional grant of 2 days of annual leave for annual leave quota 01.



IT2006 – AL Quota got increased by 2 days due to promotion



Here, I come to the end of this knowledge artifact. This requirement helped me stretched my boundaries of imagination and it was a very good learning experience for me. I hope it has been the same for you.


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

11 Comments
Labels in this area