Introduction
About 6 years back, I started my career in SAP HCM and over a period of one year, I realized that I enjoyed calculations and numbers and that is how my interest in SAP HCM Time Management and Payroll developed.
At that point of time, I expressed my interest to learn time management and payroll to one of my colleagues and asked him the best way to learn these modules. And his advice was a simple one – run time evaluation and payroll for an employee and go through every step of log to understand how the data is getting processed.
I did what he advised for time management and in this process, I came to know a lot of functions and operations. And you guessed it right, it took me quite some time. But it made me confident to understand and analyze the time evaluation and payroll logs.
However, there was one missing piece in the entire puzzle which I didn’t understand regarding time evaluation and that was the usage of time types. Because of this, I wasn’t able to write PCRs to achieve different requirements in time evaluation. I was more like a car mechanic who could identify and fix a problem in a car if it wasn’t working. But I wasn’t a person who could build a car from scratch. I hope you are able to understand what I mean by this.
Finally, I attended one training where the trainer provided me clarity on time types and their usage.
Time types are the DNA of time PCRs and without them, you won’t be able to build solutions for various requirements in time evaluation. Hence, it is very important that we understand its functionality very well.
Time Types
Time types are similar to wage types in payroll. They are used to store hours and give a definition and meaning to these hours. They can be used for various purposes as mentioned below:
- No. of hours a person worked
- No. of hours worked within the work schedule
- No. of hours of overtime worked
- Flagging that an incident has happened. Let us say that a particular overtime allowance can’t be given more than once in a month. Hence, you need to flag that you have already given this overtime allowance once in the month.
Time Types Generation
There are two ways to generate time types in time evaluation:
Through function: In case of positive time management, function TIMTP assigns time types to time pairs in Table TIP as per the configuration maintained in Table V_T555Z.
Schema TM00
Table V_T555Z
In case of negative time management, function TYPES assigns time types to time pairs in Table TIP as per the configuration maintained in Table T555Y.
Schema TM04
Table T555Y
Table TIP is an internal time evaluation runtime table. It doesn’t flow to the final output. Hence, Standard SAP uses PCR TR10 to cumulate the value of the time types in time pairs and transfer the final value to time types in Table TES. Finally, function CUMBT moves the time types from Table TES to Tables ZES and SALDO based on the configuration of time types in Table V_T555A.
Through PCR – To achieve different scenarios in time evaluation, time types also get generated in PCR using operations ADDDB (for day balances) and ADDMB (for period balances). Using operation ADDDB, the time types get stored in Table TES. Finally, function CUMBT moves the time types from Table TES to Tables ZES and SALDO based on the configuration of time types in Table V_T555A.
Using operation ADDMB, the time types get stored in Table SALDO. We will discuss more about operations ADDDB and ADDMB later in the document.
Types of Time Types
As per the explanation given by my trainer, there are four different types of time types.
- Daily Time Type
- Monthly Time Type
- Yearly Time Type
- Eternally Cumulating Time Type
Time types are configured in Table V_T555A.
Daily Time Type
A daily time type is a time type which gets generated for the given day and gets initialized every day. It means that it will store value only for the given day and will never cumulate. A daily time type will get generated in PCR using operation ADDDB and stored in Table TES initially. Function CUMBT will pass the value of daily time type from Table TES to Table ZES based on the configuration of the field “Save as day balance”.
Below is an example of daily time type.
The field “Save as day balance” has the below options:
0 or Blank | No balance formation | These time types are created and stored in Table TES during time evaluation run. However, they are not stored in Table ZES using function CUMBT. An example of such a time type is utility time types 0000 and 0001 from standard. |
1 | Balance formation | These time types are created and stored in Table TES during time evaluation run. They are finally stored in Table ZES using function CUMBT. |
2 | Balance Formation without preceding cancellation | The day balance is not deleted if there is a recalculation. |
Monthly Time Type
A monthly time type is a time type which gets generated on a given day, stores value for the given month and gets initialized at the beginning of next month. It means that it will store and cumulate the value for the month before starting from 0 next month.
A monthly time type can get generated using operation ADDDB or ADDMB. If you are generating it using operation ADDDB, then the time type should look like below:
If you are generating it using operation ADDMB, then it is sufficient to have 1 as the value for field “Cumulate in period balance”.
The field “Cumulate in period balance” has the below options:
0 or Blank | No balance formation | These time types are not stored in Table SALDO. These are required only during time evaluation run and are not required to be saved. |
1 | Balance formation | These time types are stored in Table SALDO. They can get created in Table TES as daily time type using operation ADDDB and then get stored in Table SALDO using function CUMBT. Or they can get directly stored in Table SALDO using operation ADDMB. |
2 | Balance Formation without preceding cancellation | The period balance is not deleted if there is a recalculation. |
Yearly Time Type
A yearly time type is a time type which gets generated on a given day, stores value for the given year and gets initialized at the beginning of next year. It means that it will store and cumulate the value for the year before starting from 0 next year.
A yearly time type can get generated using operation ADDDB or ADDMB. If you are generating it using operation ADDDB, then the time type should look like below:
If you are generating it using operation ADDMB, then it is recommended to have 1 as the value for field “Cumulate in period balance” and “Transfer prev. period”.
The field “Transfer prev. period” has the below options:
0 or Blank | No transfer | The period balance is not transferred from the previous period (month). The value of the time type will get initialized (turn to 0) in Table SALDO for the new month. |
1 | Transfer | The period balance is transferred from the previous period and values for the new period get cumulated in the same time type in Table SALDO. This time type will get initialized (turn to 0) at the start of new year. |
Eternally Cumulating Time Type
An eternally cumulating time type is a time type which gets generated on a given day and stores its value eternally in Table SALDO till it is forcefully initialized (forcing the value in Table SALDO to start from 0).
An eternally cumulating time type can get generated using operation ADDDB or ADDMB. If you are generating it using operation ADDDB, then the time type should look like below:
If you are generating it using operation ADDMB, then it is recommended to have 1 as the value for field “Cumulate in period balance”, “Transfer prev. period” and “Transfer prev. year”.
The field “Transfer prev. year” has the below options:
0 or Blank | No transfer | The period balance is not transferred from the previous year. The value of the time type will get initialized (turn to 0) in Table SALDO for the new year. |
1 | Transfer | The period balance is transferred from the previous year and values for the new year get cumulated in the same time type in Table SALDO. This time type will never get initialized until it is forced to initialize in a PCR using operation ADDMB. |
Let us now go through three other fields in the time type table:
- Period bal. prev. period – The period balance of previous period is transferred to a different time type. One must specify the time type to which the balance needs to be transferred.
- Period bal. prev. year – The period balance of previous year is transferred to a different time type. One must specify the time type to which the balance needs to be transferred.
- Store of time accounts – If this field has value 1, then the period balances are stored in Table ST in cluster B1. These period balances will get downloaded on to the time recording system using the info fields of HR Mini-Master. This will enable employees to view their period balances at the time recording system. A maximum of ten balances can be downloaded to the time recording system to allow employees to view their balances there. This functionality is possible only if the time recording system supports this.
Operations ADDDB and ADDMB
Operation ADDDB
The syntax for operation ADDDB is ADDDBXXXXY where XXXX is time type and Y is control indicator for cumulation. Operation ADDDB adds the value from the no. of hours field to the time type determined by parameter XXXX in day balances table TES.
XXXX can have below values:
- * – Time type currently being processed.
- XXXX – Time type XXXX is used.
Y can have below values:
- Blank – The value will be added to a value that already exists in the time type.
- Z – The value that already exists in the time type will be overwritten.
- T – Planned working hours are filled in the time type.
Operation ADDMB
The syntax for operation ADDMB is ADDMBXXXXY where XXXX is time type and Y is control indicator for cumulation. Operation ADDMB adds the value from the no. of hours field to the time type in the period balances internal table (SALDO).
XXXX can have below values:
- * – Time type currently being processed.
- XXXX – Time type XXXX is used.
Y can have below values:
- Blank – The value will be added to a value that already exists in the time type.
- Z – The value that already exists in the time type will be overwritten.
- T – Planned working hours are filled in the time type.
Important: SAP recommends to use operation ADDMB in period end processing under IF EOM. If we use operation in day processing (between BDAY and EDAY), it will cause errors if there is a recalculation. Below screenshot shows where ADDMB needs to be used.
You may have a requirement where you wish to reduce the value of period time type to 0 if a certain event has occurred in a given month. You can do it using operation ADDDB or ADDMB.
Using Operation ADDMB to reduce Period Balances to 0
If you are using operation ADDMB, then you can reduce the period balances to 0 at the start of next month. Let us say that the requirement is that whenever Ramadan period ends, certain period time types should be reduced to 0.
Please refer the below configuration of PCR and schema.
The PCR ZTAV gets executed only at the end of the month. Let us say that Ramadan period starts in Dec and ends in Jan and we have two eternally cumulating time types which store values during the Ramadan period. The requirement is to reduce the value of eternally cumulating time types ZAIL and ZRIL to 0 after the end of Ramadan period. Whenever Ramadan period ends, we can generate a monthly time type ZRED with a value of 1. On 31-Jan, the value of ZRED is read using operation HRS=MZRED and if it is greater than 0, it means Ramadan period has ended in Jan and we pass a value of 0 using HRS=0 and add it to Table SALDO using operation ADDMBZAILZ and ADDMBZRILZ. Since we are using Z after the time types ZAIL and ZRIL, the existing value of ZAIL and ZRIL in Table SALDO is overwritten with 0. On 01-Feb, the value of ZAIL and ZRIL in Table SALDO will be 0.
Using Operation ADDDB to reduce Period Balances to 0
If you are using operation ADDDB, then you can reduce period balances to 0 on any day. Below is an example of standard PCR where it has been used. The value of period balance 0904 is being reduced to 0 at the start of every week.
Functioning of Day Balances and Period Balances
Let us now go through the values of day balances and period balances in Table ZES and Table SALDO over several days using a simple PCR. Below is the PCR which I have written.
The functionality of the above PCR is to add a value of 1 to the time types ZDTM (daily time type), ZMTM (monthly time type), ZYTM (yearly time type) and ZETM (eternally cumulating time type) for each day of time evaluation run. If the value has been added for a given time pair once for the day, it isn’t added again. Also, all existing values of these time types are overwritten with value 1 for the given day.
The custom PCR Z123 is placed in a custom version (Z123) of negative time schema TM04 as shown in the screenshot below:
An employee has been hired on 25-Nov-13 and we will run time evaluation for this employee from 25-Nov-13 till 05-Jan-14 and I will show you the value of all the time types in Table ZES and Table SALDO over various days.
IT0000
Date: 25-Nov-13
Table ZES
Table SALDO
The time type ZDTM is not present in Table SALDO because the time type ZDTM is a daily type.
Date: 30-Nov-13
Table ZES
Table SALDO
Between 25-Nov-13 and 30-Nov-13 (including both the days), the time evaluation has run for 6 days and hence, the value of time types ZMTM, ZYTM and ZETM in Table SALDO is 6.
Date: 01-Dec-13
Table ZES
Table SALDO
The value of time type ZMTM is 1 because it is a monthly time type and gets initialized at the start of the month. On 01-Dec-13, the time evaluation has run for 1 day for monthly time type ZMTM and hence, its value in Table SALDO is 1.
Between 25-Nov-13 and 01-Dec-13 (including both the days), the time evaluation has run for 7 days and hence, the value of time types ZYTM and ZETM in Table SALDO is 7.
Date: 31-Dec-13
Table ZES
Table SALDO
There are 31 days in December and hence, the value of monthly time type ZMTM in Table SALDO is 31. Between 25-Nov-13 and 31-Dec-13, there are 37 days (including both the days) and hence, the value of time types ZYTM and ZETM in Table SALDO is 37.
Date: 01-Jan-14
Table ZES
Table SALDO
The value of time types ZMTM and ZYTM on 01-Jan-14 in Table SALDO is 1 since these time types get initialized. However, the value of time type ZETM is 38 since there are 38 days between 25-Nov-13 and 01-Jan-14 (including both the days).
Date: 05-Jan-14
Table ZES
Table SALDO
The value of time types ZMTM and ZYTM on 05-Jan-14 in Table SALDO is 5 since the time evaluation has run for 5 days in January. However, the value of time type ZETM is 42 since there are 42 days between 25-Nov-13 and 05-Jan-14 (including both the days). The value of time type ZETM will keep on cumulating eternally till it is forced to initialize in a PCR.
Here, I come to the end of this knowledge artifact. Thanks for your patience to go through it. I hope with this understanding of time types, you will be in a better position to write PCRs to achieve various time related requirements in time evaluation.
Leave A Comment?
You must be logged in to post a comment.