Looping payroll results using pnpce ldb

hii experts,
Can anybody tell me how can v loop payroll results using pnpce ldb..plz provide me the syntax...or any reference report
program.

Hi First Using Get peras event read the RGDIR results as below
CALL FUNCTION 'CU_READ_RGDIR'
    EXPORTING
      persnr          = p_pernr
    IMPORTING
      molga           = p_molga
    TABLES
      in_rgdir        = p_rgdir
    EXCEPTIONS
      no_record_found = 1
      OTHERS          = 2.
Get the Cluster ID based on the molga value of the employee using T5001 table
Then Based on the RGDIR results loop retrive the payroll results below
    LOOP AT gt_rgdir INTO wa_rgdir WHERE fpbeg LE wa_dates-endda AND fpend GE wa_dates-endda
                        AND srtza EQ c_a
                        AND payty EQ c_space.
  CALL FUNCTION 'PYXX_READ_PAYROLL_RESULT'
        EXPORTING
          clusterid                    = wa_t500l-relid
          employeenumber               = pernr-pernr
          sequencenumber               = wa_rgdir-seqnr
          read_only_international      = 'X'
        CHANGING
          payroll_result               = gt_result
        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.

Similar Messages

  • Reading Payroll Results using PNPCE

    Hi All,
    As far as reading infotypes/master data is concerned, I am comfortable using "PNPCE" instead of logical database "PNP".
    Can any one tell me how can I read payroll results using "PNPCE". Since Get payroll event is not available in pnpce.

    Hi khalid,
    1. U want the remuneration (monthly salary )
    2. U won't get it DIRECTLY from any table.
    (Its stored in cluster format)
    3. Use this logic and FM.
    DATA: myseqnr LIKE hrpy_rgdir-seqnr.
    DATA : mypy TYPE payin_result.
    DATA : myrt LIKE TABLE OF pc207 WITH HEADER LINE.
    SELECT SINGLE seqnr FROM hrpy_rgdir
    INTO myseqnr
    WHERE pernr = mypernr
    AND fpper = '200409'
    AND srtza = 'A'.
    IF sy-subrc = 0.
    CALL FUNCTION 'PYXX_READ_PAYROLL_RESULT'
    EXPORTING
    clusterid = 'IN'
    employeenumber = mypernr
    sequencenumber = myseqnr
    CHANGING
    payroll_result = mypy
    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.
    myrt[] = mypy-inter-rt.
    READ TABLE myrt WITH KEY lgart = '1899'.
    4. the internal table myrt
    will contain what u require.
    regards,
    amit m.

  • Need example report program using PNPCE LDB in SAP HR

    Need example report program using PNPCE LDB in SAP HR.
    and how to create a report category in sap hr for using it as cutomised selection screen.

    Hi,
    Go through the following links, i hope it will help you.....
    /people/alvaro.tejadagalindo/blog/2006/02/19/how-to-deal-with-hr-payroll-reports
    http://sap.ittoolbox.com/groups/technical-functional/sap-r3-dev/893908#
    A sample prog with LDB PNP
    *& Report ZH_REPT_PAYMENT *
    report zh_rept_payment line-size 80 no standard page
    heading.
    tables: pernr, " Standard Selections for HR Master Data Reporting
    pcl1, " HR Cluster 1
    pcl2, " HR Cluster 2
    pa0009,
    PA9001,
    PA9006,
    pa0002,
    pc260 , " Cluster Directory for Payroll Results
    bnka .
    Infotypes
    infotypes: 0001. " Organizational Assignment
    Declaration of Internal Tables
    data : bnka1 like bnka occurs 0 with header line .
    data: begin of t_int_rep occurs 100,
    bankl like pc209-bankl, " Bank Number
    zlsch like pc209-zlsch, " Payment method
    pernr like pernr-pernr, " Employee Number
    ename like pernr-ename, " Employee Name
    bankn like pc209-bankn, " Bank Account Number
    betrg like pc209-betrg, " Amount to be transfered
    zweck like pa0009-zweck, " Purpose
    end of t_int_rep.
    data: begin of int_rep occurs 100,
    bankl like pc209-bankl, " Bank Number
    zlsch like pc209-zlsch, " Payment method
    pernr like pernr-pernr, " Employee Number
    ename like pernr-ename, " Employee Name
    bankn like pc209-bankn, " Bank Account Number
    betrg like pc209-betrg, " Amount to be transfered
    zweck like pa0009-zweck, " Purpose
    begda like pa0009-begda, "Begin date
    end of int_rep.
    Declaration of Data Variables
    data: ws_betrg like pc209-betrg, " BT Amount
    w_val like spell occurs 0 with header line,
    int_rep1(6), " TYPE I, " Employee Number
    cnt type i value 0, " Counter
    calcmolga like t500l-molga value '40', " Country Grouping
    v_id(15),
    calc_currency like t001-waers value 'INR'. " Currency
    data : ctr type i,
    dt_merge like pa0009-begda.
    data: ws_totemp(6) type c,
    ws_totamt(20) type c,
    r_mth(9) type c,
    ws_fpbeg(6) type c,
    ws_fpend(6) type c,
    ws_mthyr(6) type c,
    ws_mthyr_r(14) type c,
    r_mth_t(3) type c,
    ws_amt(8) type c,
    ws_bankl(14) type c,
    ws_date(6) type c,
    amount_word(500),
    total_page type i,
    pages type i,
    remain type i.
    data begin of i_spell.
    include structure spell .
    data end of i_spell .
    data : c_molga type t500l-molga value '40',
    c_banks type bnka-banks value 'IN'.
    Standard Includes
    include rpc2cd09. "Cluster CD data definition
    include pc2rxin0.
    include rpc2rx09.
    include rpppxd00. " Data Definition buffer PCL1/PCL2
    include rpppxd10. " Common Part buffer PCL1/PCL2
    include rpppxm00. " Buffer Handling RoutinePCL1/PCL2
    include zrpc2rox2. " Data Definition POCLSTERS (not J,K,U)
    Selection Screen
    selection-screen begin of block b1 with frame title text-001.
    parameter: pa_mth(2) type c default sy-datum+4(2) obligatory,
    pa_year(4) type c default sy-datum(4) obligatory,
    p_bankl like pc209-bankl, " Bank Number
    p_zlsch like pc209-zlsch. " Payment method
    selection-screen end of block b1.
    save_calc_currency = calc_currency.
    count_top = 0.
    get_pernr_flag = 0.
    Top-Of-Page
    top-of-page.
    perform convert_month using pa_mth(2) r_mth.
    ws_mthyr_r = r_mth.
    concatenate ws_mthyr_r pa_year into ws_mthyr_r separated by space.
    SKIP 5.
    skip 1.
    skip 4.
    if int_rep-bankl eq ' '.
    if int_rep-zlsch eq 'C' or int_rep-zlsch eq 'E' or
    int_rep-zlsch eq ' '.
    write: /1(85) 'CHEQUE PAYMENT STATEMENT'(047) centered.
    elseif int_rep-zlsch eq 'L'.
    write: /1(85) 'DEMAND DRAFT STATEMENT'(047) centered.
    endif.
    else.
    write: /1(85) 'BANK TRANSFER STATEMENT'(002) centered.
    endif.
    skip.
    write: /34 ws_mthyr_r,
    62 'Page :'(008),69(2) sy-pagno intensified off,
    ' Of ',78(2) pages intensified off.
    clear pages.
    read table bnka1 with key bankl = int_rep-bankl .
    if sy-subrc = 0.
    if int_rep-zlsch eq 'T'.
    write:/03(10) 'Bank Name : ', bnka1-banka.
    write:/03(10) 'Branch : ', bnka1-brnch.
    write:/03(10) 'Address : ', bnka1-stras.
    endif.
    endif.
    skip.
    write:/1(80) sy-uline.
    write: /1 sy-vline, 2(5) 'Sl.No'(002),
    7 sy-vline, 8(8) 'Emp.No.'(003),
    16 sy-vline,17(35) 'Employee Name'(004).
    *--added for Demand Draft
    if ( int_rep-zlsch = 'l' or int_rep-zlsch = 'L' ).
    write : 47 sy-vline, 48(15) 'Payable at'(005).
    else.
    write : 47 sy-vline,48(15) 'Account No.'(005).
    endif.
    write: 63 sy-vline,64(16) 'Amount'(006),
    80 sy-vline.
    write:/1(80) sy-uline.
    end-of-page.
    write:/1(80) sy-uline.
    write:/2 'Printed on ', sy-datum.
    Start-of-selection.
    start-of-selection.
    *perform h_headr.
    ctr = 0.
    set margin 5.
    call function 'RP_GET_CURRENCY'
    exporting
    molga = calcmolga
    importing
    waers = calc_currency
    exceptions
    others.
    if sy-subrc ne 0.
    calc_currency = 'DEM'.
    calc_currency = save_calc_currency.
    endif.
    get pernr.
    cd-key-pernr = pernr-pernr.
    perform import_cluster.
    get_pernr_flag = 1.
    check : ocd-version-molga eq calcmolga.
    The table 'tabpernr' is filled with the personnel numbers
    and is used after selection is finished.
    move-corresponding pernr to tabpernr.
    append tabpernr.
    The table 'tab_rgdir' is filled
    loop at rgdir.
    rx-key-pernr = pernr-pernr.
    unpack rgdir-seqnr to rx-key-seqno.
    perform int_tab. "fill tab_rgdir
    perform import_bt.
    perform validate.
    endloop.
    End of Selection
    end-of-selection.
    *perform h_headr.
    perform convert_date_a using pa_mth r_mth_t.
    sort int_rep by bankl zlsch pernr betrg descending.
    delete adjacent duplicates from int_rep
    comparing bankl zlsch pernr .
    sort int_rep by bankl zlsch bankn . "PERNR.
    loop at int_rep.
    at new bankl.
    select single * into bnka1 from bnka
    where banks = c_banks and
    bankl = int_rep-bankl .
    append bnka1.
    clear bnka1.
    endat.
    endloop.
    for Demand Draft - purpose added
    loop at int_rep.
    concatenate pa_year(4) pa_mth(2) '01' into dt_merge.
    select single * "zweck into int_rep-zweck
    from pa0009 where
    pernr = int_rep-pernr and
    bankl = int_rep-bankl and
    zlsch = int_rep-zlsch
    and begda <= dt_merge and
    endda >= dt_merge .
    if sy-subrc = 0.
    int_rep-zweck = pa0009-zweck.
    modify int_rep.
    endif.
    endloop.
    *-for DD and Chq sorted by PAyable at and EMPNO wise
    if p_zlsch = 'T' .
    sort int_rep by bankl zlsch bankn . "PERNR.
    else. "added for "payable at" for DD/Chq
    else.
    sort int_rep by zweck pernr . "PERNR.
    endif.
    *delete adjacent duplicates from int_rep.
    t_int_rep] = int_rep[.
    loop at int_rep.
    *-for page of page no.
    total_page = 0.
    loop at t_int_rep where bankl = int_rep-bankl
    and zlsch = int_rep-zlsch.
    total_page = total_page + 1.
    endloop.
    pages = total_page div 25.
    remain = total_page mod 25.
    comment bcoz its adding one extra page no.
    done as on 29/11/2004
    if remain > 0.
    pages = pages + 1.
    endif.
    **-end
    at new bankl.
    ctr = 0 .
    new-page.
    endat.
    at new zlsch.
    ctr = 0 .
    new-page.
    endat.
    clear v_id.
    select single natio
    into pa0002-natio
    from pa0002
    where pernr eq int_rep-pernr.
    *-testing......for soma
    if ctr > 24.
    ctr = 0 .
    write:/1(80) sy-uline.
    new-page .
    endif.
    ctr = ctr + 1 .
    cnt = cnt + 1.
    pack int_rep-pernr to int_rep1.
    write:/1 sy-vline, 2(3) cnt intensified off,
    7 sy-vline, 9(6) int_rep1 intensified off,
    16 sy-vline,17(35) int_rep-ename intensified off .
    if ( int_rep-zlsch = 'l' or int_rep-zlsch = 'L' ).
    write : 47 sy-vline,48(15) int_rep-zweck intensified off.
    else.
    write:
    47 sy-vline,48(15) int_rep-bankn intensified off .
    endif.
    write: 63 sy-vline,64(16) int_rep-betrg
    intensified off currency 'INR',
    80 sy-vline.
    ws_betrg = ws_betrg + int_rep-betrg.
    *-testing......for soma
    skip.
    write :
    /1 sy-vline, 7 sy-vline ,16 sy-vline ,47 sy-vline,63 sy-vline,80
    sy-vline .
    *-end testing......for soma
    at end of zlsch.
    if int_rep-bankl = ' '.
    call function 'HR_IN_CHG_INR_WRDS'
    exporting
    amt_in_num = ws_betrg
    importing
    amt_in_words = amount_word
    EXCEPTIONS
    DATA_TYPE_MISMATCH = 1
    OTHERS = 2
    w_val-word = amount_word.
    concatenate 'INR.' w_val-word into w_val-word
    separated by space.
    write:/1(80) sy-uline.
    write: /1 sy-vline, 7 'Total transfer:'(009),
    64(16) ws_betrg intensified off currency 'INR',
    80 sy-vline.
    write:/1(80) sy-uline.
    write: /1 sy-vline, 3 w_val-word+0(76) intensified off,
    80 sy-vline.
    write :/1 sy-vline, 10 w_val-word+76(70) intensified off,
    80 sy-vline.
    write:/1(80) sy-uline.
    clear: ws_betrg,cnt.
    skip 2.
    write: /2 'Prepared by :'(010), '_______________'(013),
    45 'Checked by :'(011),'_______________'(013).
    skip 2.
    write: /2 'Printed On ', sy-datum,
    45 'Approved by :'(012),'_______________'(013).
    clear sy-pagno.
    endif.
    endat.
    at end of bankl.
    if int_rep-bankl ' '.
    call function 'HR_IN_CHG_INR_WRDS'
    exporting
    amt_in_num = ws_betrg
    importing
    amt_in_words = amount_word
    EXCEPTIONS
    DATA_TYPE_MISMATCH = 1
    OTHERS = 2
    w_val-word = amount_word.
    concatenate 'INR.' w_val-word into w_val-word
    separated by space.
    write:/1(80) sy-uline.
    write: /1 sy-vline, 7 'Total transfer:'(009),
    64(16) ws_betrg intensified off currency 'INR',
    80 sy-vline.
    write:/1(80) sy-uline.
    write: /1 sy-vline, 3 w_val-word+0(76) intensified off,
    80 sy-vline.
    write :/1 sy-vline, 10 w_val-word+76(70) intensified off,
    80 sy-vline.
    write:/1(80) sy-uline.
    clear: ws_betrg,cnt.
    skip 2.
    write: /2 'Prepared by :'(010), '_______________'(013),
    45 'Checked by :'(011),'_______________'(013).
    skip 2.
    write: /2 'Printed on ', sy-datum,
    45 'Approved by :'(012),'_______________'(013).
    clear sy-pagno.
    NEW-PAGE.
    endif.
    endat.
    endloop.
    End of Page
    end-of-page.
    write: /2 'Prepared by :'(010), '_______________',
    45 'Checked by :'(011),'_______________'.
    *& Form IMPORT_CLUSTER
    Importing Data from Cluster *
    form import_cluster.
    sy-subrc = 0.
    rp-imp-c2-cd.
    if sy-subrc eq 0.
    if cd-version-number ne ocd-version-number.
    endif.
    endif. " SY-SUBRC EQ 0
    endform. " IMPORT_CLUSTER
    *& Form INT_TAB
    Filling internal table tab_rgdir form int_tab.
    *Fill internal table tab_rgdir.
    move-corresponding rgdir to tab_rgdir.
    tab_rgdir-pernr = pernr-pernr.
    append tab_rgdir.
    endform. " INT_TAB
    *& Form IMPORT_bt
    Import Values from Bank Transactions Table (BT) form import_bt.
    rp-init-buffer.
    RP-IMP-C2-RX.
    rp-imp-c2-in.
    if rp-imp-in-subrc eq 0.
    if in-version-number ne oin-version-number.
    write: / 'Schlüssel des Clusters RX:'(015),
    rx-key-pernr, rx-key-seqno.
    write: / 'The imported version of the cluster'(016), 'RX',
    'is not current'(017).
    write: / 'Imported version :'(018),
    oin-version-number.
    write: / 'Current version of cluster :'(019),
    in-version-number.
    stop.
    else.
    sy-subrc = 0.
    endif.
    else.
    sy-subrc = 8.
    write: /
    'Inconsistencies between cluster directory and directory for'(020).
    write: /
    'No payroll results found for data in cluster directory'(021).
    write : /
    'Please contact hotline to solve the current problem'(022).
    endif.
    ws_fpbeg(2) = versc-fpbeg+4(2).
    ws_fpbeg+2(4) = versc-fpbeg(4).
    ws_fpend(2) = versc-fpend+4(2).
    ws_fpend+2(4) = versc-fpend(4).
    ws_mthyr(2) = pa_mth.
    ws_mthyr+2(4) = pa_year.
    check ws_mthyr = ws_fpbeg.
    check ws_mthyr = ws_fpend.
    loop at bt. "from pc209
    int_rep-pernr = pernr-pernr.
    int_rep-ename = pernr-ename.
    int_rep-bankl = bt-bankl.
    int_rep-bankn = bt-bankn.
    int_rep-betrg = bt-betrg.
    int_rep-zlsch = bt-zlsch.
    append int_rep.
    endloop.
    IF P_BANKL ' ' AND P_ZLSCH ' '.
    DELETE INT_REP WHERE BANKL P_BANKL.
    ELSEIF P_BANKL = ' ' AND P_ZLSCH ' '.
    DELETE INT_REP WHERE ZLSCH P_ZLSCH.
    ELSEIF P_BANKL ' ' AND P_ZLSCH = ' '.
    DELETE INT_REP WHERE BANKL P_BANKL.
    ENDIF.
    endform. " IMPORT_BT
    *& Form CONVERT_MONTH
    Fetching Month Text form convert_month using mth t_mth.
    case mth.
    when '01'.
    t_mth = 'January'(023).
    when '02'.
    t_mth = 'February'(024).
    when '03'.
    t_mth = 'March'(025).
    when '04'.
    t_mth = 'April'(026).
    when '05'.
    t_mth = 'May'(027).
    when '06'.
    t_mth = 'June'(028).
    when '07'.
    t_mth = 'July'(029).
    when '08'.
    t_mth = 'August'(030).
    when '09'.
    t_mth = 'September'(031).
    when '10'.
    t_mth = 'October'(032).
    when '11'.
    t_mth = 'November'(033).
    when '12'.
    t_mth = 'December'(034).
    endcase.
    endform. " CONVERT_MONTH
    *& Form CONVERT_DATE_A
    Fetching Month Text * form convert_date_a using mth_t t_mth_t.
    case mth_t.
    when '01'.
    t_mth_t = 'Jan.'(035).
    when '02'.
    t_mth_t = 'Feb.'(036).
    when '03'.
    t_mth_t = 'Mar.'(037).
    when '04'.
    t_mth_t = 'Apr.'(038).
    when '05'.
    t_mth_t = 'May.'(039).
    when '06'.
    t_mth_t = 'Jun.'(040).
    when '07'.
    t_mth_t = 'Jul.'(041).
    when '08'.
    t_mth_t = 'Aug.'(042).
    when '09'.
    t_mth_t = 'Sep.'(043).
    when '10'.
    t_mth_t = 'Oct.'(044).
    when '11'.
    t_mth_t = 'Nov.'(045).
    when '12'.
    t_mth_t = 'Dec.'(046).
    endcase.
    endform. " CONVERT_DATE_A
    *& Form VALIDATE
    text
    --> p1 text
    <-- p2 text form validate .
    if p_bankl <> ' ' and p_zlsch ' '.
    delete int_rep where bankl p_bankl.
    elseif p_bankl = ' ' and p_zlsch ' '.
    delete int_rep where zlsch p_zlsch.
    elseif p_bankl ' ' and p_zlsch = ' '.
    delete int_rep where bankl p_bankl.
    endif.
    endform. " VALIDATE
    check this weblog.....
    /people/dj.adams/blog/2003/11/13/food-for-thought-ldbs-and-abap-objects
    Also , check the following link too.
    http://www.datamanagementgroup.com/Resources/Articles/Article_1005_2.asp
    Regards,
    Harish

  • Which Syntax is best to read an infotype using PNPCE LDB ?

    Hi experts,
    Which syntax is best to read an infotype when we use PNPCE LDB.
    Thanks.
    reddy

    Hi Iredy,
    if you need to read an infotype records of the particular employee, you can use Macro RP-READ-INFOTYPE (Parameters: PERNR, INFTY, BEGDA, ENDDA)
    Macro definition you can find in table TRMAC.
    For RP-READ-INFOTYPE is definition as follows:
    RP-READ-INFOTYPE     001     ****************************************
    RP-READ-INFOTYPE     002     * RP-READ-INFOTYPE                     *
    RP-READ-INFOTYPE     003     ****************************************
    RP-READ-INFOTYPE     004     * PARAMETERS:                          *
    RP-READ-INFOTYPE     005     *   PERNR      REQUESTED PERSONALNUMBER*
    RP-READ-INFOTYPE     006     *   INFTY      REQUESTED INFOTYPNUMBER *
    RP-READ-INFOTYPE     007     *   INFTY-TABLE OUTPUT-TABLE LIKE PNNNN*
    RP-READ-INFOTYPE     008     *   BEGDA      REQUESTED INTERVAL-BEGIN*
    RP-READ-INFOTYPE     009     *   ENDDA      REQUESTED INTERVAL-END  *
    RP-READ-INFOTYPE     010     ****************************************
    RP-READ-INFOTYPE     011     *SET DEBUGGING INTERRUPT ON            *
    RP-READ-INFOTYPE     012     PERFORM READ-INFOTYPE(SAPDBPNP)        *
    RP-READ-INFOTYPE     013     TABLES &3                      *
    RP-READ-INFOTYPE     014     USING  &1 '&2' &4 &5
    RP-READ-INFOTYPE     015     *SET DEBUGGING INTERRUPT OFF           *
    It means that the macro is performing read-infotype which is defined in  include DBPNPF03 of the SAPDBPNP.

  • ABAP HR - How to insert payroll results using fm PYXX_WRITE_PAYROLL_RESULT

    Hi,
    I have a scenario where I want to read cluster information (PCL2 RX) from system A and insert it into system B. Both systems are SAP ECC 6.0. Employee master data already exists on target system, but no payroll results yet, so this is an insert and not an update.
    I am using fm PYXX_READ_PAYROLL_RESULT (I also tried with HRCM_PAYROLL_RESULTS_GET) to read the data and then calling a RFC on system B where I use fm PYXX_WRITE_PAYROLL_RESULT to write the payroll results into database. Is this fm only to use in case of update, or it should also work when inserting new lines on the cluster? Because I always get a sy-subrc=0 but nothing is created on the db. Is there any other way to this? Do you have any code samples?
    Many thanks,
    Miguel

    HI Miguel:
    I have succe add of new payroll records, the following reference code:
    *& Report  ZTEST_BJARNE8
    REPORT  ztest_bjarne8.
    TABLES:pcl1,pcl2.
    INCLUDE rpc2cd00.           "Cluster CD data definition
    INCLUDE rpc2ca00.           "Cluster CA Data-Definition
    INCLUDE pc2rxcn0.           "Cluster CN data definition
    INCLUDE rpc2rx00.           "Cluster RX data definition internat. part
    DATA: refvar_curr TYPE REF TO data.
    DATA: refvar_prev TYPE REF TO data.
    DATA: refvar_cumul TYPE REF TO data.
    DATA: t52relid_header TYPE t52relid.
    FIELD-SYMBOLS: <payresult_current>.
    DATA: employee_number LIKE pc200-pernr,
          client           LIKE sy-mandt,
          globalmolga      TYPE T500L-MOLGA,
          cluster_id       LIKE t500l-relid,
          isocode          LIKE t500l-intca.
    DATA: rgdir_entry LIKE pc261.
    CALL FUNCTION 'HR_PCLX_INIT_BUFFER'.
    employee_number = '81000463'.
    CLEAR:rgdir.REFRESH rgdir[].
    CALL FUNCTION 'CU_READ_RGDIR_NEW'
      EXPORTING
        persnr                = employee_number
        check_read_authority  = space
        imp_client            = client
      TABLES
        in_rgdir              = rgdir
      EXCEPTIONS
        no_record_found       = 1
        import_mismatch_error = 2
        no_read_authority     = 3
        OTHERS                = 4.
    LOOP AT rgdir.
    ENDLOOP.
    cluster_id = 'CN'.
    SELECT SINGLE * FROM t52relid INTO t52relid_header
                           WHERE relid = cluster_id.
    CREATE DATA refvar_curr TYPE (t52relid_header-typename).
    ASSIGN refvar_curr->* TO <payresult_current>.
    CALL FUNCTION 'PYXX_READ_PAYROLL_RESULT'
      EXPORTING
        clusterid                    = cluster_id
        employeenumber               = employee_number
        sequencenumber               = rgdir-seqnr
        check_read_authority         = space"false "already done
        filter_cumulations           = space
      CHANGING
        payroll_result               = <payresult_current>
      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
        OTHERS                       = 8.
    IF NOT <payresult_current> IS INITIAL.
      "TODO changed RT data......
      "Add new month payresult
       rgdir-seqnr = rgdir-seqnr + 1.
      CALL FUNCTION 'PYXX_WRITE_PAYROLL_RESULT'
        EXPORTING
          clusterid                          = cluster_id
          employeenumber                     = employee_number
          sequencenumber                     = rgdir-seqnr
          payroll_result                     = <payresult_current>
          CLIENT                             =
       EXCEPTIONS
         illegal_isocode_or_clusterid       = 1
         error_generating_export            = 2
         export_error                       = 3
         subpool_dir_full                   = 4
         no_update_authority                = 5
         incomplete_result_imported         = 6
         OTHERS                             = 7
      IF sy-subrc <> 0.
      ENDIF.
      APPEND rgdir.
       globalmolga = '28'.
       client = '200'.
      CALL FUNCTION 'CU_WRITE_RGDIR_NEW'
        EXPORTING
          persnr              = employee_number
          molga               = globalmolga
          imp_client          = client
        TABLES
          rgdir               = rgdir
        EXCEPTIONS
          no_update_authority = 1
          OTHERS              = 2.
      CALL FUNCTION 'HR_FLUSH_BUFFER_UPDATE_PCLX'
        EXPORTING
          test                = space
        EXCEPTIONS
          insert_error        = 1
          no_update_authority = 2
          OTHERS              = 3.
      IF sy-subrc <> 0.
        "MESSAGE e062.
      ENDIF.
    ENDIF.
    "INCLUDE  rpc2cd09.
    *& INCLUDE
    INCLUDE rpppxd00.           "Data definition buffer PCL1/PCL2
    INCLUDE rpppxd10.           "Common part buffer PCL1/PCL2
    INCLUDE rpppxm00.           "Buffer handling routine

  • How to find payroll results using includes

    hi all,
          I have a requirement to get the payroll results of number of data clusters using includes not by using function modules.
    I know by using function modules.
          How to find out the exact include for given data cluster. If there is any path please let me know.
    thanks & regards,
        sekhar.

    Hi,
    You can define macros in the program and call depending on the cluster you need.
    For Eg  for B2 cluster,
    rp-imp-c2-b2.
    before calling macros,
    You should fill the key
    move pernr  to b2-key-pernr.
      move year         to b2-key-pabrj.
      move period       to b2-key-pabrp.
      move '1'          to b2-key-cltyp.
    rp-imp-c2-b2.
    For payroll
    RP-IMP-C2-RU
    Regards,
    Manoj.

  • HR-ABAP - By using PNPCE - LDB.

    hi,
    I want to add the fields values of table pa0033.
    The fields are (Aus01, Aus02,Aus03----Aus20).
    But these are character fields. kindly guide me.

    Hello,
    Copy the fields in a integer field and copy them.
    You could declare an internal table with integer field names and copy them across.
    Then add them and move them back to the charater field for display.

  • Error while declaring RT_PERSON using pnpce ldb

    when am declaring
    data : RT_PERSON like line of PC2RT_PERSON.
    am getting an error msg that
    "FIELD 'PC2RT_PERSON' is unknown .it is neither in the specified tables, nor in the DATA statement".
    whatz the error .what should i do.
    points will be rewarded.
    thanks in advance.

    declare as :
    data : RT_PERSON like PC2RT_PERSON.

  • PNPCE -- Payroll results

    When using PNPCE LDB, how to retrive payroll record for an employee.
    Regards
    Manvi

    Hi,
    Please refer to the following code.
    Basically the payroll data is stored in  the Cluster tables PCL1 and PCL2.
    If help ful please reward points.
    Regards,
    Irfan Hussain
    *& Report  ZHR_READ_CLUSTER                                            *
    REPORT  ZHR_READ_CLUSTER                        .
    TABLES : PERNR,
           PCL1,
           PCL2.
    Infotypes : 0001,
               0002.
    Data : molga like t001p-molga,
         num  like pc261-seqnr.
                       STANDARD INCLUDES                                *
    INCLUDE rpc2cd09.  " Data Definition - CD Cluster INCLUDE rpc2ca00.  " Data Definition Import/Export Macros for ClusterCA INCLUDE rpc2ruu0.  " Data Definition for Cluster RU (USA) INCLUDE rpc2rx09.  " Cluster RU Data-Definition internat. part INCLUDE rpppxd00.  " Data befinition buffer PCL1/PCL2 INCLUDE rpppxd10.  " Common part buffer PCL1/PCL2 INCLUDE rpppxm00.  " Buffer handling routine
    Start-Of-Selection.
    Get Pernr.
    rp_provide_from_last p0001 space pn-begda pn-endda.
    CALL FUNCTION 'CU_READ_RGDIR'
    EXPORTING
       persnr                  = pernr-pernr
    IMPORTING
    MOLGA                    = molga
    tables
       in_rgdir                = rgdir
    EXCEPTIONS
    NO_RECORD_FOUND          = 1
    OTHERS                  = 2
    IF sy-subrc = 1.
    write /: 'No Records Found'.
    ENDIF.
    CALL FUNCTION 'CD_READ_LAST'
    EXPORTING
       begin_date            = pn-begda
       end_date              = pn-endda
    IMPORTING
    OUT_SEQNR            = num
    tables
       rgdir                = rgdir
    EXCEPTIONS
    NO_RECORD_FOUND      = 1
    OTHERS                = 2
    IF sy-subrc = 1.
    write :/ ' No Payroll Exist'.
    ELSE.
    rx-key-pernr = pernr-pernr.
    rx-key-seqno = num.
    rp-imp-c2-ru.
    IF SY-SUBRC = 0.
    PERFORM PRINT_FORM.
    ELSE.
    WRITE :/ 'Results Could not be read this time'.
    endif.
    ENDIF.
    *&      Form  PRINT_FORM
         text
    -->  p1        text
    <--  p2        text
    form PRINT_FORM .
    DATA : l_betrg LIKE p0008-bet01,
         l_betrg1 like p0008-bet01.
    read table rgdir with key seqnr = num.
    IF sy-subrc = 0.
       WRITE:  /1 'Empd id' COLOR 1,20 p0001-pernr COLOR 5,
               /1 'Name' COLOR 1,20 p0001-ename COLOR 5,
               /1 'Personnel Area' COLOR 1,20 p0001-werks COLOR 5,
               /1 'Personnel Subarea' COLOR 1 ,20 p0001-btrtl COLOR 5.
       SKIP 1.
       WRITE: / 'For-period' COLOR 1, 30 rgdir-fpper  COLOR 3,
               / 'In-period' COLOR 1, 30 rgdir-inper COLOR 3.
       SKIP 1.
    ENDIF.
    loop at crt where lgart = '/101' or lgart = '\5UH' .
           if crt-cumty = 'Q'.
                 l_betrg = l_betrg + crt-betrg.
           endif.
    endloop.
    loop at crt where lgart = '/102' and cumty = 'Y'.
               l_betrg1 = l_betrg1 + crt-betrg.
    endloop.
    l_betrg1 = l_betrg1 / 4.
    l_betrg = l_betrg + l_betrg1.
    write :/ l_betrg.
    endform.                    " PRINT_FORM

  • Finding the latest payroll results and its  CRT table.

    Hi all,
    My requirment is to fetch the value from the CRT table of the latest payroll result,
    so that at any point of time it fetches the cumulative value till date from the CRT table.

    Hi
    use the fun module
    PYXX_READ_PAYROLL_RESULT
    for fetching the payroll results
    or see the sample code how to fetch the payroll results using the RT table.
    report zovertime
           line-size 252
           line-count 60(1)
           no standard page heading
           message-id zndc.
    Database Tables & Infotypes
    tables: pcl1,        " HR Cluster1
            pcl2,        " HR Cluster1
            pa0003,      " Master data - Payroll Status
            cskt,        " Cost Center Texts
            t528t,       " Positions Texts
            t513s,       " Job Titles
            pernr,       " Logical PNP
            t001p,       " Personnel Subarea
            t500p,       " Personnel Area
            t501,        " Employee Group
            t503k,       " Employee Subgroup
            csks.        " Cost Center
    infotypes:0000,0001.
    *include rpclst00.
    include rpc2rx00.
    include rpc2rxx0.
    include rpc2cd00.
    *include rpc2ps00.
    *include rpc2pt00.
    *include rpcfvp00.
    *include rpcfdc10.
    *include rpcfdc00.
    include rpppxd00.
    include rpppxd10.
    Declaration of Internal Tables
    Internal Table for Output Data
    data: begin of rep_tab occurs 0,
            kostl like pa0001-kostl,      " Cost Center
            pernr like pa0001-pernr,      " Personal Number
            ename like pa0001-ename,      " Employee Name
            ctext like cskt-ltext,        " Cost Center Text
            ptext like t528t-plstx,       " Position Text
            ot1   type p decimals 2,      " Jan OT Amount
            ot2   type p decimals 2,      " Feb OT Amount
            ot3   type p decimals 2,      " Mar OT Amount
            ot4   type p decimals 2,      " Apr OT Amount
            ot5   type p decimals 2,      " May OT Amount
            ot6   type p decimals 2,      " Jun OT Amount
            ot7   type p decimals 2,      " Jul OT Amount
            ot8   type p decimals 2,      " Aug OT Amount
            ot9   type p decimals 2,      " Sep OT Amount
            ot10  type p decimals 2,      " Oct OT Amount
            ot11  type p decimals 2,      " Nov OT Amount
            ot12  type p decimals 2,      " Dec OT Amount
            ott   type p decimals 2,      " Total OT Amount
          end of rep_tab.
    Declaration of Variables
    data: v_mon(2) type n,                   " Month
          v_no     type i,                   " Data Lines
          v_year(4)  type c,                 " Year
          v_date   like sy-datum,            " Date
          v_date1  like sy-datum,            " Date
          v_seqnr  like  pc261-seqnr.        " Sequence No.
    Declaration of Constants
    data: c_type   like hrp1001-otype  value 'S',  " Object Type
          c_kokrs  like cskt-kokrs value '1000',   " Controlling Area
          c_date1  like sy-datum value '18000101', " Date
          c_date2  like sy-datum value '99991231', " Date
          c_x       type c value 'X',              " Sign
         c_mon(2)  type c value '01',             " Month
          c_val1(2) type c value '31',             " Date
          c_val2(2) type c value '12',             " Month Type
          c_val    like p0041-dar01 value '01',    " Date Type
          c_lgart1 like p0008-lga01 value '0722',  " Wage Type
          c_lgart2 like p0008-lga01 value '0723',  " Wage Type
          c_1(2)   type n value '01',                           " Month1
          c_2(2)   type n value '02',                           " Month2
          c_3(2)   type n value '03',                           " Month3
          c_4(2)   type n value '04',                           " Month4
          c_5(2)   type n value '05',                           " Month5
          c_6(2)   type n value '06',                           " Month6
          c_7(2)   type n value '07',                           " Month7
          c_8(2)   type n value '08',                           " Month8
          c_9(2)   type n value '09',                           " Month9
          c_10(2)  type n value '10',                           " Month10
          c_11(2)  type n value '11',                           " Month11
          c_12(2)  type n value '12'.                           " Month12
    Selection-screen
    parameters:
      p_year like pc2b0-pabrj obligatory.       " Payroll Year
    At selection-screen
    at selection-screen.
    Validate the Selection Screen fields
      perform validate_screen.
    Start-of-Selection
    start-of-selection.
    Selection of Period
      perform get_period.
    Get PERNR from LDB
    get pernr.
    Get the Master data from infotype 0001
      perform get_master_data.
    Top-of-page
    top-of-page.
    Write the Report and Column Headings
      perform top_of_page.
    End-of-Page
    end-of-page.
      write /1(252) sy-uline.
    End-of-Selection
    end-of-selection.
    Display the Output Report.
      perform display_report.
    Form-Routines
    *&      Form  validate_screen
    Validation of selection Screen fields
    form validate_screen.
    Validation of Cost Center
      clear csks.
      if not pnpkostl[] is initial.
        select single kostl
          into csks-kostl
          from csks
          where kostl in pnpkostl.
        if sy-subrc <> 0.
          message e999 with 'Invalid Cost Center'(003).
        endif.
      endif.
    Validation of Personnel Number
      clear pa0003.
      if not pnppernr[] is initial.
        select pernr
        from pa0003 up to 1 rows
          into pa0003-pernr
          where pernr in pnppernr.
        endselect.
        if sy-subrc <> 0.
          message e999 with 'Incorrect Personal Number Entered'(002).
        endif.
      endif.
    Validation of Personnel Area
      clear t500p.
      if not pnpwerks[] is initial.
        select persa
        from t500p up to 1 rows
          into t500p-persa
          where persa in pnpwerks.
        endselect.
        if sy-subrc <> 0.
          message e999 with 'Incorrect Personnel Area Entered'(001).
        endif.
      endif.
    Validation of Personnel Sub Area
      clear t001p.
      if not pnpbtrtl[] is initial.
        select btrtl
        from t001p up to 1 rows
          into t001p-btrtl
          where btrtl in pnpbtrtl.
        endselect.
        if sy-subrc <> 0.
          message e999 with 'Incorrect Personnel Sub Area Entered'(037).
        endif.
      endif.
    Validation of Employee Group
      clear t501.
      if not pnppersg[] is initial.
        select persg
        from t501 up to 1 rows
          into t501-persg
          where persg in pnppersg.
        endselect.
        if sy-subrc <> 0.
          message e999 with 'Incorrect Employee Group Entered'(038).
        endif.
      endif.
    Validation of Employee Sub Group
      clear t503k.
      if not pnppersk[] is initial.
        select persk
        from t503k up to 1 rows
          into t503k-persk
          where persk in pnppersk.
        endselect.
        if sy-subrc <> 0.
          message e999 with 'Incorrect Employee Sub Group Entered'(039).
        endif.
      endif.
    endform.                  "validate_screen
    *&      Form  get_period
    Get the Correct Period based on Selection screen selection
    form get_period.
      clear: v_year,v_mon, v_date, v_date1.
      v_year = sy-datum+0(4).
      v_mon  = sy-datum+4(2).
      if pnptimr1 = c_x.      " Current Date
        pnpbegda = sy-datum.
        pnpendda = sy-datum.
      elseif pnptimr2 = c_x.  " Current Month
        concatenate v_year v_mon c_val into v_date.
        concatenate v_year v_mon c_val1 into v_date1.
        pnpbegda = v_date.
        pnpendda = v_date1.
      elseif pnptimr3 = c_x.  " Current Year
        concatenate v_year c_val c_val into v_date.
        concatenate v_year c_val2 c_val1 into v_date1.
        pnpbegda = v_date.
        pnpendda = v_date1.
      elseif pnptimr4 = c_x.  " Upto Today
        pnpbegda = c_date1.
        pnpendda = sy-datum.
      elseif pnptimr5 = c_x.  " From Today
        pnpbegda = sy-datum.
        pnpendda = c_date2.
      else.
        if ( pnpbegda is initial and pnpendda is initial ).
          pnpbegda = c_date1.
          pnpendda = c_date2.
        elseif pnpbegda is initial and not pnpendda is initial.
          pnpbegda = c_date1.
          pnpendda = pnpendda.
        elseif not ( pnpbegda is initial and pnpendda is initial ).
          pnpbegda = pnpbegda.
          pnpendda = pnpendda.
        endif.
      endif.
    endform.              "get_period
    *&      Form  get_master_data
    Get the Master Data from Database Tables PA0001,0002,0003
    form get_master_data.
    Get data from Respective Infotypes
      rp_provide_from_last p0001 space pnpbegda pnpendda.
      if p0001-kostl in pnpkostl.
        rep_tab-kostl = p0001-kostl.
        rep_tab-pernr = p0001-pernr.
        rep_tab-ename = p0001-ename.
    Get the Position Text
        clear t528t-plstx.
        select single plstx into t528t-plstx from t528t
                where plans = p0001-plans and
                      otype = c_type and
                      sprsl = sy-langu.
        if sy-subrc = 0.
          rep_tab-ptext = t528t-plstx.
        endif.
    Get the Cost Center Text
        clear cskt-ltext.
        select single ltext into cskt-ltext from cskt
                where spras = sy-langu and
                      kokrs = c_kokrs and
                      kostl = p0001-kostl.
        if sy-subrc = 0.
          rep_tab-ctext = cskt-ltext.
        endif.
    Get the Overtime Payment Data
        perform get_ot_data.
        rep_tab-ott = rep_tab-ot1 + rep_tab-ot2 + rep_tab-ot3 +
                      rep_tab-ot4 + rep_tab-ot5 + rep_tab-ot6 +
                      rep_tab-ot7 + rep_tab-ot8 + rep_tab-ot9 +
                      rep_tab-ot10 + rep_tab-ot11 + rep_tab-ot12.
        append rep_tab.
        clear  rep_tab.
      endif.
      sort rep_tab by kostl pernr.
      delete rep_tab where kostl = ' '.
      delete rep_tab where ott = 0.
    endform.                 "get_master_data
    *&      Form  get_ot_data
    Get the Overtime Payment Data
    form get_ot_data.
      cd-key = pernr-pernr.
      rp-imp-c2-cd.
      sort rgdir by seqnr.
    To get sequence number for the payroll period
      loop at rgdir where void     is initial
                        and reversal is initial
                        and outofseq is initial
                        and srtza    eq 'A'.
        if rgdir-fpper+0(4) = p_year.
    To consider offcycle run data
          if not rgdir-ocrsn is initial.
            v_seqnr = rgdir-seqnr.
            exit.
          endif.
          v_seqnr = rgdir-seqnr.
        endif.
        if not v_seqnr is initial.
          perform import_rx.
        endif.
        perform process_wagetypes.
      endloop.
    endform.                 "get_ot_data
    include rpppxm00.
    *&      Form  Import_rx
    Import the RX data from Clusters
    form import_rx.
      rx-key-pernr = cd-key-pernr.
      rx-key-seqno = v_seqnr.
      rp-init-buffer.
      rp-imp-c2-rx.
    endform.                    " Import_rx
    *&      Form  Process_wagetypes
    Calculate the Overtime Amount based on Wage types
    form process_wagetypes.
      loop at rt.
        if  rt-lgart = c_lgart1 or rt-lgart = c_lgart2.
          if rgdir-fpper+0(4) = p_year.
            v_mon = rgdir-fpper+4(2).
            case v_mon .
              when c_1.
                rep_tab-ot1 = rep_tab-ot1 + rt-betrg.
              when c_2.
                rep_tab-ot2 = rep_tab-ot2 + rt-betrg.
              when c_3.
                rep_tab-ot3 = rep_tab-ot3 + rt-betrg.
              when c_4.
                rep_tab-ot4 = rep_tab-ot4 + rt-betrg.
              when c_5.
                rep_tab-ot5 = rep_tab-ot5 + rt-betrg.
              when c_6.
                rep_tab-ot6 = rep_tab-ot6 + rt-betrg.
              when c_7.
                rep_tab-ot7 = rep_tab-ot7 + rt-betrg.
              when c_8.
                rep_tab-ot8 = rep_tab-ot8 + rt-betrg.
              when c_9.
                rep_tab-ot9 = rep_tab-ot9 + rt-betrg.
              when c_10.
                rep_tab-ot10 = rep_tab-ot10 + rt-betrg.
              when c_11.
                rep_tab-ot11 = rep_tab-ot11 + rt-betrg.
              when c_12.
                rep_tab-ot12 = rep_tab-ot12 + rt-betrg.
            endcase.
          endif.
        endif.
      endloop.
    endform.          "process_wagetypes
    *&      Form  top_of_page
    Write the Report and Column Headings
    form top_of_page.
      format color col_heading on.
      write: /1(252) 'NATIONAL DRILLING COMPANY'(010) centered,
             /1(252) 'Overtime Payments Details'(011) centered.
      format color off.
      if pnptimr1 = c_x.      " Current Date
        write: /2 'Period From     :'(036), sy-datum, 'To:'(006), sy-datum.
      elseif pnptimr2 = c_x.  " Current Month
        write: /2 'Period From     :'(036), v_date, 'To:'(006), v_date1.
      elseif pnptimr3 = c_x.  " Current Year
        write: /2 'Period From     :'(036), v_date, 'To:'(006), v_date1.
      elseif pnptimr4 = c_x.  " Upto Today
        write: /2 'Period From     :'(036), c_date1, 'To:'(006), sy-datum.
      elseif pnptimr5 = c_x.  " From Today
        write: /2 'Period From     :'(036), sy-datum, 'To:'(006), c_date2.
      else.
        if ( pnpbegda is initial and pnpendda is initial ).
          write: /2 'Period From     :'(036), c_date1, 'To:'(006), c_date2.
        elseif pnpbegda is initial and not pnpendda is initial.
          write: /2 'Period From     :'(036), c_date1, 'To:'(006), pnpendda.
        elseif not ( pnpbegda is initial and pnpendda is initial ).
          write: /2 'Period From     :'(036), pnpbegda,
                   'To:'(006), pnpendda.
        endif.
      endif.
      write: 219 'Report Run Date:'(018), sy-datum.
      if not pnpkostl[] is initial.
        if pnpkostl-high is initial.
          write: /2 'Cost Center     :'(004), pnpkostl-low,
                219 'Time           :'(020), sy-uzeit.
        else.
          write: /2 'Cost Center From:'(005), pnpkostl-low+7(3),
                                    'To:'(006), pnpkostl-high,
                219 'Time           :'(020), sy-uzeit.
        endif.
      else.
        write: /219  'Time           :'(020), sy-uzeit.
      endif.
      if not pnppernr[] is initial.
        if pnppernr-high is initial.
          write: /2 'Personal Number :'(007), pnppernr-low,
                 219 'User           :'(021), sy-uname.
        else.
          write: /2 'Personal No.From:'(008),  pnppernr-low,
                                    'To:'(006), pnppernr-high,
                 219 'User           :'(021), sy-uname.
        endif.
      else.
        write: /219 'User           :'(021), sy-uname.
      endif.
      write: /219 'Page No        :'(022), sy-pagno.
      format color col_heading.
      write /1(252) sy-uline.
      write:/1 sy-vline, 10 sy-vline,
            41 sy-vline,
            67 sy-vline, 68(167) 'Overtime Payments(Dirhams)'(013) centered,
           235 sy-vline,252 sy-vline.
      format color col_heading.
      write:/1 sy-vline,  2(8)  'Emp #'(019) centered,
            10 sy-vline, 11(30) 'Employee Name'(012) centered,
            41 sy-vline, 42(25) 'Position'(014) centered,
            67 sy-vline, 68(167)  sy-uline,
           235 sy-vline,236(16)  'Total'(017) centered,
           252 sy-vline.
      write:/1 sy-vline, 10 sy-vline,
            41 sy-vline,
            67 sy-vline, 68(13)  'JANUARY'(024) centered,
            81 sy-vline, 82(13)  'FEBRUARY'(025) centered,
            95 sy-vline, 96(13)  'MARCH'(026) centered,
           109 sy-vline,110(13)  'APRIL'(027) centered,
           123 sy-vline,124(13)  'MAY'(028) centered,
           137 sy-vline,138(13)  'JUNE'(029) centered,
           151 sy-vline,152(13)  'JULY'(030) centered,
           165 sy-vline,166(13)  'AUGUST'(031) centered,
           179 sy-vline,180(13)  'SEPTEMBER'(032) centered,
           193 sy-vline,194(13)  'OCTOBER'(033) centered,
           207 sy-vline,208(13)  'NOVEMBER'(034) centered,
           221 sy-vline,222(13)  'DECEMBER'(035) centered,
           235 sy-vline,252 sy-vline.
      format color off.
      write /1(252) sy-uline.
    endform.            "top_of_page
    *&      Form  Display_report
    Write the Report Output
    form display_report.
      clear v_no.
      describe table rep_tab lines v_no.
      if v_no = 0.
        message i999 with
         'No Data found for the entered Selection'(015).
      endif.
      loop at rep_tab.
        format color 3.
        at new kostl.
          read table rep_tab index sy-tabix.
          write:/1 sy-vline, 2(12) 'Cost Center:'(009),
                 14(10) rep_tab-kostl,
                 25(30) rep_tab-ctext,
                252 sy-vline.
          format color off.
          write /1(252) sy-uline.
        endat.
        format color col_normal.
        write: /1 sy-vline, 2(8)   rep_tab-pernr,
              10 sy-vline, 11(30)  rep_tab-ename,
              41 sy-vline, 42(25)  rep_tab-ptext,
              67 sy-vline, 68(13)  rep_tab-ot1 no-zero,
              81 sy-vline, 82(13)  rep_tab-ot2 no-zero,
              95 sy-vline, 96(13)  rep_tab-ot3 no-zero,
             109 sy-vline,110(13)  rep_tab-ot4 no-zero,
             123 sy-vline,124(13)  rep_tab-ot5 no-zero,
             137 sy-vline,138(13)  rep_tab-ot6 no-zero,
             151 sy-vline,152(13)  rep_tab-ot7 no-zero,
             165 sy-vline,166(13)  rep_tab-ot8 no-zero,
             179 sy-vline,180(13)  rep_tab-ot9 no-zero,
             193 sy-vline,194(13)  rep_tab-ot10 no-zero,
             207 sy-vline,208(13)  rep_tab-ot11 no-zero,
             221 sy-vline,222(13)  rep_tab-ot12 no-zero,
             235 sy-vline,236(16)  rep_tab-ott no-zero,
             252 sy-vline.
        at end of kostl.
          write /1(252) sy-uline.
        endat.
        format color off.
        at last.
          sum.
          format color 1.
          write: /1 sy-vline,
                10 sy-vline, 11(30) 'Total'(017) centered,
                41 sy-vline,
                67 sy-vline, 68(13)  rep_tab-ot1 no-zero,
                81 sy-vline, 82(13)  rep_tab-ot2 no-zero,
                95 sy-vline, 96(13)  rep_tab-ot3 no-zero,
               109 sy-vline,110(13)  rep_tab-ot4 no-zero,
               123 sy-vline,124(13)  rep_tab-ot5 no-zero,
               137 sy-vline,138(13)  rep_tab-ot6 no-zero,
               151 sy-vline,152(13)  rep_tab-ot7 no-zero,
               165 sy-vline,166(13)  rep_tab-ot8 no-zero,
               179 sy-vline,180(13)  rep_tab-ot9 no-zero,
               193 sy-vline,194(13)  rep_tab-ot10 no-zero,
               207 sy-vline,208(13)  rep_tab-ot11 no-zero,
               221 sy-vline,222(13)  rep_tab-ot12 no-zero,
               235 sy-vline,236(16)  rep_tab-ott no-zero,
               252 sy-vline.
          write /1(252) sy-uline.
        endat.
        format color off.
      endloop.
    endform.          "display_report
    Reward points if useful
    Regards
    Anji

  • Get data from PNPCE LDB in ABAP hr

    Hi all,
    I am workng on ABAP Hr.In it I am using PNPCE LDB, when I
    use GET PERNR statement  it don't give any syntax problem but the selection screen does not generate due to GET PERNR statement.
    Is there any Other statement to find the PERNR.
    Points will be sured for valuable answers.
    Thanks
    Sanket sethi

    A report that wants to use the PNPCE must enter this in its report attributes under Logical database.
    In addition, the PERNR structure must be declared in the report using the 'TABLES PERNR' statement. You can only use the PERNR structure again in certain circumstances. The use of the 'GET PERNR' event is therefore forbidden. Instead, use the 'GET PERAS' event. Except for the PERNR-PERNR component, all other components of the PERNR structure are no longer filled and have initial values. This kind of programming (with the exception of PERNR-PERNR) therefore not permitted.
    In addition to the 'GET PERAS' event, you can also use the GET PERSON' and 'GET GROUP' events. To be able to use these events, you must declare them using the NODES statement (NODES PERSON', 'NODES GROUP', or. NODES PERAS'.LdB's for HR are as follows:
    PA----
    PNP
    Payroll----
    PNPCE
    Recruitment -
    PAP
    Orgmanagement -
    PCH
    PA report Example in attrubutes u have to add LDB is PNPCE
    REPORT ZHR_TEST.
    Type-Pools *
    TYPE-POOLS : slis.
    Nodes *
    NODES: person,group,peras.
    Tables *
    TABLES: pernr,t512w,tfkbt,pa0022,pa0016,bkpf.
    Infotypes *
    INFOTYPES : 0000, "Actions
                         0001, "Org Details
                         0022, "Education Details
                         0041, "Date Specification
                         0002, "Personal Details
                         0016.
    Internal Tables *
    DATA :BEGIN OF t_output OCCURS 0,
               pernr TYPE pernr_d, " Personnel No.
               ename TYPE emnam, " Employee Name
               btrtl TYPE btrtl, "Personnel Subarea
               btext TYPE btext, "Personnel Subarea Text
               persk TYPE persk, "Grade
               ptext TYPE pktxt, "gradeText
    END OF t_output.
    DATA: t_fcat TYPE slis_t_fieldcat_alv.
    ALV Variable
    DATA : w_fieldcat TYPE slis_t_fieldcat_alv,
                wa_fieldcat TYPE slis_fieldcat_alv.
    Event : GET Pernr *
    GET peras.
    PERFORM read_data. "Data Selection
    Event : End-Of-Selection *
    END-OF-SELECTION.
    PERFORM f_addcat. "Field Cat
    PERFORM f_display. "Display
    *& Form read_data
    FORM read_data.
    *Organizational Assignment
    rp_provide_from_last p0001 space pn-begda pn-endda.
    IF pnp-sw-found EQ 1.
    t_output-pernr = p0001-pernr.
    t_output-ename = p0001-ename.
    t_output-btrtl = p0001-btrtl.
    t_output-persk = p0001-persk.
    *Personal sub area text
    SELECT SINGLE btext FROM t001p
    INTO t_output-btext
    WHERE btrtl = t_output-btrtl.
    *Grade text
    SELECT SINGLE ptext FROM t503t
    INTO t_output-ptext
    WHERE persk = t_output-persk AND
    sprsl = 'EN'.
    ENDIF.
    APPEND t_output.
    CLEAR t_output.
    ENDFORM. "
    *& Form f_addcat
    FORM f_addcat .
    *************Filling field catelog here.**************
    *& Form f_display
    FORM f_display.
    *Local Variable
    DATA : lv_repid LIKE sy-repid,
    ls_layout TYPE slis_layout_alv.
    lv_repid = sy-repid.
    ls_layout-zebra = 'X'.
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
    EXPORTING
    i_callback_program = lv_repid
    is_layout = ls_layout
    it_fieldcat = t_fcat
    i_save = 'A'
    TABLES
    t_outtab = t_output
    EXCEPTIONS
    program_error = 1
    OTHERS = 2.
    IF sy-subrc 0.
    MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
    WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    ENDIF.
    ENDFORM. " f_display

  • Read Payroll Result table.

    Hi,
    Could you please explain to me the procedure or the different steps needed to read the payroll result table for a particular country?To be more specific for my present req. the country is Canada.I'm new to the payroll module and hence do not know how the payroll procedure is executed.
    A code example will be greatly appreciated.
    Any help will be of good to me.
    Thanks,
    Sandeep.
    Edited by: Sandeep Ram on Mar 24, 2008 1:41 PM

    include rpc2cd09.           "Cluster CD Data-Definition
    include rpc2ca00.           "Cluster CA Data-Definition
    include RPC2RKK0.       "Cluster RK Data-Definition
    include rpc2rx09.           "Cluster internat. part
    include rpppxd00.           "Data befinition buffer PCL1/PCL2
    include rpppxd10.           "Common part buffer PCL1/PCL2
    include rpppxm00.          "Buffer handling routine
    data : it_rgdir like pc261 occurs 0 with header line.
    data : it_rt like PC207 occurs 0 with header line.
    First get the payroll results using the FM : CU_READ_RGDIR
      CALL FUNCTION 'CU_READ_RGDIR'
          EXPORTING
            persnr   = p_pernr  <-- pass pernr here ...
          TABLES
            in_rgdir = it_rgdir.
        IF sy-subrc = 0.
          SORT it_rgdir BY seqnr.
        ENDIF.
        LOOP AT it_rgdir WHERE srtza = 'A'
                        AND   void IS INITIAL
                        AND   reversal IS INITIAL
                        AND   fpper = v_fpper.   <-- Pass the period for
             which U want to get the payroll results
              v_seqnr = it_rgdir-seqnr. 
        ENDLOOP.
        rx-key-pernr = p_pernr.
        rx-key-seqno = v_seqnr.
        rp-imp-c2-rk.   <-- relid for canada is 'RK'
    it_rt[] = rt[]. ---> results table ...
    Now loop at rt .. and get the amounts for wage types ...
    just an example ...
    loop at it_rt.
      if it_rt-lgart = '/101'.
         v_betrg = it_rt-betrg.
      endif.
    endloop.

  • How to retrieve time data from infotypes 2001 and 2002 when we use PNPCE

    Hello Everyone,
       I am new in using PNPCE ldb.In the requirement i have to retrieve time data from infotypes 2001 and 2002 between the begda and endda.I tried using the macro RP-READ-ALL-TIME-ITY to retrieve data.But its not supporting.Can some body help me in doing this.
    THanks in Advance..
    Regards,
    Chinni.

    Hi
       Try the following code:
    REPORT  ZHRTM41.
    nodes peras.
    Tables: PERNR.
    Infotypes: 2001.
    start-of-selection.
    get peras.
    rp_read_all_time_ity pn-begda pn-endda.
    end-of-selection.
    loop at p2001.
    write:/ p2001-abwtg,p2001-stdaz.
    endloop.
        It worked for me when using PNPCE. let me know if you have any problem
    Thanks,
    V.Nagaraju

  • HR ABAP - (PNPCE - LDB)

    hi,
       I am using PNPCE-LDB, I want the selection screen o/p as like PNP(selection screen). guide me on this.

    Hi rajesh,
    1. If u want your own screen,
       then just don't define
    TABLES : PERNR.
    (no default screen of the ldb will come)
    2.
    report abc.
    parameters : a type c.
    regards,
    amit m.

  • Get data from PNPCE LDB

    Hi all,
    I am workng on ABAP Hr.In it I am using PNPCE LDB, when I
    use GET PERNR statement it don't give any syntax problem but the selection screen does not generate due to GET PERNR statement.
    Is there any Other statement to find the PERNR.
    Points will be sured for valuable answers.
    Thanks
    Sanket sethi

    In addition, the PERNR structure must be declared in the report using the 'TABLES PERNR' statement. You can only use the PERNR structure again in certain circumstances. The use of the 'GET PERNR' event is therefore forbidden. Instead, use the 'GET PERAS' event. Except for the PERNR-PERNR component, all other components of the PERNR structure are no longer filled and have initial values.
    In addition to the 'GET PERAS' event, you can also use the 'GET PERSON' and 'GET GROUP' events. To be able to use these events, you must declare them using the NODES statement ('NODES PERSON', 'NODES GROUP', or 'NODES PERAS').

Maybe you are looking for

  • A NULL interface pointer has been dereferenced

    This was an answer to someone who had this error message. I scoured the web to see what I could find. This is what I wrote to him. Does anyone else have any answers or know a work around??? Hello, After doing some research on the error message, "A NU

  • Post & Commit

    Hi Experts, I have a multi-block form, which issues POST and COMMIT on different situations. But the operations fire the same triggers and I'm generating some sequences in Commit operation which are getting generated even in POST operation. I need to

  • Oracle Enterprise Manager Cloud Control v12.1.0.3.0

    Is it possible to install the oracle agent in db server with ORACLE 10? There is any workaround, I would like to monitor also dbserve oracle 10 with em12c agent. Thanks,

  • Activated Hierarchy Level

    Hi Everyone, Need to show the Activated Hierarchy Level in the reporting header (Upper left corner of the Excel Sheet). Is there any way. I tried out the option of activating the display option if the "Value of Nodes" in the properties of the hierarc

  • Mail from iCloud in Dutch & I speak French

    Hey! I live in Belgium (country where they are 3 languages : Dutch, French and German) In fact I speak frenchso my computer & my iPhone and iCloud are in french. But when I use iCloud to localise my iphone for exemple, I receive an email from iCloud