Skip to Content

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

/wp-content/uploads/2015/06/1_722154.jpg



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


/wp-content/uploads/2015/06/2_722155.jpg



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


/wp-content/uploads/2015/06/3_722171.jpg



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


/wp-content/uploads/2015/06/4_722172.jpg



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


/wp-content/uploads/2015/06/5_722173.jpg



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

/wp-content/uploads/2015/06/6_722174.jpg



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


/wp-content/uploads/2015/06/7_722175.jpg



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

/wp-content/uploads/2015/06/8_722176.jpg

/wp-content/uploads/2015/06/9_722177.jpg

/wp-content/uploads/2015/06/10_722178.jpg

/wp-content/uploads/2015/06/11_722179.jpg




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

/wp-content/uploads/2015/06/12_722180.jpg

/wp-content/uploads/2015/06/13_722181.jpg/wp-content/uploads/2015/06/14_722182.jpg/wp-content/uploads/2015/06/15_722183.jpg/wp-content/uploads/2015/06/16_722184.jpg




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

/wp-content/uploads/2015/06/17_722185.jpg

/wp-content/uploads/2015/06/18_722186.jpg

/wp-content/uploads/2015/06/19_722187.jpg

/wp-content/uploads/2015/06/20_722188.jpg



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

/wp-content/uploads/2015/06/21_722189.jpg



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


/wp-content/uploads/2015/06/22_722190.jpg



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


/wp-content/uploads/2015/06/23_722191.jpg



Step 14: TCode SM30> V_T555A

/wp-content/uploads/2015/06/24_722192.jpg

/wp-content/uploads/2015/06/25_722193.jpg

/wp-content/uploads/2015/06/26_722194.jpg

/wp-content/uploads/2015/06/27_722195.jpg

/wp-content/uploads/2015/06/28_722196.jpg

/wp-content/uploads/2015/06/29_722197.jpg

/wp-content/uploads/2015/06/30_722198.jpg

/wp-content/uploads/2015/06/31_721935.jpg



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

/wp-content/uploads/2015/06/32_721853.jpg

/wp-content/uploads/2015/06/33_721854.jpg

/wp-content/uploads/2015/06/34_721855.jpg

/wp-content/uploads/2015/06/35_721856.jpg

/wp-content/uploads/2015/06/36_721857.jpg

/wp-content/uploads/2015/06/37_721858.jpg

/wp-content/uploads/2015/06/38_721863.jpg

/wp-content/uploads/2015/06/39_721864.jpg

/wp-content/uploads/2015/06/40_721868.jpg

/wp-content/uploads/2015/06/41_721869.jpg

/wp-content/uploads/2015/06/42_721870.jpg

/wp-content/uploads/2015/06/43_721874.jpg

/wp-content/uploads/2015/06/44_721875.jpg

/wp-content/uploads/2015/06/45_721876.jpg

/wp-content/uploads/2015/06/46_721880.jpg

/wp-content/uploads/2015/06/47_721881.jpg



/wp-content/uploads/2015/06/48_721884.jpg


/wp-content/uploads/2015/06/49_721889.jpg


/wp-content/uploads/2015/06/50_721890.jpg


/wp-content/uploads/2015/06/51_721895.jpg


/wp-content/uploads/2015/06/52_721936.jpg


/wp-content/uploads/2015/06/53_721955.jpg



/wp-content/uploads/2015/06/54_721956.jpg


/wp-content/uploads/2015/06/55_721957.jpg




Step 16: TCode SM30 > V_T511K

/wp-content/uploads/2015/06/56_721962.jpg


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

/wp-content/uploads/2015/06/57_721963.jpg


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

/wp-content/uploads/2015/06/58_721970.jpg


/wp-content/uploads/2015/06/59_721971.jpg

/wp-content/uploads/2015/06/60_721973.jpg



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


/wp-content/uploads/2015/06/61_721968.jpg


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


/wp-content/uploads/2015/06/62_721985.jpg /wp-content/uploads/2015/06/63_721987.jpg

/wp-content/uploads/2015/06/64_722000.jpg

/wp-content/uploads/2015/06/65_722002.jpg

/wp-content/uploads/2015/06/66_722003.jpg

/wp-content/uploads/2015/06/67_722004.jpg




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:


/wp-content/uploads/2015/06/68_722005.jpg


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:


/wp-content/uploads/2015/06/69_722015.jpg


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.

/wp-content/uploads/2015/06/70_722016.jpg



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



IT0000

/wp-content/uploads/2015/06/71_722017.jpg



IT0001


/wp-content/uploads/2015/06/72_722021.jpg



IT0007


/wp-content/uploads/2015/06/73_722031.jpg



IT0008


/wp-content/uploads/2015/06/74_722032.jpg



IT0041

/wp-content/uploads/2015/06/75_722033.jpg



PT60


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

/wp-content/uploads/2015/06/76_722034.jpg

/wp-content/uploads/2015/06/77_722035.jpg


/wp-content/uploads/2015/06/78_722045.jpg



IT2006

/wp-content/uploads/2015/06/79_722046.jpg



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

/wp-content/uploads/2015/06/80_722047.jpg



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.

/wp-content/uploads/2015/06/81_722050.jpg

/wp-content/uploads/2015/06/82_722051.jpg

/wp-content/uploads/2015/06/83_722052.jpg

/wp-content/uploads/2015/06/84_722053.jpg



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


/wp-content/uploads/2015/06/85_722153.jpg






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


IT0000

/wp-content/uploads/2015/06/86_722040.jpg



IT0001


/wp-content/uploads/2015/06/87_722041.jpg



IT0007


/wp-content/uploads/2015/06/88_722069.jpg



IT0008


/wp-content/uploads/2015/06/89_722070.jpg



IT0041

/wp-content/uploads/2015/06/90_722071.jpg



PT60


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


/wp-content/uploads/2015/06/91_722075.jpg

/wp-content/uploads/2015/06/92_722076.jpg

/wp-content/uploads/2015/06/93_722077.jpg



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

/wp-content/uploads/2015/06/94_722084.jpg



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

/wp-content/uploads/2015/06/95_722085.jpg



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.

/wp-content/uploads/2015/06/96_722086.jpg

/wp-content/uploads/2015/06/97_722093.jpg

/wp-content/uploads/2015/06/98_722098.jpg

/wp-content/uploads/2015/06/99_722102.jpg

/wp-content/uploads/2015/06/100_722103.jpg



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


/wp-content/uploads/2015/06/101_722097.jpg


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

To report this post you need to login first.

11 Comments

You must be Logged on to comment or reply to a post.

    1. Vivek Barnwal Post author

      Hi Praneeth,

      Thanks for pointing this out. The document has become very heavy and isn’t allowing to add any more screenshot. Hence, I am including it here.

      /wp-content/uploads/2015/06/31_723007.jpg

      (0) 
  1. Sankarsan Dey

    Hi Vivek,

    Another excellent document from you. It’s giving more clear to us about time managment day by day through your excellent stuff.

    Regards,

    Sankarsan

    (0) 
  2. Ajay Kumar

    HI Vivek,

    Good document.. You have added more images which will help new comers.. A very good wrtten with lots of patience.


    Regards

    Ajay

    (0) 
  3. Sriram Tamil

    Hi Vivek,

    Once again exceptional document from you and very tough requirement , if you don’t mind. Can you please post the screenshots of all the time types which you have created what is holding the value on 01.06.2015 (ZTK1,ZTK2,ZTK3,ZTK4) including monthly and daily balances .

    Thanks

    Sriram

    (0) 
  4. Navneet Saraogi

    Hi Vivek,

    Really good document. However, I have one comment. This solution works great if the employment status is 3 for the employee. If an employee is inactive due to LOA and employment status is set to 1 (per the design, good or bad is different question), then the promotion logic would not work as the previous day balance for time type would be 0 and we will not be able to determine there was a promotion or a demotion.

    We were having this challenge and handled using custom operations to check for promotion/demotion. Do you have any suggestion on how to handle it differently?

    Thanks

    Navneet Saraogi

    (0) 
    1. Vivek Barnwal Post author

      My client didn’t have any requirement to promote an employee in inactive status. Time evaluation can run only for active employment status. I haven’t seen any client promoting an employee when he is inactive.

      Given your requirement, I think only custom function/operation will do.

      Regards,

      Vivek Barnwal

      (0) 
  5. Patrick Gotauco

    Hi Vivek,

    May I know if this setup doesn’t do monthly accruals and gives the entitlement outright? (E.g. if Grade 1 is 10 vacation leaves, then it should be given as 10, no accrual and is given the moment EE enters the company).

    I have a similar requirement but I also need the extra features of Time Eval (e.g. grant additional vacation entitlement on some certain days due to legislation). And I can’t use PT_QTA00 because it doesn’t take account change of EE Grade (unless the promotion has been set before this is ran).

    Thanks,
    Patrick

    (0) 

Leave a Reply