Skip to Content

I. Requirement

     There is a quite complicated requirement: calculate average 6 month Basic Salary for employee. For example: in Jun, average basic salary will be computed from Jan, Feb, Mar, Apr, May and Jun. but in Jul: start month from Feb until Jul. The most difficult here: how can system can store value from period to period, move corresponding to current period and no issue when having any retroactive accounting.

II. Solution   

     In order to resolve the request, you have to be clear how payroll processing with some table: IT, OT, etc and Functions and Operations as well. It’s quite take time to explain very detail about it. So please investigate SAP documents for some Functions: PIT, operations ADDWT, AMT, etc in T-code PDSY. It’s not too much difficult but a lot efforts to control it. I assume that you understand the prerequisites above.

     My solution as below:

     1. Create 6 wage type ( index from 00, 01, 02, 03, 04, 05) to store basic salary.

     2. Keep in mind these logic

          – wt 00 only contains current basic salary

          – wt 01 only contains Last value of wt 00 (if it’s NULL, ONLY in golive period or 1st period running payroll, using current basic salary or Avg 6mon Basic Golive inputted manually)

          – the same logic will be applied for others from wt 03, wt 04 and wt 05.

     3. After having value in these wage types, you just simply total and divide 6. It’s very easy so I don’t care about it. I will focus only the step 2.

1. Configuration Wage type: Create 6 wage types (sharing same configurations in V_512W_D) and please note processing class 6:

/wp-content/uploads/2013/05/00_06_218792.png

/wp-content/uploads/2013/05/00_218793.png

2. PCR

     There are some PCR will re-produce solution steps mentioned in step 2:

ZV20.png

ZV21.png

     There are total 5 PCR (from ZV20 to ZV24). Basic Salary is wt 1000 and Avg 6mon Basic Golive is wt 5901.

     In the first PCR, there are some steps I would like to explain in order to be easier to understand

          – Output wt 1000 from internal table IT to output table OT to process. Insert current AMT into wt 00 (wt 8000). (100% fits with 1st step above Keep in mind these logic)

          – Get last value of wt 00 (wt 8000), if it’s > 0, assign to wt 01 (wt 8001).

               Otherwise (Only in golive period or 1st period running payroll), check Avg 6mon Basic Golive.

               If Avg 6mon Basic Golive = 0, get Basic Salary and assign to wt 01 (wt 8001). Else wt 01 (wt 8001) equals Avg 6mon Basic Golive.

3. Schema

     Should include your PCR before processing class 10 in sub-schema XAL9 Factoring and storage. With my case I insert it into sub-schema XAP9 Import additional payments/deductions. I captured payroll schema when running display mode, as it’s very important way to deeply and fast control and understand Payroll Schema

/wp-content/uploads/2013/05/schema_218796.png

III. Testing

     Look at employee who has a complicated basic salary.

Basic.png

     And Avg 6mon Basic Golive (if you don’t input the wt, system will get from current basic salary in 1st period running payroll )

Golive average.png

     Now running Payroll in 1st period – Jan and Jun.

     In JANUARY: (6 wt (00 -> 05) contain correctly values: wt 00 (wt 8000) – current basic 300, other Avg 6mon Basic Golive 150.

Jan.png

     In JUNE: (6 wt (00 -> 05) are exactly: wt 00 (wt 8000) – current basic Jun 400, wt 01 (wt 8001) – basic in May: 400, wt 02 (wt 8002) – basic in Apr: 350, wt 03 (wt 8003) – basic in Mar: 400, wt 04 and wt 05 (wt 8004 & wt 8005) both base in Jan and Feb – 300).

Jun.png

To report this post you need to login first.

7 Comments

You must be Logged on to comment or reply to a post.

  1. Chinna SAP HR

    Hi Woody,

    Good work.

    If I am working for India can i copy those  wagetype from MB10 whiach is model wage type for basic pay?

    Thnx in advance

    (0) 
    1. Trong Minh (Woody) Nguyen Post author

      I have implemented 1 project with special requirement as below (basing on Labor law 🙂 ), when employee retires, employee will get 1 month salary for 1 working year. Salary is the average salary under the labor contract of the preceding 06 months before the employee is dismissed. And whenever employee raises Leave Request (sick or maternity leave), employee’s allowances are base on Average 6 month Basic Salary. Actually there are a lot of requirements involving average Salary, so I would like to share solution with you guys 🙂

      Regards!

      Woody

      (0) 
        1. Trong Minh (Woody) Nguyen Post author

          Thanks Swapnil 🙂 Actually it’s quite difficult, it took a long time for me to find the solution, so I would like to contribute to our SCN, hope it’s helpful 🙂

          Regards!

          Woody

          (0) 
  2. Giriesh Chakaravarthy Mamurugan

    Hi Woody,

    Nice Document. I have tried to do the same but got struck at a point. I tried to read the LRT of 1001 WT. I am getting the WT 8000 value for current value of WT 1001 but the 8001 for the past LRT i.e,. WT 8001,02,03,04,05 it is not showing the Past LRT results. I have checked your document as well and my WT PC – 6 is in 1. Any further changes to be done ? If I am using AMT=O 1001 it gets the value from VORT table but AMT=L 1001 doesn’t.

    With Regards,

    Giriesh M

    (0) 
    1. Trong Minh (Woody) Nguyen Post author

      Hi Giriesh M,

      I believed you have had your own solution already as I’ve seen your blog. Congratulations!

      Regarding your query, LRT is standard table provided by SAP, can you double check again whether your PCR is putting correctly in schema? You may put in a wrong part.

      In standard X000, SAP use sub-schema XLR0 to import last payroll result by checking PC06

      PORT  X006 P06  NOAB  

      Transfer relevant data to LRT

      Hope you can handle it soon.

      Best Regards,

      Woody

      (0) 

Leave a Reply