Write your coding in user Exit : HRINHRA0 , FM - EXIT_HINCALC0_005 in the
Include ZXPPYINU04.
When Company leased accomodation is given the Annual Perk Calculation was
not calculated according to the clients requirement.
Also the negative diff rent was not shown in deductions.
*&---------------------------------------------------------------------*
*& Include ZXPPYINU04
*&---------------------------------------------------------------------*
DATA : v_amount LIKE pa0581-rtamt,
v_basis TYPE maxbt,
v_diff TYPE maxbt,
v_elig_amount LIKE pa0581-rtamt.
IF NOT _hra[] IS INITIAL.
READ TABLE _hra INDEX 1.
IF sy-subrc = 0 AND _hra-accom = '5'.
v_amount = _hra-rtamt.
_wgtyp_tab-abart = '*'.
_wgtyp_tab-lgart = '/3RI'. " Rent wage type
_wgtyp_tab-betrg = v_amount. " Rent amount
APPEND _wgtyp_tab.
CLEAR _wgtyp_tab.
*--Get basis amount
LOOP AT _it WHERE lgart = '/115'.
v_basis = v_basis + _it-betrg.
ENDLOOP.
*--Get eligible amount
LOOP AT _it WHERE lgart = '1011'.
v_elig_amount = v_elig_amount + _it-betrg.
ENDLOOP.
*--Get difference amount
* _delgrt_mon = v_elig_amount - v_amount.
*--Get Yearly basis amount
v_basis = v_basis * 12.
*--Get Yearly rent amount
v_amount = v_amount * 12.
v_diff = ( v_basis - v_amount ) * 15 / 100 .
*--Calculate Yearly eligible amount
v_elig_amount = v_elig_amount * 12 .
IF v_diff > v_elig_amount.
_tcprk = v_elig_amount.
ELSE.
_tcprk = v_diff.
ENDIF.
ENDIF.
ENDIF.
No comments:
Post a Comment