Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 8950

other wage types automatically update in PA30.

$
0
0

Hello Experts,

 

Please help me for the following requirement,

 

I have to calculate the other wages based on ( annual salary - basic (1000)).

 

i have implement following exit PBAS0001.

 

this is a code i have written to ZXPADU02, but didnt work out,

 

Code :

 

DATA: wa_0008 TYPE p0008,

      lv_wgetype TYPE pa0008-lga01,

      lv_payment TYPE t510-betrg,

      lv_syindex TYPE n LENGTH 2.

 

DATA temp_amt TYPE p DECIMALS 2.

DATA temp_amt1 TYPE p DECIMALS 2.

FIELD-SYMBOLS <fs_amount> TYPE any.


IF sy-tcode = 'PA40' OR sy-tcode = 'PA30'.

  CASE innnn-infty.

    WHEN '0008'.

      IF ( ( ipsyst-ioper EQ insert OR ipsyst-ioper EQ copy OR ipsyst-ioper EQ 'MOD' ) OR sy-ucomm EQ 'UPD' ).

        DATA lv_field TYPE char40.

 

 

 

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

 

      DO 7 TIMES VARYING lv_wgetype FROM wa_0008-lga01 NEXT wa_0008-lga02.

        IF lv_wgetype = '1000'.

          IF wa_0008-bet01 IS NOT INITIAL.

              temp_amt1 = wa_0008-ansal - wa_0008-bet01.

          ENDIF.

          lv_syindex = sy-index.

        ENDIF.

 

****        calculation for different wage type.

**        1005

 

        CASE lv_syindex.

 

          WHEN 1.

             ASSIGN ('(MP000800)p0008-bet01') TO <fs_amount>.

             <fs_amount> = wa_0008-bet01.

             EXIT.

          WHEN 2.

            data : v_bet02 TYPE pa0008-bet02.

            CLEAR : v_bet02.

            v_bet02 =  ( temp_amt1 *  40 ) / 100.

            ASSIGN ('(MP000800)p0008-bet02') TO <fs_amount>.

            <fs_amount> = v_bet02. "lv_payment.

            EXIT.

          WHEN 3.

            data : v_bet03 TYPE pa0008-bet03.

            CLEAR : v_bet03.

            v_bet03 = ( temp_amt *  8 ) / 100.

            ASSIGN ('(MP000800)p0008-bet03') TO <fs_amount>.

            <fs_amount> = v_bet03. "lv_payment.

            EXIT.

          WHEN 4.

            data : v_bet04 TYPE pa0008-bet04.

            CLEAR : v_bet04.

            v_bet04 = ( temp_amt *  8 ) / 100.

             ASSIGN ('(MP000800)p0008-bet04') TO <fs_amount>.

            <fs_amount> = v_bet04.

            EXIT.

          WHEN 5.

            data : v_bet05 TYPE pa0008-bet05.

            CLEAR : v_bet05.

            v_bet05 = ( temp_amt *  8 ) / 100. "( temp_amt *  8 ) / 100.

             ASSIGN ('(MP000800)p0008-bet05') TO <fs_amount>.

            <fs_amount> = v_bet05.

            EXIT.

          WHEN 6.

            data : v_bet06 TYPE pa0008-bet06.

            CLEAR : v_bet06.

            v_bet06 = ( temp_amt *  20 ) / 100.

            ASSIGN ('(MP000800)p0008-bet06') TO <fs_amount>.

            <fs_amount> = v_bet06.

            EXIT.

          WHEN 7.

            data : v_bet07 TYPE pa0008-bet07.

            CLEAR : v_bet07.

            v_bet07 = ( temp_amt *  12 ) / 100.

            ASSIGN ('(MP000800)p0008-bet07') TO <fs_amount>.

            <fs_amount> = v_bet07.

            EXIT.

          WHEN 8.

            data : v_bet08 TYPE pa0008-bet08.

            CLEAR : v_bet08.

            v_bet08 = ( temp_amt *  8 ) / 100.

            ASSIGN ('(MP000800)p0008-bet08') TO <fs_amount>.

            <fs_amount> = v_bet08.

           EXIT.

         WHEN 9.

            data : v_bet09 TYPE pa0008-bet09.

            CLEAR : v_bet09.

            v_bet09 = wa_0008-ansal - ( wa_0008-bet01 + wa_0008-bet02 + wa_0008-bet03 +

                                            wa_0008-bet04 + wa_0008-bet05 + wa_0008-bet06 +

                                            wa_0008-bet07 + wa_0008-bet08 ).

 

            ASSIGN ('(MP000800)p0008-bet08') TO <fs_amount>.

            <fs_amount> = v_bet09."

**            wa_0008-ansal - ( wa_0008-bet01 + wa_0008-bet02 + wa_0008-bet03 +

**                                            wa_0008-bet04 + wa_0008-bet05 + wa_0008-bet06 +

**                                            wa_0008-bet07 + wa_0008-bet08 ).

*            EXIT.

 

 

*          WHEN OTHERS.

*        ENDCASE.

*        CLEAR lv_syindex.

*      ENDDO.

endif.


Please do the needful.



Viewing all articles
Browse latest Browse all 8950

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>