Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Extract Data from Payroll infotype 0008 Basic pay

Former Member
0 Likes
690

Hi, all.

I want to extract payroll data by wage type ragarding basic salary in infotype 0008.

Please suggest me ..........

2 REPLIES 2
Read only

Former Member
0 Likes
468

hi,

Check this Code...

rp_provide_from_last p0008 space g_begda g_endda.
  IF pnp-sw-found = '1'.

*   Check whether the Basic Salary data of employee is changed in the
*   selected period or new employee is created in the selected period
*   or check the hire and rehire begin date is in the selected period.
    IF ( p0008-aedtm GE g_begda AND p0008-aedtm LE g_endda ) OR
       ( p0008-begda GE g_begda AND p0008-begda LE g_endda ) OR
       ( ( p0000-begda GE g_begda AND p0000-begda LE g_endda ) AND
         ( p0000-massn EQ 'I1' OR p0000-massn EQ 'I2' OR
           p0000-massn EQ 'I3' OR p0000-massn EQ 'I4' ) ).
    ELSE.
      REJECT.
    ENDIF.

    DO 40 TIMES VARYING g_lga01 FROM p0008-lga01 NEXT p0008-lga02
                VARYING g_bet01 FROM p0008-bet01 NEXT p0008-bet02
                VARYING g_anz01 FROM p0008-anz01 NEXT p0008-anz02
                VARYING g_opk01 FROM p0008-opk01 NEXT p0008-opk02
                VARYING g_ind01 FROM p0008-ind01 NEXT p0008-ind02.
      IF g_lga01 IS INITIAL.
        EXIT.
      ENDIF.
      i_ptbindbw_line-seqnr = sy-index.
      i_ptbindbw_line-lgart = g_lga01.
      i_ptbindbw_line-opken = g_opk01.
      i_ptbindbw_line-betrg = g_bet01.
      i_ptbindbw_line-waers = p0008-waers.
      i_ptbindbw_line-indbw = g_ind01.
      i_ptbindbw_line-anzhl = g_anz01.
      APPEND i_ptbindbw_line TO i_ptbindbw.
      CLEAR  i_ptbindbw_line.
    ENDDO.
  ENDIF.

  IF NOT i_ptbindbw[] IS INITIAL.
*  Function Module to evaluate indirect wage types.
    rp_provide_from_last p0007 space g_begda g_endda.
    CALL FUNCTION 'RP_EVALUATE_INDIRECTLY_P0008'
      EXPORTING
        appli                        = 'M'
        pbegda                       = p0008-begda
        pmolga                       = g_molga
        pp0001                       = p0001
        pp0007                       = p0007
        pp0008                       = p0008
        ppernr                       = p0008-pernr
      TABLES
        ptbindbw                     = i_ptbindbw      Hold the amount as per the wage type
      EXCEPTIONS
        bad_parameters               = 1
        error_at_indirect_evaluation = 2
        OTHERS                       = 3.

Read only

Former Member
0 Likes
468

Thakns Guru