Complete Configurations & Understanding Retroactive Accounting

I. Purpose

     Payroll is one of the most important parts in SAP HCM module. In order to control Payroll Schema and Payroll processes easier, in this document Retroactive Accounting INTERNATIONAL will be explained carefully. Moreover I will give you how to make clear payslip.
     Now I will give you a typical example. I hired employee on 10-Jan-2012 with 1000$ monthly. If everything is normally, he had been run payroll in Jan-2012 and his salary as picture below:

PY_Jan.png
     However as some reasons, he had not been processed payroll in Jan yet. He's only run payroll in Feb-2012. So SAP will automatically run Payroll for this guy from Jan-2012 until Feb-2012 (2 periods). (Why does SAP know Jan-2012 should be the first period running Payroll? It's just simply basing on field Earliest MD change in Infotype 0003). After running Payroll, his salary will be accumulated as picture below:
PY_2month_Arrear no display.png
As you can see in the picture, in Feb he only has 1000, but total is 1703,703 (including both Jan and Feb). Yes, SAP automatically brings his salary on Jan-2012 into current period Feb-2012. It's called Retroactive Accounting.
II. Retroactive Accounting

     How SAP can bring employee's salary from past periods to current period? It's a sub-schema: XRRO Retroactive accounting INTERNATIONAL in Standard Schema X000.
XRRO.png
In original payroll (in our example it's Feb-2012), PCR X041 will be called.
In retro period, (I only focus on typical case), PCR X043 will be executed (in our example it's Jan-2012).

There are 2 important wage type you have to take note here. wage type /560 Payment Amount and /551 Retrocalc.difference
After running Payroll, /560 will store how much salary employee has in every period. Next, sub-schema XRR0 will be started.

  • In retro period (Jan-2012), value in /560 will be stored into Different Table by command:

X043.png
     1 record in DT for /551 will be created: For Payroll Period: 01, For Payroll Year: 2012
     DT.png
  • In original period (Feb-2012), value from DT (wage type /551) will be transferred into /560

X041.png
     Before calling X041, in Table IT, Amount of /560 is only 1000.
     Tabel IT.png
     After calling X041, Amount of /560 is accumulated:
     Tabel IT_2.png
     So salary in Jan-2012 already moved to current period Feb-2012. It's the way Retroactive Accounting INTERNATIONAL run in Payroll schema.
III. Clear Retroactive Accounting

     Thanks to sub-schema XRR0, Retroactive Accounting works smoothly. However, as you can see in payslip, only total salary's (Jan-2012 and Feb-2012) shown. If customer requests detail information displayed: they want to know all kind of salaries (in retro period) will be directly inputted on payslip instead of only total as currently, sub-schema XRR0 has to be modified.
     In my example I only demonstrate basic salary - wage type 1000. 2 more wage types are mandatory.
  • Wage Type 1002 Basic C/F (Basic Carry Forward)
     WT 1002.png
  • Wage Type 1003 Basic Arrears
     1003.png
After that, Creating new PCR ZW10 to store value of Wage Type 1000 into Wage Type 1002 in Different Table (DT):
    
ZW10.png

And PCR ZW11 to read balances carried forward (differences): NOTE: ZW11 contains logic of PCR X041:
     ZW11.png

As you can see, purpose of PCR ZW10 is: using to store value in DT so it's will be inserted after PCR X043. Logic of PCR ZW11 is: transferring data from DT into Result Table, it's the reason why it's will be putted after X041. Please look picture below to know how I modified standard sub-schema XRR0.
     ZRRW.png

Accomplishing modify your sub-schema as above, now employee's payslip will be very clear: Look at payslip, employee can see how many salaries he got in Jan-2012. It's very convenient.
PY_Feb_FullArrear.png

In my example, only wage type basic salary 1000. In your system, if there are more any more kind of wages, simply insert more into 2PCR ZW10 and ZW11 above.
IV. Retroactive Accounting with period already executed in Payroll
   
    Please keep look at another example, same employee in part III, I run actually payroll in Feb-2012. However in Mar-2012, employee was increased his salary from Feb-2012: (+500) so new salary is 1500. And run payroll, of-course his payroll will be retro from Feb-2012 until Mar-2012:
PY_Mar_Wrong.png
     
Net pay in Mar-2012 is correct: 2000 (1500 in Mar and +500 in Feb). However Arrears are wrong .
     Because I missed 1 important part, PCR X042 in XRR0 schema:
XRRO.png
  • In retro period (Feb-2012), before calling X043 (explained in Part II), X042 is executed with function Port. It brings actual Feb-2012 payroll and inserts into DT Different Table:

X042.png
1 record in DT for /551 will be created : For Payroll Period: 02, For Payroll Year: 2012 (actual salary employee received in Feb-2012). After that PCR X043 will be called.

     Now basing on logic of PCR X042 (because in standard PCR X042, only technical wage type such as /560 executed), I modified my schema ZRRW by adding new PCR to process other wage types:

ZRRW_4.png

Logic PCR ZW09 as:

ZW09.png

After running ZW09, 1 record for wage type 1002 created in DT table, value is -1000, because in actual payroll Feb-2012 (Feb-2012 in Feb-2012) his basis salary was only 1000.
DT_2.png

As you can see, in Mar-2013, I modified his salary + 500, so basic of Feb-2012 in current period Mar-2012 is 1500. And when executing PCR ZW10, value 1002 in Different Table is -1000 + 1500 = 500. Because I forgot re-using value of Feb-2012 in period Feb-2012, in payslip Arrears shown 1500.

Now everything's fine as picture below:
PY_Mar_Correct.png

Finally 3 main steps in retroactive accounting are:


1. Retrieve last payroll: how much employee received in last payroll
=> correspond to PCR X042 and my example is ZW09
2. Re-calculate this last payroll: and accumulate into DT Different Table
=> corresponding PCR X043 and ZW10
3. both steps above executed in Retro Period, last step in current period, bring value in DT into result table
=> PCR X041 and ZW11

Hope now you understand Retroactive Accounting and able to apply in your payroll schema.

Best Regards!

Carry Forward Absence Quota

I. Purpose

     One of common and complex request involving Absence Quota is carry forward from current year to next year. There are many concerns and questions posted to find appropriate solution. Thus in this document I will give you a good solution and step by step how to CARRY FORWARD absence quota. Basing on my document, you will be more easier to adapt SAP Time Management to meet your customer's expectation.
     However, there are some basic information I have already mentioned in another documents, such as: grouping Personnel Structure (EE group and EE subgroup), Enterprise Structure (Personnel Area and Personnel Sub-Area), Grouping for Time Recording and the way to generate absence quota by using Time Type, so I will not re-write it again. Please look at link Absence Quota basing on Working Date.
II. Requirement

     Here it's the customer's expectation involving Absence Quota Type 20 - Sick Leave that should be implemented in their system:
          1. Yearly Absence Quota is 30 days.
          2. Generate 2.5 days (30/12) per month for employee at the last date of month.
          3. Start available: Hiring date or 1st Jan. End available: end of year 31st Dec.
          4. If remaining >= 10 days in this year, 10 days will be carried forward to next year.
III. Solution

     First of all, you have to create 2 Time Type and overview purpose as below
     1. Time Type 9D50 will be stored value to generate Absence Quota. Whenever Time Type is not initial, Absence Quota in IT2006 will be created automatically when accomplishing run Time Evaluation PT60.
          9D50 will be generated in a customized PCR with logic below:
                    - plus 2.5 days (30/12)
                    - plus accumulated in Time Type 9WSL
                         => assign to Time Type 9WSL
                    - Clear 9WSL immediately (to be sure that duplication 9WSL will not happen).                                                                        
     2. Time Type 9WSL check whether remaining Absence Quota bigger or equal 10 or not? If it's exactly, number 10 will be inserted into Time Type 9WSL and 9WSL is a bridge to bring this value from current year to next year.
          Note: create Time Type 9WSL 1 time per year, after accomplish generated Absence Quota on 31st Dec. So 9WSL exists only from 31st Dec to end of Jan next year. Why? because whenever last of month is coming, 9D50 will be inputted value and 9WSL will be blank So from Feb to Dec, 9WSL always equals 0.
     These are important points. From now steps by steps in configuration V_T559L and Time Schema also will be mentioned here.
1. Grouping

     As mention at the beginning, the Grouping I will use here: EE: 2, PA: 09 and Time Recording: 01.
2.Constant and Time Type

     2.1. ZPLEL Yearly absence quota is 30, it's maintained in V_T511K
ZPLEL.png
     2.2. Time Type 9D50
     It's only used 1 time per month so it's configuration is really simple. Just save as day balance.
9D50.png
     2.3. Time Type 9WSL
     As you can see the purpose of 9WSL, storing value on last day of year and bring to next year, so you have to configure as picture below:
Activate "Transfer previous year". Without choosing this function, whenever 1st Jan comes, value in 9WSL will be blank. It means value calculated on 31st Dec will not carried to the day after - 1st Jan.
9WSL.png
3. Configure in V_T559L
     With grouping above, there are steps for configuring in Table view Automatic Absence Quota Generation.
     3.1. Base Entitlement tab: of course it's will be assigned to Time Type 9D50.
Base entitl.png
     3.2. Transfer tab: it's important tab. Specifies the time at which the accrual entitlements are transferred to the Absence Quotas infotype (2006) to be made available for deduction. As the absence quota has to created monthly (at the last day of every month), so "Per time Evaluation Period" is necessary.
Transfer.png
     If you choose "Per calendar year", assuming that from Jan - Nov, employee has 2.5 days Sick Leave every month, but when you open IT2006 in PA20, you cannot see Sick Leave. Why? because Transfer time to IT2006 is Calendar year, it's only transfer value in Time Type 9D50 to IT2006 on 31st Dec.

     Co-operation with Validity/deduction interval in index 3.3. It will help us accumulate Absence Quota monthly into yearly.
    3.3. Validity/deduction interval
Validity Deduction interval.png
     As mention in 3.2, both of them will create Absence Quota monthly but accumulate yearly
     Transfer time is monthly, so whenever 9D50 is not blank, Absence Quota will be generated in IT2006 with period is:
          Begin Date : Calendar Year (Start) => normally it's hiring date in 1st year, and 1st Jan from second year.
          End date: Calendar Year (End) => always 31st Dec.
    Deduction Period:
          Begin Date : Start of validity interval: it's Calendar year (chosen last step): => hiring date or 1st Jan.
          End date: End of validity interval: it's Calendar year => always 31st Dec.

     For example: employee joined company on 1st-Oct-2011
          in Oct-2011, employee has 2.5 days in 9D50, in IT2006: 1 record:
               Start 01.10.2011 - end 31.12.2011, Number 2.5, deduction: Start 01.10.2011 - end 31.12.2011.
          next month Nov-2011:
               just update record above:
               Start 01.10.2011 - end 31.12.2011, Number 5.0, deduction: Start 01.10.2011 - end 31.12.2011.
          in Dec-2011
               Start 01.10.2011 - end 31.12.2011, Number 7.5, deduction: Start 01.10.2011 - end 31.12.2011.
    3.4. Other tabs aren't important so only sharing:
Applicability.png
Accural Period.png
Accural Entitl.png

Total.png
4. Time Schema and PCR
    4.1. Time schema ZW04:
    Copy new Schema from TM04 and insert new schema with structure below:
ZW04.png
     NOTE: you have to insert PCRs in order as same as I have done here.
     The logic already explained in this picture. Only call PCR ZW6C (creating Time Type 9D50) for generating Sick Leave Quota If EOM is true
     CUMBT: update value of time type in database.
     QUOTA: update absence quota and create new / modify records in IT2006.

     Next, check 31st Dec by ZI51, it's correct, ZW51 will be call to update value for Time Type 9WSL. After that CUMBT must be call again.
     4.2: PCR ZW6C
     ZW6C SL balance.png


HRS=CZPLELGet value ZPLEL in V_T511K, it's 30.

HRS/12Divide 12, current value is 2.5

HRS+M9WSLPlus Accumulate value of 9WSL into HRS.

ADDDB9D50ZAdd into Time Type 9D50

HRS=0HRS = 0

ADDMB9WSLZClear 9WSL
        4.3: PCR ZI51
     ZI51-31stDec.png
     4.4. PCR ZW51
     ZW51 - Carry Absense Quota.png

HRS=FR20CGet Absence Quota left with subtype 20 in IT2006

HRS?10     Comparing with 10

*>=

HRS=10HRS=10

ADDDB9WSLZAssign to 9WZL to carry forward

<<

LEAVE
     That's all Next part is testing to be sure that solution is correct

IV. Testing

     Hiring employee on May-2011
IT0.png
     Running PT60 until 31st May 2011, 2.5 Absence Quota with period from 01.05.2011 to 31.12.2011
     => It's correct
     Running PT60 until 31st Dec 2011, 20 days (from May to Dec: 8 months) Absence Quota with period from 01.05.2011 to 31.12.2011
     => It's correct
IT2006_Dec.png

     Running PT60 until 31st Jan 2012, 12.5 days (10 days in 2011 and 2.5 days in Jan 2012) Absence Quota with period from 01.01.2012 to 31.12.2012
     => ALL is correct
IT2006_Jan.png

Note: Another solution is using UPDTQA** (update Absence Quota directly, not use Time Type). You can follow my explanations in thread: http://scn.sap.com/thread/3298211

Best Regards!

Absence Quota basing on Working Date

I. Purpose

            This document will help you more deeply understand Absence Quota Generation and Time Schema. I have seen a lot of question involving Time Schema - one of the most difficult things in SAP HCM,so I hope the document will support you better to control Time Schema. In document, I will generate Absence Quota by using Time Schema. I have to create many PCRs with quite complex logic and input them into many where in Time Schema. You can find how to link mater data, controlling Time Type and processes of Time Evaluation.
          Note: before looking at the document, basic knowledge in Absence Quota must be investigated carefully first.

II. Requirement

         I will focus on 1 actual customer's expectation. It's one of common request whenever implementing or supporting SAP HCM in enterprise's system:
          1. Employee will has 1 Paid Leave Quota after having 20 working days on system.
          2. Working date is: when he has Attendance on IT2002 (of-course not including the day off: Saturday or Sunday), and has full check-in and check out in Time Events IT2011.
          3. Absence Quota'll generated yearly.
          4. Only Available for applying from the next year, until 31.12.9999

III. Solution


          First in Time Schema, you have to calculate Working Days by using data from 2 Infotype: 2002 (Attendances) and 2011 (Time Events), thus we have to copy from standards schema TM00 to our schema and modifying it. Standard Functions in Time Schema retrieve data from 2 Infotype and post them into internal table TIP, in Schema - useful links & T-Codes there is useful link to understand how time data stored in TIP. In order to retreive data in TIP, standard functions RTIP or PTIP must be used to get data and then checking it.
          Origin indicator of TIP as below
                    E = Time event
                    O = Overtime from Overtime infotype (2005)
                    A = Absence from Absences infotype (2001)
                    P = Attendance from Attendances infotype (2002)
                    R = Availability from Availability infotype (2004)
                    D = Generated planned pair
                    C = Attendance/absence reasons
          So we will check: if origin indicator is P, 1 working day will be counted. If origin indicator is E, next step is checking whether in that day employee has full check in check out or not. These points above will accumulate Working Date Total into 1 Time Type.

          Next checking whether the last date coming, Working Date Total divide 20 and giving these number to Absence Quota. So in Time Evaluation, we have to check whenever 31-Dec is run.
          It's just summarization. Now steps be steps will be shown in order from here.

1. Grouping


Personnel Structure (EE group and EE subgroup)
Using Table View V_503_E in T-Code SM31 / SM30. My grouping is 2.

V_503_E.jpg
Enterprise Structure (Personnel Area and Personnel Sub-Area).
Using Table View V_001P_I. It's 08

V_001P_I.jpg
Grouping for Time Recording:
Using Table View V_001P_H
V_001P_H.jpg

2. Base Entitlement

As you can see, 3 grouping values above will be used here (2, 08 and 01).
BaseEntilement.jpg
Thanks to time type 9D50, whenever we assign value to 9D50, Absence Quota Type 10 (Paid Leave) in IT2006 will be created. The configuration of Type Type 9D50, nothing is important with configuration of 9D50
9D50.jpg

3. Counting Working Days


As I mention at the beginning in solution part, the PCR ZWA1 has logic as below (using T-Code PE02 to create PCR).
ZWA1.jpg
Operation "OUTTPORIGS Origin status" returns Origin status in internal table TIP (E: data inputted from IT2011, P data inputted from IT2002).
Operation "OUTTPEXTIM Times exist?" checks whether Time Event has full check in and check out or not. Y means it's correct, both check in and check out exist.

The day fits conditions here, Time Type 9M99 will be accumulated 1. It's configuration of 9M99
9M99.jpg
Cumulate in period balance is 1: The time type is cumulated in a period balance. Our period here is month.
2 Transfer previous are clear right? because we just generate on last date of year so we have move data all months (from Jan to Nov) into Dec.
Transfer previous year is up to you. In my schema, it isn't necessary because in 31st Dec, Absence Quota is generated, so Accumulated working days will be blank.
Now using with Function RTIP / PTIP in Time schema (IMPORTANT)
I copied schema ZW01 from TM00 in T-Code PE01.
After successfully calling Function P2011, P2002, P2001, etc, ZWA1 is inserted into Time Schema with Function RTIP.
ZW01_ZWA1.jpg
This is these all logic to calculate Working Days.

4. Checking EOY (Dec-31st)

Creating 1 PCR to check whether month is Dec or not.
ZI15.jpg
VARSTCURMO Current period: it returns current period (not current system , current period is the month that Time Evaluation is running. For example if you are running PT60 for 2 months: Jan to Feb, so the first current period is Jan, after accomplish running for all days in Jan, current period will be Feb).
Next ZI15 is inserted into Time Schema ZW01.
ZW01_ZWA2.jpg
As you can see, 1st check Dec, 2nd check EOM, the day fitting 2 conditions is Dec-31st, the last date of Dec. There are many solutions for checking Dec-31st. You can check by using Month and Day directly by using 2 operations: HRS=BCURDY :      current day; HRS=CURMO :      current month period

On Dec-31st, ZWA2 will be called to generate Absence Quota. Next point will explain the PCR. Note: these PCRs have to inserted Time Schema before 2 standard Functions: CUMBT and QUOTA.

5. Generate Absence Quota.

PCR ZWA2 will take responsibility to generate Absence Quota.
ZWA2.jpg
Retrieving Accumulated Working Days in 9M99 by HRS=M9M99. Must plus with D9M99 (Daily value of 9M99, because only running CUMBT, Daily time type value will be updated into Accumulated time type).
Comparing with constant in V_T511K ZZ000 (it's 20). If accumulated working days is lower than 20 until last day of year, I will clear by assigning 0 to them.
Other while, Accumulated Woring Days divides ZZ000 and inserts into time type 9D50. After that clearing value of 9M99.
V_T511K.jpg

These's all done for calculating Working Days Yearly and updating value into Absence Quota in IT2006 throung time type 9D50.

6. Period in Absence Quota

Next, I will show how to generated yearly and Available for applying from the next year, until 31.12.9999.
It's done in Table View V_T559D with grouping 2, 08 and absence Quota 10 Paid Leave

Deduction Period.jpg
Validity Interval: it's period for Start Date and End Date in IT2006. In these picture, on the left, it's Start of Calendar Year (normally it's Jan-01st), and the right it's End of Calendar Year( of course it's Dec-31st).
Deduction Interval: it's period that employee can be apply your Absence Quota.
Deduction From: End of validity interval, it means Dec-31st. But looking Relative Position: 1 Days. So Deduction From will start from Dec-31st + 1 days, so it will be Jan-01st of next year
Deduction To: as same as Deduction From but relative is 999 Month so it'll be 31.12.9999.

That's all Next part is testing to be sure that solution is correct

IV. Testing


Hiring employee in Grouping 2, 08 and 01 on Jan-01st-2010.
IT0000.jpg
1st case: having only 2 attendance records in IT2002
IT2002.jpg
Attendance Total: 26 (Jan) + 26 (Oct) = 52 days.
After running PT60 until Dec-31st:
     Employee has 2.6 days in Absence Quota ( 52/20 = 2.6).
     Period: 01.01.2010 -> 31.12.2010.
     Deduction period: 01.01.2011 -> 31.12.9999
               => All is correct
IT2006_no2011_2.6.jpg
2nd case: Inputting more 2 days full check in and check out (for case miss check in/ check out, I tested but not post here & moreover I have test same case in Understanding Relationship PT and PY):
IT2011.jpg
Working days = 52 (attendance in IT2002) + 2 ( in IT2011) = 54 days.
After running PT60 until Dec-31st:
     Employee has 2.7 days in Absence Quota ( 54/20 = 2.6).
     Period: 01.01.2010 -> 31.12.2010.
     Deduction period: 01.01.2011 -> 31.12.9999
               => All is correct
IT2006_2011_2.7.jpg

Regards!