Skip to Content
author's profile photo Former Member
Former Member

abap hr payroll

Can any one help me out in fetching

Quarterly transport allowance claimed by all employeeu2019s for particular sub area.

i.e what are the clusters,

infotypes and wage types we use for this.

is it necessary to take both rt, crt for this report

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

3 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Jun 16, 2008 at 03:19 PM

    In transaction code PC_PAYRESULT

    under what section do you have transport allowance?

    I think you might need to fetch Payroll results throught event

    GET PAYROLL

    and calculate the quaterly transport allowance from the payroll results

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jun 16, 2008 at 03:27 PM

    data: rgdir like pc261 occurs 0 with header line.

    CALL FUNCTION 'CU_READ_RGDIR'

    EXPORTING

    persnr = it_loans-pernr <-- pass pernr here

    TABLES

    in_rgdir = it_rgdir. --> get rgdir

    LOOP AT it_rgdir WHERE srtza = 'A'

    AND void IS INITIAL

    AND reversal IS INITIAL

    AND fpper = v_fpper.

    v_seqnr = it_rgdir-seqnr. <-- get the seqnr

    ENDLOOP.

    rx-key-pernr = it_loans-pernr.

    rx-key-seqno = v_seqnr.

    rp-imp-c2-RU. <-- call macro to get payroll results ..

    loop at rt where lgart = <transport allowance wage type >.

    v_betrg = v_betrg + rt-betrg.

    endloop.

    get amount in v_betrg .. for the wage types ...

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jun 16, 2008 at 03:37 PM

    hi check this report....

    REPORT ZFIO_PAYROLL_BUDGET_EXTRACT LINE-SIZE 132.

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

    • PROGRAM TITLE: Interface return percentages from SAP to legacy

    • LOGICAL DATABASE USED: NONE

    • FILES: /tmp/RSD2XX (SAP WIDGET JVs)

    • CHANGES:

    • PROGRAMMER DATE TASK DESCRIPTION

    • Carolyn B. 01/06/1999 Load Payroll planning data

    • into FDSB

    *

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

    TABLES: COEJ,

    T009B.

    PARAMETERS:

    PRMYR LIKE COEJ-GJAHR,

    PRMPD LIKE COEJ-PERBL DEFAULT '001' OBLIGATORY.

    DATA: BEGIN OF COEJ_TBL OCCURS 0,

    COSTCTR LIKE COEJ-OBJNR,

    FISCAL-YEAR LIKE COEJ-GJAHR,

    ACCOUNT LIKE COEJ-KSTAR,

    WTG001 LIKE COEJ-WTG001,

    WTG002 LIKE COEJ-WTG002,

    WTG003 LIKE COEJ-WTG003,

    WTG004 LIKE COEJ-WTG004,

    WTG005 LIKE COEJ-WTG005,

    WTG006 LIKE COEJ-WTG006,

    WTG007 LIKE COEJ-WTG007,

    WTG008 LIKE COEJ-WTG008,

    WTG009 LIKE COEJ-WTG009,

    WTG010 LIKE COEJ-WTG010,

    WTG011 LIKE COEJ-WTG011,

    WTG012 LIKE COEJ-WTG012,

    SUB-ACCOUNT(4) TYPE C,

    END OF COEJ_TBL.

    DATA: BEGIN OF REC OCCURS 0,

    COSTCTR(4) TYPE C,

    DELIM1(1) TYPE C,

    SUB-ACCOUNT(4) TYPE C,

    DELIM2(1) TYPE C,

    PAYROLL-AMT(14) TYPE C,

    FILLER3(1) TYPE C,

    FILLER4(1) TYPE C VALUE 'B',

    END OF REC.

    DATA: FILE_NAME(128) VALUE

    '/usr/sap/trans/tmp/sap_datafeed/pay_b'.

    DATA: BEGIN OF WS-DATE,

    YEAR(4) TYPE C,

    MONTH(2) TYPE C,

    DAY(2) TYPE C,

    END OF WS-DATE.

    DATA: BEGIN OF WS-COEJ,

    COSTCTR LIKE COEJ-OBJNR,

    FISCAL-YEAR LIKE COEJ-GJAHR,

    ACCOUNT LIKE COEJ-KSTAR,

    WTG001 LIKE COEJ-WTG001,

    WTG002 LIKE COEJ-WTG002,

    WTG003 LIKE COEJ-WTG003,

    WTG004 LIKE COEJ-WTG004,

    WTG005 LIKE COEJ-WTG005,

    WTG006 LIKE COEJ-WTG006,

    WTG007 LIKE COEJ-WTG007,

    WTG008 LIKE COEJ-WTG008,

    WTG009 LIKE COEJ-WTG009,

    WTG010 LIKE COEJ-WTG010,

    WTG011 LIKE COEJ-WTG011,

    WTG012 LIKE COEJ-WTG012,

    SUB-ACCOUNT(4) TYPE C,

    END OF WS-COEJ.

    DATA: WS-FISCAL-YEAR(4) TYPE C.

    DATA: WS-PERIOD(3) TYPE C.

    DATA: WS-TYLY(2) TYPE C.

    DATA: WS-BEGIN-MONTH(2) TYPE C.

    DATA: WS-END-DAY(2) TYPE C.

    DATA: WS-COUNT TYPE I,

    PREV-COSTCTR(5) TYPE C,

    WS-PAYROLL-AMT LIKE COEJ-WTG001.

    INITIALIZATION.

    WS-DATE = SY-DATUM.

    SELECT SINGLE BDATJ BUMON BUTAG POPER RELJR FROM T009B

    INTO (WS-FISCAL-YEAR,

    WS-BEGIN-MONTH,

    WS-END-DAY,

    WS-PERIOD,

    WS-TYLY)

    WHERE PERIV = 'X4' AND

    BDATJ = WS-DATE-YEAR AND

    BUMON = WS-DATE-MONTH AND

    BUTAG > 0.

    IF WS-TYLY = '0'.

    ELSE.

    WS-FISCAL-YEAR = WS-FISCAL-YEAR - 1.

    ENDIF.

    AT SELECTION-SCREEN OUTPUT.

    MOVE WS-PERIOD TO PRMPD.

    • coej contains current balances for fiscal year / periods

    START-OF-SELECTION.

    SELECT: OBJNR GJAHR KSTAR WTG001 WTG002 WTG003 WTG004

    WTG005 WTG006

    WTG007 WTG008 WTG009 WTG010 WTG011 WTG012

    FROM COEJ

    INTO (WS-COEJ-COSTCTR,

    WS-COEJ-FISCAL-YEAR,

    WS-COEJ-ACCOUNT,

    WS-COEJ-WTG001,

    WS-COEJ-WTG002,

    WS-COEJ-WTG003,

    WS-COEJ-WTG004,

    WS-COEJ-WTG005,

    WS-COEJ-WTG006,

    WS-COEJ-WTG007,

    WS-COEJ-WTG008,

    WS-COEJ-WTG009,

    WS-COEJ-WTG010,

    WS-COEJ-WTG011,

    WS-COEJ-WTG012)

    • into table coej_tbl

    WHERE GJAHR = PRMYR

    • and perbl = 016

    AND VERSN = '000'

    AND KSTAR = '0000050000'.

    • write: /'objnr ', coej-objnr+6(5).

    WS-COEJ-COSTCTR = WS-COEJ-COSTCTR+6(5).

    IF WS-COEJ-COSTCTR+10(1) = 'B'.

    WS-COEJ-SUB-ACCOUNT = '0100'.

    ENDIF.

    IF WS-COEJ-COSTCTR+10(1) = 'C'.

    WS-COEJ-SUB-ACCOUNT = '0400'.

    ENDIF.

    IF WS-COEJ-COSTCTR+10(1) = 'F'.

    WS-COEJ-SUB-ACCOUNT = '0300'.

    ENDIF.

    APPEND WS-COEJ TO COEJ_TBL.

    CLEAR WS-COEJ.

    ENDSELECT.

    SORT: COEJ_TBL BY COSTCTR SUB-ACCOUNT.

    IF SY-SUBRC NE 0.

    WRITE: /'invalid write of coej_tbl ', SY-SUBRC.

    ENDIF.

    END-OF-SELECTION.

    OPEN DATASET FILE_NAME FOR OUTPUT IN TEXT MODE.

    IF SY-SUBRC NE 0.

    WRITE: / 'Invalid output open of payroll budget file' ,SY-SUBRC.

    EXIT.

    ENDIF.

    LOOP AT COEJ_TBL.

    IF WS-COUNT = 0.

    PREV-COSTCTR = COEJ_TBL-COSTCTR.

    WS-COUNT = WS-COUNT + 1.

    ENDIF.

    IF PREV-COSTCTR(4) NE COEJ_TBL-COSTCTR(4).

    PERFORM COSTCTR-CHANGE.

    ENDIF.

    PERFORM ADD-PAYROLL-AMTS.

    ENDLOOP.

    CLOSE DATASET FILE_NAME.

    OPEN DATASET FILE_NAME FOR INPUT IN TEXT MODE.

    IF SY-SUBRC NE 0.

    WRITE: / 'Invalid open of sap payroll budget file ', SY-SUBRC.

    EXIT.

    ENDIF.

    CLEAR WS-COUNT.

    DO.

    READ DATASET FILE_NAME INTO REC.

    IF SY-SUBRC = 0.

    IF WS-COUNT < 2000.

    WRITE: / REC.

    WS-COUNT = WS-COUNT + 1.

    ENDIF.

    ELSE.

    EXIT.

    ENDIF.

    ENDDO.

    WRITE: /.

    WRITE: 'total ', WS-COUNT.

    CLOSE DATASET FILE_NAME.

    FORM ADD-PAYROLL-AMTS.

    IF PRMPD = 1.

    COMPUTE WS-PAYROLL-AMT = WS-PAYROLL-AMT + COEJ_TBL-WTG001.

    ENDIF.

    IF PRMPD = 2.

    COMPUTE WS-PAYROLL-AMT = WS-PAYROLL-AMT + COEJ_TBL-WTG002.

    ENDIF.

    IF PRMPD = 3.

    COMPUTE WS-PAYROLL-AMT = WS-PAYROLL-AMT + COEJ_TBL-WTG003.

    ENDIF.

    IF PRMPD = 4.

    COMPUTE WS-PAYROLL-AMT = WS-PAYROLL-AMT + COEJ_TBL-WTG004.

    ENDIF.

    IF PRMPD = 5.

    COMPUTE WS-PAYROLL-AMT = WS-PAYROLL-AMT + COEJ_TBL-WTG005.

    ENDIF.

    IF PRMPD = 6.

    COMPUTE WS-PAYROLL-AMT = WS-PAYROLL-AMT + COEJ_TBL-WTG006.

    ENDIF.

    IF PRMPD = 7.

    COMPUTE WS-PAYROLL-AMT = WS-PAYROLL-AMT + COEJ_TBL-WTG007.

    ENDIF.

    IF PRMPD = 8.

    COMPUTE WS-PAYROLL-AMT = WS-PAYROLL-AMT + COEJ_TBL-WTG008.

    ENDIF.

    IF PRMPD = 9.

    COMPUTE WS-PAYROLL-AMT = WS-PAYROLL-AMT + COEJ_TBL-WTG009.

    ENDIF.

    IF PRMPD = 10.

    COMPUTE WS-PAYROLL-AMT = WS-PAYROLL-AMT + COEJ_TBL-WTG010.

    ENDIF.

    IF PRMPD = 11.

    COMPUTE WS-PAYROLL-AMT = WS-PAYROLL-AMT + COEJ_TBL-WTG011.

    ENDIF.

    IF PRMPD = 12.

    COMPUTE WS-PAYROLL-AMT = WS-PAYROLL-AMT + COEJ_TBL-WTG012.

    ENDIF.

    ENDFORM.

    ----


    • FORM COSTCTR-CHANGE *

    ----


    • ........ *

    ----


    FORM COSTCTR-CHANGE.

    REC-COSTCTR = PREV-COSTCTR(+4).

    REC-DELIM1 = '|'.

    REC-DELIM2 = '|'.

    TRANSFER REC TO FILE_NAME.

    IF SY-SUBRC NE 0.

    WRITE: 'Invalid write of payroll budget file'.

    EXIT.

    ENDIF.

    CLEAR: REC, WS-PAYROLL-AMT.

    PREV-COSTCTR(4) = COEJ_TBL-COSTCTR(4).

    ENDFORM.

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.