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.
Let me first show you the DWS, PWS and WSR of the normal WSR to which the employee will be assigned to.
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.
We also need a DWS called OFF for the off day.
Let me show you the PWS created for the given WSR.
You can see from above screenshot that Saturday is full day working.
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.
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.
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.
Let us first go through IT0007 and the generated DWS. The employee has been assigned to WSR D0001-01 from 01-Aug-2013.
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.
The time evaluation gets successfully processed for 10 days.
Let us go through the processing of PCR ZT01 for 10-Aug-13 which is 2nd Saturday of the month.
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.
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.
Thanks and regards,
If you are interested in other knowledge artifacts by me, please refer the below link: