Registration

Dear SAP Community Member,
In order to fully benefit from what the SAP Community has to offer, please register at:
http://scn.sap.com
Thank you,
The SAP Community team.
Skip to end of metadata
Go to start of metadata

Purpose

Solution to Adjust 1 cent difference in payroll processing due to multiple splits in a month

Overview

There are scenarios where multiple actions (Reporting officer Change/Transfer/Data Change) in HR master data but the amounts in wage types of info type 0008 and 0014 are not changed. Due to multiple actions it  causes multiple splits  during Payroll Processing and this may cause 1 cent difference. Example: Basic Pay Amount is 1,310.00 and there 3 data change actions in the month but no change in Basic Pay. During payroll run it causes 3 splits for Basic pay amount (557.45 + 445.96 + 306.6= 1,310.01) and the total amount of basic pay varies by 0.01.

Solution

To build a custom a function which will read the wage type and amounts from Infotype 0008 and Infotype 0014 and do a comparison with the calculated value during the payroll processing.

Custom function details are as below:

The code in the custom function  should be as below:

Include PCBURZ**0.

FORM FUZWPBP.

  DATA: LV_SUM TYPE P0008-BET01.

  CONSTANTS: LC_1CENT TYPE P0008-BET01 VALUE '0.01'.

  FIELD-SYMBOLS: <FS_IT> LIKE LINE OF IT[].

  CLEAR LV_SUM.

  READ TABLE IT TRANSPORTING NO FIELDS  WITH KEY ABART = 3.

  CHECK SY-SUBRC EQ 0.

  LOOP AT P0014.

    CLEAR LV_SUM.

    LOOP AT IT ASSIGNING <FS_IT> WHERE LGART EQ P0014-LGART.

      LV_SUM = LV_SUM + <FS_IT>-BETRG.

    ENDLOOP.

    IF ABS( P0014-BETRG - LV_SUM ) EQ LC_1CENT.

      IF ( P0014-BETRG - LV_SUM ) GT 0.

        <FS_IT>-BETRG = <FS_IT>-BETRG + LC_1CENT.

      ELSE.

        <FS_IT>-BETRG = <FS_IT>-BETRG - LC_1CENT.

      ENDIF.

    ENDIF.

  ENDLOOP.

  LOOP AT P0008.

    CLEAR LV_SUM.

    LOOP AT IT ASSIGNING <FS_IT> WHERE LGART EQ P0008-LGA01.

      LV_SUM = LV_SUM + <FS_IT>-BETRG.

    ENDLOOP.

    IF ABS( P0008-BET01 - LV_SUM ) EQ LC_1CENT.

      IF ( P0008-BET01 - LV_SUM ) GT 0.

        <FS_IT>-BETRG = <FS_IT>-BETRG + LC_1CENT.

      ELSE.

        <FS_IT>-BETRG = <FS_IT>-BETRG - LC_1CENT.

      ENDIF.

    ENDIF.

  ENDLOOP.

ENDFORM.

 
This custom function should be inserted in the factoring schema after the amounts are prorated.


Result in Payroll

As mentioned in the example the basic pay get factored as per the splits available 

The amounts get compared and the difference is added/subtracted from the last split amount  in the the custom function

Hence when the employee  views his payslip he will not find any difference in the basic pay.

Solution Designed

Satish Kumar Nair, Wang Huan & Gullapalli Krishna Kishore
  • No labels