Professional Documents
Culture Documents
Schedule Rules
created by Vivek Barnwal on Feb 13, 2014 12:07 PM, last modified by Vivek Barnwal on Jun 6, 2014 9:47 AM
Version 5
inShare7
Introduction
I should have ideally written this knowledge artifact at least a couple of year back.
However, its better late than never! And yes, my artifact will be limited to things I know
and have expertise about.
Public Holiday Calendar
A Public Holiday Calendar is a collection of public holidays valid for a location (Personnel
Area and Personnel Subarea). Hence, a company having operations from Hyderabad and
Chandigarh will ideally have two different public holiday calendars. Because some public
holidays valid for Hyderabad employees wont be applicable for Chandigarh employees.
The transaction code to access Public Holiday Calendar in SAP is SCAL. The below screen
comes up when we execute TCode SCAL.
We first create a list of public holidays valid for a country and then assign all these public
holidays to public holiday calendars for various locations within the country. What this
means is that we can definitely re-use common public holidays in multiple public holiday
calendars for different locations within the same country. Hence, if public holiday New
Year is valid for Chandigarh and Hyderabad locations, we just need to create one public
holiday New Year and assign it to the public holiday calendars for Hyderabad and
Chandigarh.
Let us select the radio button for Public Holidays shown in the previous screenshot and
then click on change icon. You will be brought to the below screen.
Public Holiday
Short Text
Use in Holiday Cal. Helps us know if the public holiday is being used in any public
holiday calendar or not. You cant edit a public holiday if it is being used in any public
holiday calendar. You need to first remove it from all public holiday calendars where it is
being used and then make the necessary changes and again re-assign the public holiday to
the relevant public holiday calendars.
Sort Key
Helps to group together all public holidays valid for a country. It
is a 3 character key and I recommend its naming convention to be Znn where nn stands for
country grouping. Hence, the sort keys for public holidays for Australia, India, New Zealand
will be as shown below:
Australia
India
New Zealand -
Z13
Z40
Z43
Let me try to change public holiday Deepavali which is currently being used in some
public holiday calendar. If you see the below screenshot, it appears in display mode only.
If you click on the Where-Used List icon, you will come to know the holiday calendars
where this public holiday is being used. Hence, the public holiday Deepavali is being
used in the below holiday calendars:
If you try to edit a public holiday which is not being used in any holiday calendar, it will
open in editable mode as shown in the screenshot below:
Please refer the above screenshot. There are 5 types of public holidays:
With a fixed day from date If there is a requirement that 1st Monday from 01-Nov will
be declared as Family Day, then we should select this option.
Distance to Easter
Easter.
Easter Sunday
Let us study the configuration details of public holiday with fixed date.
Day
Month
Guaranteed
A public holiday with a fixed date can be guaranteed or not
guaranteed. If a public holiday is not guaranteed and it falls on an OFF day, then the
employee cant avail its benefit. Some countries have a policy where if the public holiday
falls on an OFF day (Sat/Sun), then it is moved to a working day (Fri/Mon) so that the
employee still gets the benefit of the public holiday. Hence, the public holiday is guaranteed.
Sort Criterion
Religious Denomination
any particular religion.
o
o
Blank
3-9
Weekday
Day
Month
Hence, it means that the first Monday from 01-Nov will be treated as a public holiday. In
the year 2014, the first Monday from 01-Nov-14 will be 03-Nov-14.
Let us look into the configuration details of public holiday with distance to Easter.
Can specify the no. of days after Easter this public holiday
Let us look into the configuration details of public holiday Easter Sunday.
You dont have anything to configure here. The remaining attributes are similar to fixed
date public holiday.
Floating Public Holiday
A floating public holiday is one which occurs on a different date each year. It can also not
occur in a particular year. Examples of floating holidays are holidays based on lunar
calendar like Holi, Diwali, Id and so on.
Let us look into the configuration details of Floating Public Holiday.
Year
Month
Date
Holiday Calendar
Valid From
Valid To
Let me display the Public Holiday Calendar Australia by clicking on the change icon.
Each public holiday calendar has a validity period. Hence, Public Holiday Calendar AU is
valid from 2000 to 2098.
Please have a look at the public holidays assigned to calendar id AU. These holidays are
valid from 2000 to 2050. Hence, the validity of public holidays within public holiday
calendar is different from the validity of holiday calendar, thereby giving a lot of flexibility
to configure and delimit public holidays in a calendar.
The buttons Assign Holiday and Delete Assignment help to assign and delete public
holidays from a calendar. This is needed to make changes in public holiday especially
floating public holidays.
Please note that if a floating public holiday is being used in multiple holiday calendars,
then you would have to first delete the floating public holiday from each calendar and
then make changes. After the changes have been made to the floating public holiday,
then you need to assign them to all the public holiday calendars where this was being
used.
Once a public holiday has been used in a calendar, it should never be deleted
permanently. If the public holiday is not required from a particular year onwards, we
should delimit the validity of the public holiday within the public holiday calendar but not
delete it.
If you would like to display the dates of public holidays in a particular year in a public
holiday calendar, please select the public holiday calendar and click on Calendar display
icon.
The below screen comes up. Hence, for the year 2014, there are 10 public holidays for
Australia and one public holiday falls on Saturday and Sunday each.
Let me display the calendar for the year 2014 by clicking on the Year display icon. The
below screen comes up.
You will see that the fixed date public holiday Australia Day has been moved from
Sunday 26-Jan-14 to Monday 27-Jan-14. Both the dates will have public holiday class 1.
Below is the configuration for Australia Day public holiday for your reference.
So, this is all I have here to share about public holidays, public holiday classes and public
holiday calendar. I am not going into factory calendar as I didnt get a chance to work on
this concept. Let us now move over to Day Types.
Day Types
What is a day type and how is it different from public holiday class?
A day type helps us to determine if an employee is eligible for a public holiday or not and
whether he should be working on a day or not and how should he get paid for the given
day.
What should be the public holiday class and day type for a DWS if the employee is
supposed to work on public holiday Independence Day as per planned work schedule?
The employee wont get paid if he doesnt work on the public holiday. For such a scenario,
the public holiday class will be 1 to indicate that the day is a public holiday and the day
type will be blank to indicate that the employee has to work on this day.
Blank 1
2
3
4-9 -
Work/paid
Off/paid
Off/unpaid
Off/special day
customer specific
The functionality of rules for day types is to assign a day type to a day with a particular
public holiday class.
You will find field Rules for Day Types in Work Schedule Rule configuration table
V_T508A.
The configuration of rules for day types is done in table V_T553A. Below is a sample
screenshot.
So how do we interpret rule 01 in the above screenshot? The three columns specify day
type for a weekday, Saturday and Sunday respectively. There are 10 spaces in each box
below weekday, Saturday and Sunday with each space representing the Public Holiday
Class from 0 9.
Let us understand rule 01 for weekday. It states to assign the following day types to
weekday if the weekday has the given public holiday class.
How should the rule for day types look like if an employee is not eligible for public
holidays? It should be like rule 02 where a day (weekday, Saturday, Sunday) with any
public holiday class will have day type blank always assigned to it.
Hence, if an employee is not eligible for public holidays, we should assign rule for day
type 02 in the WSR (to be assigned to employee) in Table V_T508A.
Define Special Days (V_T553S)
There can be a business scenario where an employee is eligible for only two public
holidays in a year from the same holiday calendar.
Let us say that an employee works out of location Hyderabad and his WSR is assigned
to Hyderabad Public Holiday Calendar. However, this employee is only eligible to two
public holidays Christmas and New Year and not all the public holidays in Hyderabad
Public Holiday Calendar. So what do we do in such a case? Do we create a new public
holiday calendar for these set of employees?
SAP provides this functionality Define Special Days to handle such scenarios. We can
assign rule for day type 04 to the WSR of this employee and configure dates 01-Jan and
25-Dec in Define Special Days to make them applicable for these employees.
Please refer the below screenshots. This configuration will ensure that the employee is
eligible for only two public holidays New Year and Christmas.
I hope the concept of public holiday class and day type is clear now. Let us now move to
the next concept of Work Schedule Rule.
Work Schedule Rule
A work schedule rule specifies the working pattern and rules for an employee. The beauty
of work schedule rule in SAP is that it is highly module in nature. As a result of this, it
promotes reusability of the components involved in the work schedule rule.
Before we move further into this, let us understand few key things like groupings.
Groupings
Personnel Subarea Grouping for Daily Work Schedule: This is used to group daily work
schedules and then the personnel subarea grouping for daily work schedule is assigned to
personnel subarea grouping for work schedules. Let us assume that a company has
operations in Hyderabad, Bangalore and Mangalore.
Let us assume that employees in locations Bangalore and Mangalore have been assigned
to personnel subarea grouping for work schedules 01. Employees in location Hyderabad
have been assigned to grouping 02. All three locations are to use the same daily work
schedules. Hence, we can assign personnel subarea grouping for daily work schedules 01
to personnel subarea groupings for work schedules 01 and 02.
I havent come across any client where the personnel subarea grouping for daily work
schedule is being shared across multiple personnel subarea grouping for work schedules.
I have always found one to one mapping in all the clients I have worked for.
Please refer the below screenshot of table V_T508Z. The first column represents the
personnel subarea grouping for work schedule rule and the second column represents the
personnel subarea grouping for daily work schedules.
Personnel Subarea Grouping for Work Schedule Rule: This is used to group personnel area
and personnel subarea for work schedules. It requires you to specify country grouping.
Please refer the below screenshot from Table V_001P_All.
The first column represents the personnel area, third column represents the personnel
subarea and the last column represents the
personnel subarea grouping for work
schedule rules.
Public Holiday Calendar for Personnel Area and Personnel Subarea: This is used to assign
public holiday calendar to personnel area and personnel subarea in table V_001P_All. It
requires you to specify country grouping. Please refer the below screenshot:
Employee Subgroup Grouping for Work Schedule Rule: This is used to group employee
group and employee subgroup for work schedule rules. Please refer the below screenshot
from table V_503_All.
The first column represents the employee group, third column represents the
employee subgroup and the last column represents
the employee subgroup
grouping for work schedule rules.
Fixed break
Variable break
Dynamic break
Grpg This represents the personnel subarea grouping for daily work schedules as
described earlier.
Break Name of the break. It can be of max 4 characters.
No
Represents the sequential no. of breaks if there are more than one break times
defined for the same break. A shift may have 2 breaks one lunch break and one snack
break. In such a scenario, sequence no. will be needed to differentiate both the breaks.
Start Start time of the break.
End
End time of the break.
Unpaid Specify the duration of unpaid break in hours.
Paid Specify the duration of paid break in hours.
After Specify the hours after which the employee can go on a break.
Daily Work Schedule
Daily Work Schedule (DWS) is maintained in Table V_T550A. It is used to represent the
daily working hours of a day. Please refer the below screenshot.
Let us understand the different fields for a DWS from the above screenshot.
DWS Grouping
Work Schedules.
Start
End
Working times can be fixed working hours and flextime working hours.
Fixed Working Hours It is applicable if the employee has to work fixed working times.
Flextime Working Hours It is applicable if the employee has to work flexible working
times.
Work Break Schedule - You can assign a break schedule to the daily work schedule here.
Tolerance Time
Begin Tolerance Time If an employee comes during this period, it is assumed that the
employee has come at the planned shift start time. If the tolerance is after planned shift
start time, it allows an employee to come late without being considered late. If the
tolerance is before planned shift start time, it helps to prevent the system from considering
this period as overtime. Tolerances are processed in the schema by function DPTOL.
End Tolerance Time If an employee leaves during this period, it is assumed that the
employee has left at the planned shift end time. If the tolerance is before the planned shift
end time, it allows an employee to leave early without being considered leaving early. If the
tolerance is after the planned shift end time, it helps to prevent the system from
considering this period as overtime. Tolerances are processed in the schema by function
DPTOL.
Minimum Working Time
You can specify the minimum no. of hours an
employee is supposed to work in a day.
Scenario 1: When we want another DWS to be called in based on certain conditions getting
satisfied If there is a requirement that whenever Friday is a public holiday, then the
planned working hours for Thursday should get reduced to 4 hours from 8 hours.
Scenario 2: When we want a different no. of hours getting deducted for absence instead of
the planned working hours specified in the DWS Suppose an employee works 5 days a
week and 40 hours per week Mon (10hrs), Tue (10hrs), Wed (10hrs), Thu (5hrs) and Fri
(5hrs). If an employee applies for leave on any day, it should deduct 8 hours and not the
planned working hours of the day.
Below is the detailed explanation of the two scenarios of variants for DWS.
Scenario 1: Rules to determine variant for monthly WS rule generation (Table V_T550X)
Let us try to understand the rule 01. It has two sub-rules 01 and 02. The 2nd sub-rule
gets executed only when the first sub-rule fails. If the first sub-rule passes, then 2nd subrule is not executed.
Holiday Class
It comprises 10 spaces representing the 10 public holiday classes
from 0 9. It represents the holiday class for the current day. X represents the holiday
class in scope.
Day
It represents the weekday and has seven spaces ranging from Mon
to Sun. X represents the weekday in scope.
Variant
executed.
Rule 01 Sub-rule 01 gets executed and the variant B is called in if the holiday class of the
current day is 2, if the holiday class of the next day is anything from 0 9 and the
weekday can be anything from Mon Sun. If the rule 01 sub-rule 01 is successfully
executed, then the original DWS is replaced by its variant B.
If the rule 01 sub-rule 01 fails, then the rule 01 sub-rule 02 gets executed and the variant
B is called in if the holiday class of the current day is anything except 2, if the holiday
class of the next day is anything from 0 9 and the weekday is Friday. If the rule 01 subrule 02 is successfully executed, then the original DWS is replaced by its variant B. If the
rule 01 sub-rule 02 fails, then the variant B is not called in and the original DWS is used.
Apart from defining the DWS Selection rule, you also need to create a DWS with the
variant B and define the planned working hours for the DWS with variant B.
Scenario 2: Determine Daily Work Schedule Variants for Absence
Let us try to understand the rule 01. It has only one sub-rule 01
Holiday Class
It comprises 10 spaces representing the 10 public holiday
classes from 0 9. It represents the holiday class for the current day. X represents the
holiday class in scope.
HolClNext Day
It comprises 10 spaces representing the 10 public holiday
classes from 0 9. It represents the holiday class for the next day. X represents the
holiday class in scope.
GrpAtt/Abs
It represents the absence grouping of the absence which is
defined in Table T554S. It comprises 10 spaces representing absence grouping from 0
9. X represents the absence grouping in scope.
Weekday
It represents the weekday and has seven spaces ranging from
Mon to Sun. X represents the weekday in scope.
Variant
successfully executed.
Rule 01 Sub-rule 01 gets executed and the variant A is called in if the holiday class of the
current day is anything from 0 - 9, if the holiday class of the next day is anything from 0
9, if the absence grouping of the absence applied is 1 and the weekday can be anything
from Mon Sun. If the rule 01 sub-rule 01 is successfully executed, then the original
DWS is replaced by its variant A. If the rule fails, then the original DWS is called in for
absence hours.
When an absence type with absence grouping 01 is applied, the DWS selection rule 01
assigned to the DWS will get executed. If the rule execution is successful, the original
DWS gets replaced with DWS variant A and the no. of hours mentioned in the DWS
Variant A gets deducted for absences.
Let us now move on to Period Work Schedule.
Period Work Schedule
A period work schedule is a group of daily work schedules which gets repeated to form a
working pattern. It is defined in table V_T551A.
Please refer the below screenshot which has 3 PWS displayed:
Grpg
PWS
characters.
Period WS Text
characters.
Week
01 07
PWS 0003 is 4 Days, 4 OFFs, 4 Nights, 4 OFFs pattern. If you wish a pattern not ending
on Sunday to get repeated, you use * after the pattern for it to get repeated.
After creating the PWS, you must define counting class for Period Work Schedule in Table
V_T551C. Please refer the below screenshot.
Grpg
PWS
characters.
Start Date
End Date
Cntg Class Counting Class is used to count absence and attendance by specifying
different methods of counting according to the period work schedule.
ES Grouping
Holiday Calendar ID
PS Grouping
Start
End
Weekly Workdays
Please find below the recommended co-relation between weekly working hours, monthly
working hours and annual working hours.
You can specify the rule for specifying the day types for
DWS Grouping
Let me explain you the importance of WSR Start Date and Ref Date for PWS.
WSR start date is the date from which the WSR is created. Ref Date is the date based on
which the WSR is generated. If the ref date is 11-Mar-14, then the WSR gets generated
from Mar14 onwards.
Let me give you a real time situation. A new employee has been hired and he is going to
be placed on a new WSR effective 01-Mar-14.
What should be the WSR start date and ref date in such a case and month of generation?
I recommend the WSR start date to be effective at least 2 years before the month of
generation. The month of generation should be at least a month before the employee
needs to work on the WSR. Why is this so?
In our example, since the employee has to start work on 01-Mar-14 on the new WSR, I
would generate the WSR effective 01-Feb-14 and I will create the WSR from 01-Feb-12.
The generation has to be at least one month before the month employee gets placed on
the WSR because in case of time evaluation, it checks for the generated DWS on the last
day of the previous time evaluation period. If we generate the WSR from Mar14, there
wont be any DWS generated for 28-Feb-14 and this will give a configuration error during
time evaluation run.
Let me give you another scenario. Let us say that there are two shifts in which employees
have to work. Group A employees have to work as per pattern A and Group B employees
have to work as per pattern B. Please refer below patterns A and B.
Pattern A
Week
001
002
Mon
Day
Night
Tue
Day
Night
Wed
Day
Night
Thu
Day
Night
Fri
Day
Night
Sat
OFF
OFF
Sun
OFF
OFF
Mon
Night
Day
Tue
Night
Day
Wed
Night
Day
Thu
Night
Day
Fri
Night
Day
Sat
OFF
OFF
Sun
OFF
OFF
Pattern B
Week
001
002
No, we actually need to create only 1 PWS and change the reference point in PWS for the
two WSRs.
For pattern A, ref point in PWS = 001;
For pattern B, ref point in PWS = 008.
Generation of WSRs
After we have configured the WSR, the next important step is generation of WSR.
Please follow the below path for generation of WSR.
SPRO > Time Management > Work Schedules > Work Schedule Rules and Work Schedule
> Generate Work Schedules in Batch
You can generate more than one WSR at the same time.
Enter the details of the WSR and the period for which you wish to generate the WSR and
enter E in field BTCI and execute. This will do mass generation of WSR for the period
requested.
Sometimes there may be a need to change the generated DWS for a particular day. Let
us say that the employees are working 5 days 2 OFFs in shift 9 am 6 pm from Mon
Sun on a particular WSR.
Now, you would like all your employees on this WSR to work only on a particular
Thursday from 9 am 1 pm. In such a case, we should substitute the existing DWS with
another DWS (having timings 9 am 1 pm) in the generated WSR using TCode PT02.
This will ensure that the shift for that Thursday will change for all employees on this WSR.
However, if there is a request to change the shift timings only for selected employees,
then we should do shift substitution in IT2003 for the selected employees.
Infotype 0007
Infotype 0007 contains the planned working time for an employee. Please refer the below
screenshot from IT0007.
Time Management Status Specifies the time management status for the employee
which goes on to determine whether time evaluation happens or not and if it is positive or
negative time evaluation. You can default time management status using feature TMSTA.
Working Week
In some clients, the start of week can be different
compared to the standard and the start of week can also be dependent on timings. In
such cases, we need this concept of working week to specify the start and end of the
week. Working week concept in standard SAP is used for weekly overtime calculation in
sub schema TW30 in time schema TM04. You can default working week using feature
WWEEK.
As per the current full time WSR, an employee has to work for 5 days in a week from Mon
Fri with 8 hours per day and 40 hours per week.
Let us assume that an employee has to work 60% of a full time WSR with reduced
working hours each day. In such a case, we check the part time employee check box and
change the employment percentage to 60%.
The system automatically adjusts the daily working hours, weekly working hours, monthly
working hours and annual working hours automatically based on the employment
percentage. This was one scenario of part-time WSR.
What do we do if an employee works 60% by working 8 hours from Mon-Wed and OFF
from Thu to Sun?
In such a scenario, we create a part time WSR like a full time WSR and then use capacity
utilization field in IT0008 to capture 60% utilization.
Here I come to the end of this knowledge artifact. I hope you enjoyed reading through
this document.
Recently when I posted my first document, there was a request that I should create something on DWS Variants. So
here it is
The primary focus of this document would be to understand the purpose and configuration of a DWS variant for a
working day and absence. Also, we will see some examples to get a better understanding.
The Daily Work Schedule as the name suggests specifies how a single work day would be. Now in case there is a
situation when work timings need to be different based on some condition such as a day before the public holiday
then we would need a mechanism to be able to capture the same. In such a situation making a different DWS also
would not be feasible as we would not know when the public holiday would occur in our roster. Another situation
could be that, if we book an absence, then we do not want the standard working hours to be deducted for that day,
instead we want only 50% of the hours to be deducted. A way of doing this is via the quota multiplier of the counting
rule but that does not seem a feasible solution when you wish to apply this condition only for employees on some
specific rosters. This is where DWS variants come to our rescue.
When we create a DWS variant, in simple terms it means creating another record with the same DWS and identifying
it differently with a variant name. Along with this we would also need to configure a rule which would specify the
condition under which this variant is to be selected. An example variant looks like is shown below:
You would specify the normal DWS on the main screen. The DWS Selection Rule plays an important role here as you
would need to select the correct rule for which your variant should be processed.
Since DWS variant can be created for both working days and absences, these two types are differentiated by the
Record Type in the DWS Selection Rule. Lets see both of these in detail below.
DWS Variant Rules for Working Days
From the above explanation, we know that we need to create a rule to meet the condition for which we are creating
the variant. The Record type for the DWS rule for working days would be 01. The rule is created in table V_T550X. The
customizing path for the same is Time Management --> Work Schedules --> Daily Work Schedules --> Define Rules
for Variants
Now lets try to understand how to configure this rule:
Day: This field has 7 positions, one for each day of the week starting Monday. X at any position would mean that the
rule is applicable for that day of the week. So if you want to create a variant for Friday, you would have to put a X at
th
the 5 position.
Variant: This specifies the name that you give to the variant which would also be used in the DWS.
One thing which you should remember is that the rule is always configured for the current day being processed.
Lets check some sample conditions/rules to understand this configuration.
Example 1: Employee would work 3 hours less than his usual working time one day prior to a public holiday falling on
a Saturday.
Solution: As per the requirement, we need to create a variant for DWS when any public Holiday falls on Saturday.
This implies that our current day should be a working day (Holiday Class 0), next day should be a public holiday (Hol
Class 1-9) and the current day should be a Friday. So the rule would be configured as below:
This rule would be selected as the DWS Selection Rule for the mail DWS. Then a variant named A would be created
which would have the planned working hours as 3 hours less as compared to other working days.
Example 2: Every Saturday should be a half working day.
Solution: This can be achieved in two ways. First is to create 2 different DWS one for other weekdays and other for
Saturday. Second is to create a DWS variant for Saturday. This variant would have the planned working hours as half
of what is there for the other days. The rule would look like below:
The absence grouping would allow you to control which absence is the rule to be made applicable for. Each position
specifies a grouping between 1 to 9, 1 being the first position and 9 being the last and a X at any position means the
rule is applicable for an absence with that grouping. Numbers 1 to 9 can be assigned to each absence in the table
V_554S_O. This would allow the rule to be created only for some absences and out of all those which are available
for the employee. Meaning of rest of the fields remains the same.
Example 1: Any absence booked one day prior to a public holiday should deduct 3 hours more than the planned
working time.
Solution: From the requirement it is clear that the next day should be a public holiday and the rule is to be made
applicable for all absence groupings. So the solution would be as below:
The variant would then be configured with planned working hours as 3 hours more than that for other days.
Example 2: Any absence booked on a Saturday should deduct 2 hours less than the planned hours for other days.
Solution: Here the only check that we would have to make is for the current day to be Saturday. So the solution
looks like below:
This variant of this DWS would be configured with 2 hours less than the normal working hours.
Now that we have seen how the rule our configured, lets take a quick look at how the DWS looks like along with its
variants. The example below is a different one, not related to the rules we checked above.
Hope this document has been helpful in making you understand the concepts in deta
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
2ndSaturday 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
As you can see from the above DWS, the working hours for the day are 8.75 hours.
V_T551A
Let me show you the PWS created for the given WSR.
You can see from above screenshot that Saturday is full day working.
V_T508A
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
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
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 first go through IT0007 and the generated DWS. The employee has been assigned
to WSR D0001-01 from 01-Aug-2013.
IT0007
Work Schedule
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
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
2ndSaturday, 10-Aug-13.
Let us now see the processing of function P2011.
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.
Vivek Barnwal,
vianshu@gmail.com
If you are interested in other knowledge artifacts by me, please refer the below link:
Introduction
In my opinion, the starting point for implementation of a positive time solution with time
events in SAP HR should be the time recording terminals and its capabilities. Some Time
Recording Terminals can record only clock in and clock out data. However, there are some
advanced ones where you can record your absences, attendances and offsite work too.
Time Recording Terminals can be SAP certified. What this means is that the vendor of
time recording system can get certification for their software to communicate with SAP
R/3. Hence, standard interfaces made available by SAP can be used for communication
with time recording system. When you are implementing positive time solution with time
events for any client, you should ask your client to check with the time recording system
vendor if the time recording terminals are SAP certified or not.
Let us understand the different method of integration between SAP R/3 and time
recording terminals.
Types of Integration
Quite often, the integration between time recording system and SAP R/3 requires a two
way interface. Below is a schematic representation of the integration.
SAP R/3 sends HR mini-master data to the time recording system for validation purposes
when the employee swipes at the time recording terminals. The time recording system
sends time events to SAP R/3 for evaluation purposes.
Below are the possible standard ways of integrating SAP R/3 with time recording system:
HR PDC InterfaceThis method of integration between SAP R/3 and time recording terminals
involves a BAPI based interface and the data transfer takes place through ALE using
standard IDOCs (a standard file format with predefined fields). To use this method, we need
SAP certified time recording terminals. A custom BAPI can also be created if the time
recording terminals are not SAP certified.
Communication Channel 1 (CC 1)transceiver based transfer and is the old method to transfer
data between SAP R/3 and time recording terminals. This also requires CC1 certified time
recording terminals. This method is not advisable to be used anymore.
Sequential Files Method - This method is generally used when the time recording
terminals are not SAP certified. The time events can be uploaded to R/3 using report
RPTEUP10 from sequential files and the HR mini master records are downloaded to
sequential files to update the time recording systems using report RPTEDO00.
Let us discuss HR PDC Interface and Sequential Files Methods.
Below is the process flow for data exchange between SAP R/3 and Time Recording
Terminals using HR PDC Interface.
Step 1: SAP R/3 downloads the HR mini master data to the time recording system
usingprogram RPTCC101. It will help to determine the employee id from the card id and
check permissibility for time event types (clock in/clock out, start of break, end of break
etc.) entered by the employee. The HR mini master will also be used for validation at the
time recording terminals during clock in and clock out. It is recommended to run this
program once in a day so that any new joiners or leavers get added to the list.
Step 2: The time event type groupings are downloaded using program RPTCC105 from SAP
R/3 to time recording terminals so that employees can record clock ins and clock outs
against the correct time event types (clock in/clock out, start of break, end of break etc.).
It is recommended to run this program once during go live and after that on need basis
whenever there is change in time event type groups.
Step 3: The upload of time events in SAP gets initiated by SAP using program RPTCC106 (HR
PDC Download Upload Request for Time Events). The program downloads the upload request
for time events from SAP. On receiving the upload request, the time recording system
uploads the time events data to SAP R/3. The frequency of this depends on client
requirement can vary from once a day to multiple times in a day. The personnel time
events are uploaded in SAP and stored in interface table CC1TEV.
Step 4: Finally, the time events in interface table CC1TEV are posted to TEVEN and NT1
tables using program SAPCDT45. On successful posting, the time events are deleted from
interface table CC1TEV. If the posting ends in error, the time events are again deleted
from interface table CC1TEV. Sometimes, the time events dont get posted because the
personnel number may be locked and they remain in interface table to be picked up in the
next run of the program. It is recommended to run this program once every hour.
Step 5: SAP provides program RPAFRV00 to post process time events that didnt get posted
to time management and ended in errors.
HR Mini-Master IDOC
Below is the process flow for data exchange between SAP R/3 and Time Recording
Terminals using sequential files.
Step 1: The report RPTEDO00 downloads the mini-master records of the selected employees
to a sequential file. The structure of the mini-master records is stored in table DWN01.
The system selects employees who are assigned to a subsystem grouping. The flat file is
placed in SAP Application Server and it is moved to time recording server using FTP.
Step 2: The time recording server can deposit the flat file into SAP Application Server using
FTP. The program RPTEUP10 picks up the flat file and uploads the data to IT2011.
Below are the file formats for download and upload programs:
Table DWN01
The time recording terminals selected by our client were not SAP certified. Also, the time
recording terminals could only record clock in (P10) and clock out (P20) data. We decided
to use the sequential files method using outbound and inbound interfaces (SAP PI).
The first run will contain data for all employees. Subsequent runs will be only incremental
data changed or additional data for employees. If there hasnt been any change or new
data for an employee in IT0050, it doesnt get sent in the daily run.
There may be a need to run the program for full load later on. Hence, we provided a
checkbox for Full Load. If the checkbox for Full Load is checked, the download program
will extract full data for active employees on that day. Otherwise, it will just extract
incremental data.
Also, the input screen for the program had two options in the form of radio buttons for
specifying the file download path:
User would have to select one of the radio buttons to run the program.
The input screen also had a mandatory field to enter the company code. Based on the
company code entered, the program will download data from IT0050.
A background job program will be scheduled to run the download program once every night
to extract the HR mini-master data from IT0050 into a .txt file. The .txt file will be placed in
a folder in SAP Application Server. The .txt file will be picked up by outbound interface
program (SAP PI) and sent to time recording system application server. Once the .txt file is
successfully sent to time recording system application server, the file in SAP Application
Server is moved to archive folder.
HR Time Events Upload Program: SAP R/3 will receive time events .txt file from the time
recording system through an inbound interface. SAP PI will place this file in a specified
folder in SAP Application Server. If the time recording system agrees to provide the content
in SAP format, no conversions will be required to be done by SAP PI. Or else, conversion
logic will need to be put in place.
SAP provides a standard upload program RPTEUP10 to upload time events into interface
table CC1TEV. However, we were not able to use the standard upload program because of
the following reasons:
It cannot delete a file after uploading its contents or move the file from one folder in SAP
Application Server to another folder for archiving. This functionality is needed so that once
the file content is uploaded into interface table CC1TEV; it is not picked up again in the next
run.
Also, the standard program works in local file mode and not in sequential file mode. If we
try to upload the file from SAP Application Server using sequential file mode, it is not getting
picked up. This is due to an issue in the open dataset statement. Please refer
linkhttp://scn.sap.com/thread/1262043
The standard program cant append the date of entry, time of entry (system date and time)
and user id in the contents being uploaded into CC1TEV table.
For the above reasons, we had to clone the standard program into a custom Z program
and perform modifications as there was no enhancement point available to check whether
the standard function module was executed properly or not. The structure of file format
for program RPTEUP10 was retained without any changes.
A background job for this custom program will get initiated by a proxy program in SAP PI
the moment file gets placed in the specified folder in SAP Application Server. The
background job will upload the contents of the .txt file (received from time recording
system and available at a specified folder in SAP Application server) into interface table
CC1TEV.
The front end of the custom Z program was kept same as the standard program
RPTEUP10 and is shown below:
The output of the custom Z program was kept same as the standard program RPTEUP10
and is shown below:
HR Time Events Posting Program: After the file contents are uploaded into interface
table CC1TEV, the next step is to post the time events from the interface table CC1TEV into
TEVEN table. SAP provides a standard program SAPCDT45 to post time events from
interface table CC1TEV into TEVEN table. However, we were unable to use the standard
program because of the need to send email notification to the IT contact person in case of
errors encountered in posting the time events.
For the above reason, we had to clone the standard program into a custom Z program and
perform modifications into it so that it could send email notification to IT contact person if
the posting of time events resulted in errors. The email id of the IT contact person would be
maintained in a view maintainable custom Z table.
A background job program will be scheduled to run this custom posting program once every
hour to post the time events from CC1TEV interface table to TEVEN table.
All functionalities in the standard program were retained in the Z program too.
The front end of the custom Z program for posting time events was same as standard
program SAPCDT45 and is shown below:
The output of the custom Z program after posting run was same as that of standard
program SAPCDT45 and is shown below:
While exploring the possibilities of building the integration solution between SAP R/3 and
time recording system, I read at few places about building a custom ABAP program from
scratch. I would not recommend this approach and would advise to customize the
standard program RPTEUP10 so that we can leverage the file content structure put in
place by SAP. Also, the posting program of SAP has a lot of inbuilt validations which we
can leverage using this method.
Here, I come to the end of this knowledge artifact. Thanks for your patience to go
through this document. I hope this has been useful for you.
Warm regards,
Vivek Barnwal,
vianshu@gmail.com
***********************************************************************
***************************
You can also refer to other knowledge artifacts created by me at the below link: