Skip to Content

Introduction


On the face of it, rounding of overtime hours in time evaluation seems to be a simple requirement that can be easily achieved. However, there are two different ways by which overtime wage types can be generated in time evaluation. The two methods are mentioned below:


     1.    Overtime Hours generated in time wage type through PCR

     2.    Overtime Hours generated in time wage type through T510S table

For the former, before adding the no. of hours to the overtime wage type, we can use operation ROUND to round off the overtime hours. Below is a sample screenshot of the same.


X.jpg

  

The overtime hours calculated through time types are first rounded off and then added to the overtime wage type.


However, in the 2nd scenario, the overtime wage types get generated based on overtime rules defined in Table T510S table and then the hours in overtime wage type needs to be rounded off.


This is where the challenge lies. How to round off hours already present in the wage type in time evaluation?



Client Situation


Our client requirement was to generate overtime based on certain rules and parameters. We were successfully able to define these rules and parameters in Table T510S and overtime wage types were getting generated successfully as per the client’s requirements.


The client had additional requirement to round off overtime hours generated in the wage type. Any value between 0 and < 0.5 should get rounded off to 0 and any value between 0.5 and < 1.0 should get rounded off to 1.0 and this should be rolling over.


So how do we achieve this?


As earlier mentioned, operation ROUND works with time pairs and time types but not with hours in time wage types.


Solution Design


I researched through time functions and operations to find a way to round off the overtime hours in time wage types generated via Table T510S. Finally, I was able to find a function PZL and an operation OUTZL which helped me build this solution.



Function PZL


PZL function provides a personnel calculation rule (Par 1) with wage types for processing based on the identifier (Par 3) and deletes these wage types from DZL or ZL table. If we want the wage types to remain in DZL or ZL table after processing, we will have to use operation ADDZL to transfer the wage types back to DZL or ZL Table.


A time wage type can have three possible identifiers:


  • S  – Planned Work
  • M  – Overtime
  • A  – Absence


In our scenario, the wage types will have identifier M.


Operation OUTZL


OUTZL operation will help us to query the overtime wage type for rounding off. It will be used to query wage type M806 (overtime wage type generated in our scenario) from Table DZL and then the hours of the wage type will be rounded off and added back to the Table DZL.


Table V_T559R


We will use the standard rounding rule 01 in Table V_T559R for rounding requirement as shown in the screenshot below:

X.jpg

PCR ZAD6


We will also create a PCR ZAD6 for reading the no. of hours in overtime wage type and rounding off as per the rounding rules. Below is the screenshot for the same.


X.jpg

PCR ZAD6 reads the wage type from Table DZL using operation OUTZL WGT. If the wage type is anything other than M806, it is added back to Table DZL.


If the wage type is M806, the hours of the wage type are read using operation HRS=ENUM, then rounded off using operation ROUNDHR01 and finally added back to Table DZL using ADDZLMM806.


Function PZL is used to process PCR ZAD6 and it deletes the wage type from Table DZL after reading it. The wage type with rounded off hours are again added back to Table DZL after the PCR processing.



Schema ZTDA


The function PZL and PCR ZAD6 are finally placed in the time schema as shown below:

X.jpg



Solution Testing


The solution design and build is finally complete and hence, let us now test it.


IT0007

X.jpg

Work Schedule

X.jpg

01-Sep-13 is an off day.

We have created the overtime hours in IT2002 for the employee using attendance type 0801.


IT2002

X.jpg

The employee has worked for 3 hour and 10 mins of overtime on 01-Sep-13. However, after rounding off, he should be paid only 3 hours of overtime and not 3.17 hours of overtime.


The time evaluation is run for 01-Sep-13. Let me show you the processing for the given date.

X.jpg

Table T510S Processing

X.jpg

Below is the processing of PCR ZAD6 by function PZL. The hours get rounded off from 3.1667 to 3.0000.

X.jpg

Table ZL


Let us now view Table ZL.


X.jpg


Here, I come to the end of this knowledge artifact. I hope this has been useful for you. Thanks for your patience to go through this.


Please feel free to give feedback on this document so that I can improvise on future publications.


Thanks and 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.

18 Comments

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

          1. Saritha Sivabalan

            HI Vivek.

            Thanks lot for this document..which is relay helpful.

            how we can do over time capture for bellow mentioned scenario..

            If an employee worked on saturday night shift. that mean P10 is at 19.00 and P20 is 07.00 next day (sunday)

            so client asking me to capture the time seperately for saturday until midnight 12 and there after from 12 to 7 (sunday) seperately. i mean saturday and sunday hour wil be stored in two diferent wagetype or time type.

            Have youo done this before? if so pllease let me know.

            Thanks lots.

            Saritha

            (0) 
            1. Vivek Barnwal Post author

              No, I haven’t done this scenario before. Again, I believe you will need a custom development for this since it is not in line with SAP standard behavior.

              Thanks and regards,

              Vivek Barnwal

              (0) 
            2. Rajasekhar Reddy

              Hi,

              Yes it is possible with Standard Operations and with the help of PCR

                                 D HRS=PEND  HRS?24

              *                     HRS-24         HRS*-1       ADDDB9002

              >                    HRS-24         ADDDB9001

              PEND means end of time pair which is 07:00AM in your case

              TIP entries will form as per below

              19:00 to 31:00

              31-24 is 7 this will be added to Time type 9001.

              19-24 is -5 (HRS*-1) will become +5 will be added 9002 Time type

              VARSTWEDAY To query the relative day (6=means Saturday)

              Regards,

              Raja Sekhar

              (0) 
              1. Vivek Barnwal Post author

                But how will you ensure that the wage type on current day gets assigned to current date and not previous day?

                Regards,

                Vivek

                (0) 
                  1. Vivek Barnwal Post author

                    What I understood from the requirement was that if the overtime has been applied from 22:00 02-Jan hours till 6:00 am on 03-Jan, it should generate OT WT with 2 hours of overtime for 02-Jan and OT WT with 6 hours of overtime for 03-Jan.

                    Is this possible with your logic?

                    Regards,

                    Vivek

                    (0) 
                    1. Rajasekhar Reddy

                      Hi,

                      Yes it is possible with Standard Operations and with the help of PCR

                      The below PCR is for Saturday and 5 hours of OT will be added to ZL the balances of Time type 9002

                                         D HRS=PEND  HRS?24

                      *                     HRS-24         HRS*-1       ADDDB9002   

                      >                    HRS-24         ADDDB9001

                      PEND means end of time pair which is 07:00AM in your case

                      TIP entries will form as per below

                      19:00 to 31:00

                      31-24 is 7 this will be added to Time type 9001.

                      19-24 is -5 (HRS*-1) will become +5 will be added 9002 Time type

                      VARSTWEDAY To query the relative day (6=means Saturday)


                      On sunday We have to Query HRS=L9001 (which means for Sunday) add this value to ADDZL so 7 hours will be added to sunday (Here also we can use VARSTWEDAY =7)

                      Regards,

                      Raja Sekhar

                      (0) 
                      1. Saritha Sivabalan

                        Thank you soo much Reddy this is what i was expecting. i did not use HRS=L (to pick the priviouse day) to bringforward to sunday. i will try in the system now. 🙂

                        thanks lot again.

                        kind regards,

                        Saritha

                        (0) 
              2. Saritha Sivabalan

                Hi Reddy,

                Thank you very much for your update. but i need to seperate this 2 portion as date wise.

                lets say saterday fallen on 2nd june and sunday fallen on 3rd june.

                now saturday  5 hrs OT has to be in in 2nd june time balance and 7 hrs OT for sunday has to be 3rd june time balance.

                any idea on this will highly appreciated. 🙂

                Regards,

                saritha

                (0) 

Leave a Reply