Second Saturday as Half Day Working in Time Evaluation

Introduction

The idea of this knowledge artifact came from a question posted by another consultant in SAP Community Network (SCN). She wanted the system to dynamically determine 2nd Saturday of every month and make it half day working. Rest of the Saturdays will remain full day working.

Solution Design

Let me first show you the DWS, PWS and WSR of the normal WSR to which the employee will be assigned to.

V_T550A

DWS

/wp-content/uploads/2014/07/1_506604.jpg

As you can see from the above DWS, the working hours for the day are 8.75 hours.

Below is the DWS created for half day shift.

/wp-content/uploads/2014/07/2_506605.jpg

We also need a DWS called OFF for the off day.

/wp-content/uploads/2014/07/3_506609.jpg

V_T551A

Let me show you the PWS created for the given WSR.

/wp-content/uploads/2014/07/4_506610.jpg

You can see from above screenshot that Saturday is full day working.

V_T508A

/wp-content/uploads/2014/07/5_506611.jpg

The above WSR is getting generated from 02-Aug-2010 which is a Monday.

Let us define a PCR to achieve this solution. 2nd Saturday is always going to occur between 08th and 14th of the month. Below is the PCR configured for this solution.

TCODE PE02

/wp-content/uploads/2014/07/5_506611.jpg

PCR ZT01 checks using VARSTREDAY if the date is 08, 09, 10, 11, 12, 13, 14 or any other date. If it is any other date, it gets processed under **. If the date is 08, 09, 10, 11, 12, 13 or 14, PCR checks for 2nd Saturday using VARSTWEDAY. If the weekday is anything other Saturday, it gets processed under *. If the weekday is Saturday, it replaces the existing DWS D001 with DWS D002 using DAYPGD002.

Let us place this PCR in custom positive time schema ZT01 before function P2011. The custom time schema is a copy of standard positive time schema TM00.

TCode PE01

/wp-content/uploads/2014/07/9_507090.jpg

I would recommend to replace the full day DWS with half day DWS before function P2011 so that function P2011 processes as per the half day DWS.

Let us now proceed to solution testing.

Solution Design

Let us first go through IT0007 and the generated DWS. The employee has been assigned to WSR D0001-01 from 01-Aug-2013.

IT0007

/wp-content/uploads/2014/07/10_506616.jpg

Work Schedule

/wp-content/uploads/2014/07/11_506617.jpg

The work schedule shows that on 2nd Saturday, 10-Aug-13, the DWS is D001. This should get replaced by DWS D002 dynamically in time evaluation on 10-Aug-13.

Let us run time evaluation using PT60 till 10-Aug-13.

PT60

/wp-content/uploads/2014/07/12_506618.jpg

The time evaluation gets successfully processed for 10 days.

/wp-content/uploads/2014/07/13_506619.jpg

Let us go through the processing of PCR ZT01 for 10-Aug-13 which is 2nd Saturday of the month.

/wp-content/uploads/2014/07/18_507091.jpg

As per the above PCR processing, the DWS D001 is getting replaced by DWS D002 on 2nd Saturday, 10-Aug-13.

Let us now see the processing of function P2011.

P2011

/wp-content/uploads/2014/07/19_506625.jpg

As you can see in the screenshot above, DWS D002 has replaced DWS D001 and the employee has to work only 4 hours on 10-Aug-2013, 2nd Saturday of the month. Also, the Table TZP has got created as per DWS D002.

So here is the solution of Second Saturday as Half Day Working configured dynamically and I come to the end of this knowledge artifact. Thank you for your patience to go through this document. I hope this has been useful for you.

Was this article helpful?

Related Articles

Leave A Comment?

You must be logged in to post a comment.