Modifying Wage Type Amount value in transaction PA20 and PA30

...Previous

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...

Please send us your feedback/suggestions at webmaster@SAPTechnical.COM 

HomeContribute About Us Privacy Terms Of Use • Disclaimer • SafeCompanies: Advertise on SAPTechnical.COM | Post JobContact Us  

Graphic Design by Round the Bend Wizards

footer image footer image