You are on page 1of 8

Modifying Wage Type Amount value in transaction PA20 and PA30

By Srinivasa Rao Kathula, IBM India Scenario: This document describes changing or modifying Wage Type Amount (Infotype 0008) data in PA20 and PA30. Technical Information: BADI HRPAD00INFTY will be triggered whenever display/change any of PA Infotype data in transaction either PA20 or PA30. Go to Transaction SE19; create an implementation for BADI HRPAD00INFTY which starts with Y or Z. Here the implementation name given was ZTEST_PA20_PA30.

Click on button

for activating created BADI implementation.

Add code in the method BEFORE_OUTPUT in the created BADI Implementation.

Click here to continue... Example: Changing or Modifying Wage Type Amount display for the Wage Type 1003 in Infotype 0008. Here is the sample code for the above example. This code alters the amount displayed for the wage type 1003 from 4583.33 USD to 23000.00 USD in Infotype 0008 screen whenever the user tries to change/display from PA20 or PA30. Sample Code: IF innnn-infty = '0008'. FIELD-SYMBOLS <fs_amount> TYPE ANY. DATA: wa_0008 TYPE p0008, lv_wgetype TYPE pa0008-lga01, lv_payment TYPE t510-betrg, lv_syindex TYPE sy-index. *** Importing data from innnn to the structure wa_0008 CALL METHOD cl_hr_pnnnn_type_cast=>prelp_to_pnnnn EXPORTING prelp = innnn IMPORTING pnnnn = wa_0008. *** Finding Wage Type field number for the Wage Type 1003 DO 40 TIMES VARYING lv_wgetype FROM wa_0008-lga01 NEXT wa_0008-lga02. IF lv_wgetype = '1003'. lv_syindex = sy-index. ENDIF. *** New Wage Type Amount lv_payment = 23000. *** Changing or Modifying Wage Type Amount with New Wage Type Amount case lv_syindex. when 1. ASSIGN ('(MP000800)p0008-bet01') TO <fs_amount>. <fs_amount> = lv_payment. EXIT. when 2. ASSIGN ('(MP000800)p0008-bet02') TO <fs_amount>. <fs_amount> = lv_payment. EXIT. when 3. ASSIGN ('(MP000800)p0008-bet03') TO <fs_amount>. <fs_amount> = lv_payment.

EXIT. when 4. ASSIGN ('(MP000800)p0008-bet04') TO <fs_amount>. <fs_amount> = lv_payment. EXIT. when 5. ASSIGN ('(MP000800)p0008-bet05') TO <fs_amount>. <fs_amount> = lv_payment. EXIT. when 6. ASSIGN ('(MP000800)p0008-bet06') TO <fs_amount>. <fs_amount> = lv_payment. EXIT. when 7. ASSIGN ('(MP000800)p0008-bet07') TO <fs_amount>. <fs_amount> = lv_payment. EXIT. when 8. ASSIGN ('(MP000800)p0008-bet08') TO <fs_amount>. <fs_amount> = lv_payment. EXIT. when 9. ASSIGN ('(MP000800)p0008-bet09') TO <fs_amount>. <fs_amount> = lv_payment. EXIT. when 10. ASSIGN ('(MP000800)p0008-bet10') TO <fs_amount>. <fs_amount> = lv_payment. EXIT. when 11. ASSIGN ('(MP000800)p0008-bet11') TO <fs_amount>. <fs_amount> = lv_payment. EXIT. when 12. ASSIGN ('(MP000800)p0008-bet12') TO <fs_amount>. <fs_amount> = lv_payment. EXIT. when 13. ASSIGN ('(MP000800)p0008-bet13') TO <fs_amount>. <fs_amount> = lv_payment. EXIT. when 14. ASSIGN ('(MP000800)p0008-bet14') TO <fs_amount>. <fs_amount> = lv_payment. EXIT. when 15. ASSIGN ('(MP000800)p0008-bet15') TO <fs_amount>. <fs_amount> = lv_payment. EXIT. when 16. ASSIGN ('(MP000800)p0008-bet16') TO <fs_amount>. <fs_amount> = lv_payment. EXIT. when 17. ASSIGN ('(MP000800)p0008-bet17') TO <fs_amount>. <fs_amount> = lv_payment. EXIT.

when 18. ASSIGN ('(MP000800)p0008-bet18') TO <fs_amount>. <fs_amount> = lv_payment. EXIT. when 19. ASSIGN ('(MP000800)p0008-bet19') TO <fs_amount>. <fs_amount> = lv_payment. EXIT. when 20. ASSIGN ('(MP000800)p0008-bet20') TO <fs_amount>. <fs_amount> = lv_payment. EXIT. when 21. ASSIGN ('(MP000800)p0008-bet21') TO <fs_amount>. <fs_amount> = lv_payment. EXIT. when 22. ASSIGN ('(MP000800)p0008-bet22') TO <fs_amount>. <fs_amount> = lv_payment. EXIT. when 23. ASSIGN ('(MP000800)p0008-bet23') TO <fs_amount>. <fs_amount> = lv_payment. EXIT. when 24. ASSIGN ('(MP000800)p0008-bet24') TO <fs_amount>. <fs_amount> = lv_payment. EXIT. when 25. ASSIGN ('(MP000800)p0008-bet25') TO <fs_amount>. <fs_amount> = lv_payment. EXIT. when 26. ASSIGN ('(MP000800)p0008-bet26') TO <fs_amount>. <fs_amount> = lv_payment. EXIT. when 27. ASSIGN ('(MP000800)p0008-bet27') TO <fs_amount>. <fs_amount> = lv_payment. EXIT. when 28. ASSIGN ('(MP000800)p0008-bet28') TO <fs_amount>. <fs_amount> = lv_payment. EXIT. when 29. ASSIGN ('(MP000800)p0008-bet29') TO <fs_amount>. <fs_amount> = lv_payment. EXIT. when 30. ASSIGN ('(MP000800)p0008-bet30') TO <fs_amount>. <fs_amount> = lv_payment. EXIT. when 31. ASSIGN ('(MP000800)p0008-bet31') TO <fs_amount>. <fs_amount> = lv_payment. EXIT. when 32.

ASSIGN ('(MP000800)p0008-bet32') TO <fs_amount>. <fs_amount> = lv_payment. EXIT. when 33. ASSIGN ('(MP000800)p0008-bet33') TO <fs_amount>. <fs_amount> = lv_payment. EXIT. when 34. ASSIGN ('(MP000800)p0008-bet34') TO <fs_amount>. <fs_amount> = lv_payment. EXIT. when 35. ASSIGN ('(MP000800)p0008-bet35') TO <fs_amount>. <fs_amount> = lv_payment. EXIT. when 36. ASSIGN ('(MP000800)p0008-bet36') TO <fs_amount>. <fs_amount> = lv_payment. EXIT. when 37. ASSIGN ('(MP000800)p0008-bet37') TO <fs_amount>. <fs_amount> = lv_payment. EXIT. when 38. ASSIGN ('(MP000800)p0008-bet38') TO <fs_amount>. <fs_amount> = lv_payment. EXIT. when 39. ASSIGN ('(MP000800)p0008-bet39') TO <fs_amount>. <fs_amount> = lv_payment. EXIT. when 40. ASSIGN ('(MP000800)p0008-bet40') TO <fs_amount>. <fs_amount> = lv_payment. EXIT. endcase. CLEAR lv_syindex. ENDDO. ENDIF. Click here to continue... Wage Type Amount in transaction PA20 before activating BADI Implementation

Go to transaction PA20, enter PERNR and Infotype 0008. Click on button 0008 data.

for displaying Infotype

Find Wage Type Amount 4,583.33 USD for Wage Type 1003 in below screen shot.

Wage Type Amount in transaction PA20 after activating BADI Implementation Wage Type Amount got changed from 4,583.33 USD to 23,000.00 USD for the Wage Type 1003.

Find changes in below screen shot.

You might also like