doc-44521-late coming and early going, unauthorized absence

Upload: paramita-sarkar

Post on 12-Oct-2015

13 views

Category:

Documents


1 download

DESCRIPTION

sap hcm

TRANSCRIPT

  • Generated by Jive on 2014-07-04+02:001

    Late Coming, Early Going and Unauthorizedabsence

    Client Requirements

    The client would like to report on employees who come late or leave early and also report on unauthorizedabsence. This is required for working days as well as for attendance on public holidays and OFF days.

    There are only 2 shifts day shift and night shift - in the plant and an employee can work duringone of the shifts. All working days of each shift have the same planned start time and plannedend time.

    When an employee is working on a public holiday and the daily work schedule is not OFF, then the start timeand end time of the daily work schedule will be used to determine if the employee has come late or left early. Ifan employee works on OFF day or on public holiday, it will be counted as overtime.

    When the employee is working on a day with daily work schedule as OFF, the planned start time and plannedend time can differ. Hence, on some OFF days, the planned start time and planned end time can be 08:15 and17:45 respectively and on some days, they can be 09:00 and 13:30 respectively.

    Below are the conditions for late coming, early going and unauthorized absence. 0 min < {Clock In Time Planned Start Time} < 60 min => Late Coming 60 min =< {Clock In Time Planned Start Time} => May be an unauthorized

    absence. The time administrator/ supervisor will determine whether there is a need forunauthorized absence or not.

    0 min < {Planned End Time Clock Out Time} < 60 min => Early Going 60 min =< {Planned End Time Clock Out Time} => May be an unauthorized

    absence. The time administrator/ supervisor will determine whether there is a need forunauthorized absence or not.

    If clock in and clock out times are both missing on a working day, then the time administrator/supervisor mustget informed about the employee not being at work. The time administrator/ supervisor will determine the causeof absence and then accordingly apply for unauthorized absence if needed.

    Solution Design

    The solution on late coming, early going and unauthorized absence can be achieved based on custom timetypes and PCRs.

    I will create five time types as below: ZVB7 This time type will get generated if the employee is late by more than 0 min

    but less than 60 min when compared to shift start time. The time type will contain thedecimalized min.

  • Late Coming, Early Going and Unauthorized absence

    Generated by Jive on 2014-07-04+02:002

    ZVB8 This time type will get generated if the employee leaves early by more than 0min but less than 60 min when compared to shift end time. The time type will containthe decimalized min.

  • Late Coming, Early Going and Unauthorized absence

    Generated by Jive on 2014-07-04+02:003

    ZVB9 This time type will get generated if the employee comes to office more than 60min late than the shift start time. This may bring following possibilities:

    Employee is actually late by more than 60 min Employee is on leave during the first half of the shift (IT2001 record) Employee is in workshop at some other location during the first half (IT2002 record)

    Hence, it is advisable that the system generates a time type with the decimalized time and a system messageto the time administrator where he can take a judicious decision of handling this. If the employee is actually lateby more than or equal to 60 min, then the time administrator will apply unauthorized leave for the duration inthe system.

  • Late Coming, Early Going and Unauthorized absence

    Generated by Jive on 2014-07-04+02:004

    ZVB0 This time type will get generated if the employee leaves office early by more than60 min than the shift end time. This may bring following possibilities:

    Employee actually left early by more than 60 min Employee is on leave during the second half of the shift (IT2001 record) Employee is in workshop at some other location during the second half (IT2002 record)

    Hence, it is advisable that the system generates a time type with the decimalized time and a system messageto the time administrator where he can take a judicious decision of handling this. If the employee actually leftearly by more than or equal to 60 min, then the time administrator will apply unauthorized leave for the durationin the system.

  • Late Coming, Early Going and Unauthorized absence

    Generated by Jive on 2014-07-04+02:005

    ZVBA This monthly time type will get generated from unauthorized absence type 0150through a custom PCR.

  • Late Coming, Early Going and Unauthorized absence

    Generated by Jive on 2014-07-04+02:006

    The next step is to find a way to apply planned start time and planned end time for days with daily workschedule as OFF. But before we decide this, let us go through the WSRs for the two shifts that the client has.

    WSR 3/US/10 D0001-01 This WSR uses PWS D001 and it is a 5D2X (5 working days 2 OFF days)PWS with DWS as D001 and OFF.

    V_T508A

  • Late Coming, Early Going and Unauthorized absence

    Generated by Jive on 2014-07-04+02:007

    V_T551A

    T550A

  • Late Coming, Early Going and Unauthorized absence

    Generated by Jive on 2014-07-04+02:008

    WSR 3/US/10 N0001-01 This WSR uses PWS N001 and it is a 5N2X (5 working days 2 OFF days)PWS with DWS as N001 and OFF.

    V_T508A

  • Late Coming, Early Going and Unauthorized absence

    Generated by Jive on 2014-07-04+02:009

    V_T551A

    T550A

    Now, we are going to create constants in Table V_T511K to specify planned start time and planned end timefor OFF days for each WSR.

    V_T511K

  • Late Coming, Early Going and Unauthorized absence

    Generated by Jive on 2014-07-04+02:0010

    Since these constants are date dependent, we can change the planned start time and planned end time on anyparticular OFF day by using delimitation functionality.

    The first two constants will be considered for WSR D0001-01 when the employee works on OFF day. The nexttwo constants will be considered for WSR N0001-01 when the employee works on OFF Day.

    In this way, we need to define two constants for every WSR to be used in the plant to denote start time and endtime of shift on OFF days.

    Now we are going to define system messages which will get generated if the employees clockin is late by more than and equal to an hour compared to planned start time or if the employeesclock out is early by more than and equal to an hour compared to planned end time. Thesemessages can be accessed by time administrator through TCode PT_ERL00 or through PTMW.

    V_T555E

    The next step is to create a PCR which will generate time types and system messages. This is a very big PCRand hence, I will explain the logic in parts.

    PCR ZVB1 Screenshot A

  • Late Coming, Early Going and Unauthorized absence

    Generated by Jive on 2014-07-04+02:0011

    In PCR ZVB1 Screenshot A, we first determine whether the planned working hours is 0 or not usingVARSTFREE. If it is not, it goes for processing at N and then if we check the day type of the day usingVARSTDAYTY.

    If the day type is *, the time pair is moved to output table using COLOP *. In the current scenario, only daytypes 0 and 1 are being used by client.

    If the day type is 0, then we check if start and end times exist in the time pair or not using OUTTPEXTIM. Ifany of the start or end time is missing, the time pair gets processed through N and moves to output table usingCOLOP *. This time pair will later cause time evaluation to fail in PCR TE30 since either the clock in or clockout is missing.

    If the start time and end time exist in the time pair, then it gets processed under Y and further processinghappens under employee subgroup grouping specification A and B for PCR ZVB1 using PCY ZVB1A and PCYZVB1B.

    If the day type is 1, the processing is same as day type 0.

    PCR ZVB1 Screenshot B

  • Late Coming, Early Going and Unauthorized absence

    Generated by Jive on 2014-07-04+02:0012

    If the planned working hours is 0 (meaning DWS is OFF), the processing happens under Y (PCR ZVB1Screenshot B). We check whether time pair has start and end times or not using OUTTPEXTIM.If the start and end times dont exist, then the time pair is processed under N and it is moved tooutput table using COLOP *.

    If the start and end times do exist, the processing happens under Y and further processing happens underemployee subgroup grouping specification C for PCR ZVB1 using PCY ZVB1C.

    Under employee subgroup grouping A for PCR ZVB1, the clock in time of the time pair is readusing HRS=PBEG. Then the planned start time of the shift is subtracted from clock in time usingHRS-SWTB. The result is compared with 0 using HRS?0 and if it is less than and equal to 0, thetime pair gets processed under * and is moved to output table using COLOP *.

    If the result is greater than 0, then it is compared with 1 using HRS?1. If the result is less than 1, it getsprocessed under < and the result is added to time type ZVB7 using ADDDBZVB7 and the time type is movedto output table using COLOP *.

  • Late Coming, Early Going and Unauthorized absence

    Generated by Jive on 2014-07-04+02:0013

    If the result is equal to or greater than 1, then the time pair gets processed under * and the resultis added to time type ZVB9 using ADDDBZVB9, a message Z1 Employee came late > 1hr getsgenerated in time evaluation and the time pair is moved to output table using COLOP *.

    PCR ZVB1 Screenshot C

    Under employee subgroup grouping B for PCR ZVB1, the planned end time of the shift is readusing HRS=SWTE. Then the clock out time of the shift is subtracted from planned end time ofthe shift using HRS-PEND. The result is compared with 0 using HRS?0 and if it is less than andequal to 0, the time pair gets processed under * and is moved to output table using COLOP *.

    If the result is greater than 0, then it is compared with 1 using HRS?1. If the result is less than 1, it getsprocessed under < and the result is added to time type ZVB8 using ADDDBZVB8 and the time type is movedto output table using COLOP *.

  • Late Coming, Early Going and Unauthorized absence

    Generated by Jive on 2014-07-04+02:0014

    If the result is equal to or greater than 1, then the time pair gets processed under * and the resultis added to time type ZVB0 using ADDDBZVB0, a message Z2 Employee left early > 1hr getsgenerated in time evaluation and the time pair is moved to output table using COLOP *.

    The time pair comes for processing under employee subgroup grouping C of PCR ZVB1 when the time pairhas start and end times on an OFF day. The work schedule rule of the employee is read using OUTWPSHIFT.

    If the WSR of the employee is D0001-01, the time pair gets processed under D0001-01. Further processinghappens under employee subgroup grouping D & E using PCY ZVB1D and ZVB1E.

    If the WSR of the employee is N0001-01, the time pair gets processed under N0001-01. Further processinghappens under employee subgroup grouping F & G using PCY ZVB1F and ZVB1G.

    If the WSR is other than D0001-01 and N0001-01, the processing happens under ******** andthe time pair is moved to output table using COLOP *. This means that the late coming and earlygoing time types wont get generated in this case.

    PCR ZVB1 Screenshot D

    The time pair comes for processing under employee subgroup grouping D for WSR D0001-01 when start andend times exist in time pair for OFF day.

  • Late Coming, Early Going and Unauthorized absence

    Generated by Jive on 2014-07-04+02:0015

    The clock in time of the time pair is read using HRS=PBEG. Then the planned start time of OFFday is subtracted from clock in time using HRS-CZD01B (The constant ZD01B is read from TableV_T511K). The result is compared with 0 using HRS?0 and if it is less than and equal to 0, thetime pair gets processed under * and is moved to output table using COLOP *.

    If the result is greater than 0, then it is compared with 1 using HRS?1. If the result is less than 1, it getsprocessed under < and the result is added to time type ZVB7 using ADDDBZVB7 and the time type is movedto output table using COLOP *.

    If the result is equal to or greater than 1, then the time pair gets processed under * and the resultis added to time type ZVB9 using ADDDBZVB9, a message Z1 Employee came late > 1hr getsgenerated in time evaluation and the time pair is moved to output table using COLOP *.

    PCR ZVB1 Screenshot E

    The time pair comes for processing under employee subgroup grouping E for WSR D0001-01 when start andend times exist in time pair for OFF day.

    The planned end time on OFF day is read using HRS=CZD01E (Constant ZD01E is read from TableV_T511K. Then the clock out time of the shift is subtracted from planned end time of the shiftusing HRS-PEND. The result is compared with 0 using HRS?0 and if it is less than and equal to 0,the time pair gets processed under * and is moved to output table using COLOP *.

  • Late Coming, Early Going and Unauthorized absence

    Generated by Jive on 2014-07-04+02:0016

    If the result is greater than 0, then it is compared with 1 using HRS?1. If the result is less than 1, it getsprocessed under < and the result is added to time type ZVB8 using ADDDBZVB8 and the time type is movedto output table using COLOP *.

    If the result is equal to or greater than 1, then the time pair gets processed under * and the resultis added to time type ZVB0 using ADDDBZVB0, a message Z2 Employee left early > 1hr getsgenerated in time evaluation and the time pair is moved to output table using COLOP *.

    PCR ZVB1 Screenshot F

    The time pair comes for processing under employee subgroup grouping F for WSR N0001-01 when start andend times exist in time pair for OFF day.

    The clock in time of the time pair is read using HRS=PBEG. Then the planned start time of OFFday is subtracted from clock in time using HRS-CZN01B (The constant ZN01B is read from TableV_T511K). The result is compared with 0 using HRS?0 and if it is less than and equal to 0, thetime pair gets processed under * and is moved to output table using COLOP *.

    If the result is greater than 0, then it is compared with 1 using HRS?1. If the result is less than 1, it getsprocessed under < and the result is added to time type ZVB7 using ADDDBZVB7 and the time type is movedto output table using COLOP *.

  • Late Coming, Early Going and Unauthorized absence

    Generated by Jive on 2014-07-04+02:0017

    If the result is equal to or greater than 1, then the time pair gets processed under * and the resultis added to time type ZVB9 using ADDDBZVB9, a message Z1 Employee came late > 1hr getsgenerated in time evaluation and the time pair is moved to output table using COLOP *.

    PCR ZVB1 Screenshot G

    The time pair comes for processing under employee subgroup grouping G for WSR N0001-01 when start andend times exist in time pair for OFF day.

    The planned end time on OFF day is read using HRS=CZN01E (Constant ZN01E is read from TableV_T511K. Then the clock out time of the shift is subtracted from planned end time of the shiftusing HRS-PEND. The result is compared with 0 using HRS?0 and if it is less than and equal to 0,the time pair gets processed under * and is moved to output table using COLOP *.

    If the result is greater than 0, then it is compared with 1 using HRS?1. If the result is less than 1, it getsprocessed under < and the result is added to time type ZVB8 using ADDDBZVB8 and the time type is movedto output table using COLOP *.

    If the result is equal to or greater than 1, then the time pair gets processed under * and the resultis added to time type ZVB0 using ADDDBZVB0, a message Z2 Employee left early > 1hr getsgenerated in time evaluation and the time pair is moved to output table using COLOP *.

    If a new WSR is being defined in the plant, then we must incorporate this WSR in the PCR ZVB1 at the pointhighlighted below. We should also define the constants for the WSR shift start and end times for OFF day.

  • Late Coming, Early Going and Unauthorized absence

    Generated by Jive on 2014-07-04+02:0018

    Also, the processing under D and E in PCR ZVB1 for existing WSR D0001-01 should be copied to the newones and the constants of WSR D0001-01 are replaced by constants of new WSR.

    PCR ZVB1 Screenshot H

    An unauthorized absence 0150 is also created.

    Table T554S

  • Late Coming, Early Going and Unauthorized absence

    Generated by Jive on 2014-07-04+02:0019

    The time evaluation class of this absence type is maintained as 10. This has been done because all absencescaptured currently get a time type 0220 assigned to absence time pair through table V_T555Z using functionTIMTP.

    We would like to have a custom time type ZVBA unauthorized absence assigned to absencetype unauthorized absence. This is done using PCR ZVB2.

    V_554S_E

    PCR ZVB2

  • Late Coming, Early Going and Unauthorized absence

    Generated by Jive on 2014-07-04+02:0020

    This PCR helps to assign a unique time type ZVBA for unauthorized absence captured in IT2001. The PCRreads the pair type of the time pair using OUTTPPTYPE. If the pair type is anything other than 2, the time pairgets processed under * and it moves to output table using COLOP *.

    If the pair type is 2, the time pair gets processed under 2 and the class for time evaluation for the absencecaptured on the particular day is read using VARABCAT. If the class is anything other than 10 (means absencecaptured is not unauthorized absence), the time pair moves to output table using COLOP *.If the pair type is 10, the time pair gets processed under 10 and the no. of hours of unauthorized absence isadded to time type ZVBA using ADDDBZVBA and the time pair is moved to output table using COLOP *.

    The next step is to include both the PCRs in custom time schema ZTCN. The time schema ZTCN isa copy of time schema TM00 Time Evaluation with Personnel Time Events.

    Schema ZTCN

  • Late Coming, Early Going and Unauthorized absence

    Generated by Jive on 2014-07-04+02:0021

    PCR ZVB1 is being processed by function RTIP because TIP table is being read in this PCR. Par 2 is GENbecause it is called for all time types.

    PCR ZVB2 is being processed by function RTIPA because TIP table is being read in this PCR only in case ofabsence on this day. Par 2 is GEN because it is called for all time types.

    Let us now move towards testing this solution design.

    I could think of 18 different scenarios and I tested them and all of them successfully passed.

    IT0007

    Work Schedule

  • Late Coming, Early Going and Unauthorized absence

    Generated by Jive on 2014-07-04+02:0022

    Please note the below:

    01-Jan-12 has DWS as OFF and is also a public holiday 02-Jan-12 has DWS as D001 and is also a public holiday 03-Jan-12 has DWS as D001 and is not a public holiday

    Scenario 1: No time type generation if the employee neither comes late nor leaves early on a working dayScenario 2: No time type generation if the employee neither comes late nor leaves early on a public holidayScenario 3: No time type generation if the employee neither comes late nor leaves early on a off day

    IT2011

  • Late Coming, Early Going and Unauthorized absence

    Generated by Jive on 2014-07-04+02:0023

    Time Evaluation Result It is successful and doesnt generate any time types.

  • Late Coming, Early Going and Unauthorized absence

    Generated by Jive on 2014-07-04+02:0024

  • Late Coming, Early Going and Unauthorized absence

    Generated by Jive on 2014-07-04+02:0025

    01-Jan-12 Late coming, early going time types dont get generated

    02-Jan-12 Late coming, early going time types dont get generated

  • Late Coming, Early Going and Unauthorized absence

    Generated by Jive on 2014-07-04+02:0026

    03-Jan-12 Late coming, early going time types dont get generated

    Scenario 1: Pass

    Scenario 2: Pass

    Scenario 3: Pass

    -------------------------------------------------------------------------------------------------------------------------------------------------------------

    Scenario 4: Employee came late by more than 0 min but less than 60 min on a working day

    Scenario 5: Employee went early by more than 0 min but less than 60 min on a working day

    Scenario 6: Employee came late by more than 0 min but less than 60 min on a public holiday

    Scenario 7: Employee went early by more than 0 min but less than 60 min on a public holiday

    Scenario 8: Employee came late by more than 0 min but less than 60 min on an off day

    Scenario 9: Employee went early by more than 0 min but less than 60 min on an off day

    IT2011

  • Late Coming, Early Going and Unauthorized absence

    Generated by Jive on 2014-07-04+02:0027

    Time Evaluation Result It is successful and generates early going and late coming time types.

  • Late Coming, Early Going and Unauthorized absence

    Generated by Jive on 2014-07-04+02:0028

    01-Jan-12

  • Late Coming, Early Going and Unauthorized absence

    Generated by Jive on 2014-07-04+02:0029

    02-Jan-12

    03-Jan-13

  • Late Coming, Early Going and Unauthorized absence

    Generated by Jive on 2014-07-04+02:0030

    RPTBAL00 Report This report will display the late coming, early going and unauthorized absence for anemployee.

    RPTBAL00 Report Output

    Scenario 4: Pass

    Scenario 5: Pass

    Scenario 6: Pass

    Scenario 7: Pass

    Scenario 8: Pass

  • Late Coming, Early Going and Unauthorized absence

    Generated by Jive on 2014-07-04+02:0031

    Scenario 9: Pass

    -------------------------------------------------------------------------------------------------------------------------------------------------

    Scenario 10: Employee came late by more than 60 min on a working day

    Scenario 11: Employee went early by more than 60 min on a working day

    Scenario 12: Employee came late by more than 60 min on a public holiday

    Scenario 13: Employee went early by more than 60 min on a public holiday

    Scenario 14: Employee came late by more than 60 min on an off day

    Scenario 15: Employee went early by more than 60 min on an off day

    IT2011

    Time Evaluation It is successful and generates late coming and early going time types andmessages of being late or leaving early by more than an hour. These messages can also be readin PTMW or TCode PT_ERL00.

  • Late Coming, Early Going and Unauthorized absence

    Generated by Jive on 2014-07-04+02:0032

  • Late Coming, Early Going and Unauthorized absence

    Generated by Jive on 2014-07-04+02:0033

  • Late Coming, Early Going and Unauthorized absence

    Generated by Jive on 2014-07-04+02:0034

    01-Jan-12

    02-Jan-12

    03-Jan-12

  • Late Coming, Early Going and Unauthorized absence

    Generated by Jive on 2014-07-04+02:0035

    RPTBAL00 Report

    RPTBAL00 Report Output

  • Late Coming, Early Going and Unauthorized absence

    Generated by Jive on 2014-07-04+02:0036

    There are no existing absences or attendances for the first half or second half for the period 01-Jan-12 to 03-Jan-12. This means that the employee actually came late (> 1hr) and went early (>1hr) on these days. We cant capture any unauthorized absence on 01-Jan-12 and 02-Jan-12 asthey are non-working days due to being OFF day and public holiday.

    The unauthorized absence will be captured only for 03-Jan-12.

    IT2001

    Once the time evaluation rerun happens because of capture of unauthorized absence, the time type ZVBA getsgenerated.

  • Late Coming, Early Going and Unauthorized absence

    Generated by Jive on 2014-07-04+02:0037

    Report RPTBAL00 Output

    A variant of the report RPTBAL00 can be developed to display data related to the below time types only: ZVB7 - Late Coming ZVB8 - Early Going ZVBA - Unauthorized Absence

  • Late Coming, Early Going and Unauthorized absence

    Generated by Jive on 2014-07-04+02:0038

    Scenario 10: Pass

    Scenario 11: Pass

    Scenario 12: Pass

    Scenario 13: Pass

    Scenario 14: Pass

    Scenario 15: Pass

    ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

    Scenario 16: Employee didnt turn up on a working day

    Scenario 17: Employee didnt turn up on a public holiday

    Scenario 18: Employee didnt turn up on an off day

    IT2011

  • Late Coming, Early Going and Unauthorized absence

    Generated by Jive on 2014-07-04+02:0039

    Time Evaluation No message gets generated for 01-Jan-12 (OFF and public holiday) and 02-Jan-12 (public holiday) because they are non-working days and no attendance or time eventshave been captured for these days.

    The time evaluation fails for 03-Jan-12 since there is no leave or attendance captured and time events aremissing too. The message will go to time administrator in PTMW or can also be accessed using TCodePT_ERL00.

  • Late Coming, Early Going and Unauthorized absence

    Generated by Jive on 2014-07-04+02:0040

    Unauthorized absence is captured in IT2001 since the employee was not at work and also didnthave any pre-approved absence or attendance captured for 03-Jan-12.

    IT2001

  • Late Coming, Early Going and Unauthorized absence

    Generated by Jive on 2014-07-04+02:0041

    Time Evaluation It runs successfully after absence is captured.

    P2001

  • Late Coming, Early Going and Unauthorized absence

    Generated by Jive on 2014-07-04+02:0042

    Table TES

    RPTBAL00 Report

  • Late Coming, Early Going and Unauthorized absence

    Generated by Jive on 2014-07-04+02:0043

    RPTBAL00 Report Output

    Scenario 16: Pass

    Scenario 17: Pass

    Scenario 18: Pass

    -------------------------------------------------------------------------------------------------------------------------------------------------------------

    Here I come to the end of this knowledge artifact. I hope you enjoyed reading through this document.

    If you liked this document and found it to be beneficial, request you to please kindly rate it for the benefit ofother users.

    Warm regards,

  • Late Coming, Early Going and Unauthorized absence

    Generated by Jive on 2014-07-04+02:0044

    Vivek Barnwal,[email protected]

    **************************************************************************************************

    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