Skip to Content
0
Aug 02, 2007 at 07:09 AM

help regarding hr payroll

49 Views

Hello friends,

Can anyone help me to obtain wagetypes and their amts in my program from pc207 cluster.

Actually i want to create employee loans and advance report format.

This is my code and i am not able to get some fields pls check the code and make suitable helpful corrections.

**********************************************************************************************

REPORT  ZELARF LINE-SIZE 570.
TABLES: PB0001,PA0000,PA0001,PA0002,PA0008,PA0185,PA0213,T527X,PB0002,PC207.

PARAMETERS: PERNR LIKE PA0008-PERNR.
*            BEGDA LIKE PA0001-BEGDA,
*            ENDDA LIKE PA0001-ENDDA.
DATA: BEGIN OF ITAB OCCURS 0,
      L1 LIKE PC207-LGART,
      BUKRS LIKE PA0001-BUKRS,
      ENAME LIKE PA0001-ENAME,
      PLANS LIKE PA0001-PLANS,
      STELL LIKE PA0001-STELL,
      GSBER LIKE PA0001-GSBER,
      ORGEH LIKE PA0001-ORGEH,
      BTRTL LIKE PA0001-BTRTL,
      BEGDA LIKE PA0001-BEGDA,
      ENDDA LIKE PA0001-ENDDA,
      PERNR LIKE PA0008-PERNR,
      ICNUM LIKE PA0185-ICNUM,
      TRFST LIKE PA0008-TRFST,
      TRFGR LIKE PA0008-TRFGR,
      SUBTY LIKE PA0185-SUBTY,
      CHOIC LIKE RP50G-CHOIC,
      GESCH LIKE PA0002-GESCH,
      GBDAT LIKE PA0002-GBDAT,
      MASSN LIKE PA0000-MASSN,
      ORGTX LIKE T527X-ORGTX,
      ICOLD LIKE PA0185-ICOLD,
      ESINO LIKE PA0588-ESINO,
      EEPFN LIKE PA0587-EEPFN,
      ICTYP LIKE PA0185-ICTYP,
      PLSTX LIKE T528T-PLSTX,
      STEXT LIKE T777A-STEXT,
      LGART LIKE T506L-LGART,
      BEGDA1 LIKE PA0045-BEGDA,
      LGA01 LIKE PA0015-LGART,
      LGA02 LIKE PA0014-LGART,
      BETRG01 LIKE PA0015-BETRG,
      BETRG02 LIKE PA0014-BETRG,
      BANKN LIKE PA0009-BANKN,
      BETRG LIKE PA0014-BETRG,

      END OF ITAB.

*************************************************************************
WRITE: /1 'COMPANY CODE',
        20 'OLD EMP CODE',
        40 'SAP NO',
        60 'EMPLOYEE NAME',
        80 'DESIGN',
        100 'FUNCTION',
        120 'DEPARTMENT',
        140 'LEVELS',
        160 'GROUPING',
        180 'BRANCH ID',
        200 'BRANCH NAME',
        220 'JOIN DATE',
        240 'DATE OF RESIGN',
        260 'LAST WORK DAY',
        280 'MONTHLY CTC',
        300 'START DATE OF LOAN',
        320 'END DATE',
        340 'SALARY ADVANCE',
        360 'BLACKBURRY',
        380 'BUSFARE',
        400 'LAPTOP',
        420 'PL LOAN',
        440 'SEC. DEPOSIT(LEASE)',
        460 'OTHER LOAN',
        480 'STAFF IMPREST',
        500 'ACCOUNT NO',
        520 'CREATE EMP DATE',
        540 'RELEASE TAG',
        560 'FF TAG'.
WRITE: SY-ULINE.
WRITE: /.
clear itab.

SELECT A~TRFST A~TRFGR A~PERNR
B~MASSN
C~GESCH C~GBDAT C~SUBTY
D~BUKRS D~ENAME D~PLANS D~STELL D~GSBER D~ORGEH D~BTRTL D~BEGDA D~ENDDA
E~ORGTX
F~ICOLD F~ICTYP F~ICNUM
G~EEPFN
H~ESINO
I~PLSTX
J~STEXT
K~BEGDA
L~LGART L~BETRG
M~LGART M~BETRG
N~BANKN
INTO CORRESPONDING FIELDS OF ITAB
FROM ( ( ( ( ( ( ( ( ( ( ( ( ( PA0008 AS A INNER JOIN PA0000 AS B ON B~MANDT = A~MANDT AND B~BEGDA = A~BEGDA AND B~ENDDA = A~ENDDA AND B~PERNR = A~PERNR
)
INNER JOIN PA0002 AS C ON C~PERNR = B~PERNR )
INNER JOIN PA0001 AS D ON D~PERNR = C~PERNR )
INNER JOIN T527X AS E ON E~ENDDA = D~ENDDA AND E~BEGDA = D~BEGDA )
INNER JOIN PA0185 AS F ON F~BEGDA = E~BEGDA AND F~ENDDA = E~ENDDA )
INNER JOIN PA0587 AS G ON G~BEGDA = F~BEGDA AND G~ENDDA = F~ENDDA AND G~SEQNR = F~SEQNR AND G~OBJPS = F~OBJPS )
INNER JOIN PA0588 AS H ON H~BEGDA = G~BEGDA AND H~ENDDA = G~ENDDA AND H~SEQNR = G~SEQNR AND H~OBJPS = G~OBJPS )
INNER JOIN T528T AS I ON I~BEGDA = H~BEGDA AND I~ENDDA = H~ENDDA )
INNER JOIN T777A AS J ON J~MANDT = I~MANDT )
INNER JOIN PA0045 AS K ON K~MANDT = J~MANDT )
INNER JOIN PA0015 AS L ON L~PERNR = K~PERNR )
INNER JOIN PA0014 AS M ON M~PERNR = L~PERNR )
INNER JOIN PA0009 AS N ON N~PERNR = M~PERNR ).
DELETE ADJACENT DUPLICATES FROM ITAB.
*WRITE: / '***************************************************************************************'.
WRITE: /1 ITAB-BUKRS, "COMPANY CODE
        40 ITAB-PERNR, "SAP NO.
        60 ITAB-ENAME, "EMP NAME
        80 ITAB-PLSTX,
        100 ITAB-STEXT,
        140 ITAB-TRFST,
        160 ITAB-TRFGR,
*        40 ITAB-PLANS,
*        50 ITAB-STELL,
*        60 ITAB-GSBER,
        180 ITAB-ORGEH,
        200 ITAB-ORGTX,
*        80 ITAB-BTRTL,
        300 ITAB-BEGDA,
        320 ITAB-ENDDA.

*        140 ITAB-GESCH,
*        150 ITAB-GBDAT,

*        170 ITAB-EEPFN,
*        180 ITAB-ESINO,


IF ITAB-MASSN = '01'.
WRITE: 220 ITAB-BEGDA.
ENDIF.

IF ITAB-ICTYP = '23'.
WRITE: 20 ITAB-ICOLD. "OLD EMPL CODE
ENDIF.

IF ITAB-MASSN = '14'.
WRITE: 240 ITAB-BEGDA. "RESIGNATION DATE
ENDIF..

IF ITAB-MASSN = '17'.
WRITE: 260 ITAB-ENDDA. "LAST WORKING DAY
ENDIF.

IF ITAB-ICTYP ='20'.
WRITE: 120 ITAB-ICNUM. " DEPARTMENT
ENDIF.

*IF ITAB-ICTYP = '05'.
*WRITE: 305 ITAB-ICNUM.
*ENDIF.
*WRITE: 315 ITAB-BEGDA,
*       330 ITAB-ENDDA.

IF ITAB-LGA01 = '6007'.
*IF ITAB-L1 = '6007'.
WRITE: 205 ITAB-BETRG.
ENDIF.

IF ITAB-LGA01 = '3012'.
*IF ITAB-L1 = '3012'.
WRITE: 220 ITAB-BETRG.
ENDIF.

IF ITAB-LGA02 = '2001'.
*IF ITAB-L1 = '2001'.
WRITE: 240 ITAB-BETRG.
ENDIF.

IF ITAB-LGA01 = '3011'.
*IF ITAB-L1 = '3011'.
WRITE: 255 ITAB-BETRG.
ENDIF.

IF ITAB-LGA02 = '2002'.
*IF ITAB-L1 = '2002'.
WRITE: 280 ITAB-BETRG.
ENDIF.

*IF ITAB-LGART = '101'.
*WRITE: 415 ITAB-BETRG.
*ENDIF.

WRITE: 315 ITAB-BANKN.
*WRITE: / '***************************************************************************************'.
DELETE ADJACENT DUPLICATES FROM ITAB.
*write: /.
ENDSELECT.
end-of-page.
WRITE: / SY-ULINE.

***********************************************************************************************

Regards,

Ameet