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

fetching data from p0008

Former Member
0 Likes
1,995

hellow experts,

i am developing one HR report i need to get Employee master current data as appear in pa30 , some of the wage type is Indirect processed  so i cant get some wage type amount like housing allwance and ta, plz give me sample code or programme to use this FM "RP_FILL_WAGE_TYPE_TABLE"

my report display is

employe no       housing ALl                               Transporta Allowance

121111                1000 (Current as in pa 30)          12000

its really helpfull me if any one provide me sample programe or link, Thannks all

11 REPLIES 11
Read only

MariaJooRocha
Contributor
0 Likes
1,471

Hi,

Does the FM "RP_FILL_WAGE_TYPE_TABLE" returns any error?

The table  PPBWLA returns the wage type and its values.

Regards,

Maria João Rocha

Read only

0 Likes
1,471

thnaks maria could u plz elobrate sample code or programme,

Read only

Former Member
0 Likes
1,471

hi

REFRESH IT_RGDIR[].
CALL FUNCTION 'CU_READ_RGDIR'
EXPORTING
PERSNR                   = PERNR-PERNR
*    BUFFER                   =
*    NO_AUTHORITY_CHECK       = ' '
IMPORTING
MOLGA                    = L_MOLGA
TABLES
IN_RGDIR                 = IT_RGDIR
EXCEPTIONS
NO_RECORD_FOUND          =
1
OTHERS                   = 2.
IF SY-SUBRC <> 0.
REJECT.
ELSE.

CLEAR PER_ID.
IF PNPTIMR9 EQ 'X'.
CONCATENATE PNPDISPJ PNPDISPP INTO PER_ID.  "current period
ELSEIF PNPTIMRA EQ 'X'.
CONCATENATE PNPPABRJ PNPPABRP INTO PER_ID.  "other period
ENDIF.

CLEAR WA_RGDIR.
READ TABLE IT_RGDIR INTO WA_RGDIR WITH KEY FPPER = PER_ID INPER = PER_ID SRTZA = 'P'.
IF SY-SUBRC NE 0.
READ TABLE IT_RGDIR INTO WA_RGDIR WITH KEY FPPER = PER_ID INPER = PER_ID SRTZA = 'A'.
IF SY-SUBRC NE 0.
SORT IT_RGDIR DESCENDING BY FPPER INPER.
READ TABLE IT_RGDIR INTO WA_RGDIR WITH KEY FPPER = PER_ID SRTZA = 'A'.
IF SY-SUBRC NE 0.
REJECT.
ENDIF.
ENDIF.
ENDIF.

*read payroll results
IF WA_RGDIR IS NOT INITIAL.
CLEAR PAYRESULT.
CALL FUNCTION 'PYXX_READ_PAYROLL_RESULT'
EXPORTING
CLUSTERID                    =
'IN'
EMPLOYEENUMBER               = PERNR-PERNR
SEQUENCENUMBER               = WA_RGDIR-SEQNR
CHANGING
PAYROLL_RESULT               = PAYRESULT
EXCEPTIONS
ILLEGAL_ISOCODE_OR_CLUSTERID =
1
ERROR_GENERATING_IMPORT      =
2
IMPORT_MISMATCH_ERROR        =
3
SUBPOOL_DIR_FULL             =
4
NO_READ_AUTHORITY            =
5
NO_RECORD_FOUND              =
6
VERSIONS_DO_NOT_MATCH        =
7
ERROR_READING_ARCHIVE        =
8
ERROR_READING_RELID          =
9
OTHERS                       = 10.
IF SY-SUBRC EQ 0.
CLEAR WA_RT.
LOOP AT PAYRESULT-INTER-RT INTO WA_RT.

IF WA_RT-LGART EQ '1105' OR WA_RT-LGART EQ '2105' OR WA_RT-LGART EQ '6005'.
*            IF WA_RT-LGART EQ '  '.
*              WA_FINAL-HRA = WA_RT-BETRG * C_26 .
*            ELSE.
CLEAR AMNT.
*            AMNT = WA_FINAL-HRA .
WA_FINAL-HRA =  WA_FINAL-HRA  + WA_RT-BETRG.
.
CLEAR AMNT.

endloop.

Read only

former_member184515
Participant
0 Likes
1,471

DATA: begin of ZPPBWLA occurs 0.     

include STRUCTURE  PBWLA.

data: end of ZPPBWLA.

CALL FUNCTION 'RP_FILL_WAGE_TYPE_TABLE'

  EXPORTING

     APPLI                                 =  'E'

     BEGDA                              =  p0008-begda

     ENDDA                              =  '99991231'

     TCLAS                                =  'A'

      pernr                                   =  pernr-pernr

      SUBTY                              = '0   '

     DLSPL                                =  'X'

  tables

    ppbwla                             = Z        PPBWLA

Read only

0 Likes
1,471

thanks laxman i tried ur code but i think its only fucntion RP_FILL_WAGE_TYPE_TABLE are usefull to get current or master housing and transportation,

DATA: begin of ZPPBWLA occurs 0.    

include STRUCTURE  PBWLA.

data: end of ZPPBWLA.

CALL FUNCTION 'RP_FILL_WAGE_TYPE_TABLE'

  EXPORTING

     APPLI                                 =  'E'

     BEGDA                              =  p0008-begda

     ENDDA                              =  '99991231'

     TCLAS                                =  'A'

      pernr                                   =  pernr-pernr

      SUBTY                              = '0   '

     DLSPL                                =  'X'

  tables

    ppbwla                             = Z PPBWLA

is this first part of ur code?

Read only

0 Likes
1,471

could you give me complate code or sample link its really appreciated, i need badly , thanks a lott.

Read only

0 Likes
1,471

Hi,

You get all records on 0008 depending on de dates (begda and endda).

Regards,

Maria João Rocha

Read only

0 Likes
1,471

ya but how , i tried but its giving me old housing and transportation amount which is not in pa 30 plz just give me sample programme  i will tried, thanks

Read only

0 Likes
1,471

Hi,

If you want the current data use sy-datum on begda.

Regards,

Maria João Rocha

Read only

0 Likes
1,471

thanks maria i tried all these already , if u have any sample code plz give , thanks

Read only

0 Likes
1,471

hi Neha,

u can try the following code:

SELECT PERNR BEGDA ENDDA FROM PA0001 INTO TABLE IT_DATE
                             WHERE PERNR IN S_PERNR
                             AND   ENDDA = ( SELECT MAX( ENDDA ) FROM PA0001 WHERE PERNR IN S_PERNR ).

READ TABLE IT_DATE WITH KEY PERNR = WA_PA0001-PERNR.
         IF SY-SUBRC = 0.
           W_BEGDA = IT_DATE-BEGDA.
           W_ENDDA = IT_DATE-ENDDA.
         ENDIF.

         IF WA_PA0001-PERNR IS NOT INITIAL.
           CLEAR:IT_PBWLA, IT_PBWLA[].
           CALL FUNCTION 'RP_FILL_WAGE_TYPE_TABLE'
             EXPORTING
               APPLI  = 'E'
               BEGDA  = W_BEGDA
               ENDDA  = W_ENDDA
               INFTY  = '0008'
               PERNR  = WA_PA0001-PERNR
             TABLES
               PPBWLA = IT_PBWLA.
           IF SY-SUBRC <> 0.
* Implement suitable error handling here
           ENDIF.
         ENDIF.

IF IT_PBWLA[] IS NOT INITIAL.
         READ TABLE IT_PBWLA WITH KEY LGART = '1000'.
         IT_FINAL-BETRG = IT_PBWLA-BETRG.
       ENDIF.
       LV_BASIC = IT_FINAL-BETRG. "For Basic

Here I'm calculating for basic pay. Check ur corresponding LGART value and u will get the desired result..