Payroll details

Hi,
i am new to HR i got training for PA & OM wants to learn Payroll of USA please if anyone have any documents to review ..please forward to [email protected]
regards

Did you check this <a href="http://help.sap.com/saphelp_erp2005vp/helpdata/en/d8/c9e93401bdee06e10000009b38f83b/frameset.htm">SAP help</a> & this <a href="http://www.sap-press.com/product.cfm?account=&product=H1954">book</a> ?
~Suresh

Similar Messages

  • A FUNCTION MODULE FOR THE HR MODULE FOR PAYROLL OF EMPLOYEES

    hi,
    i want some a function module or code where i need to get the payroll details like the basic pay ,hra,special allowance,medical allowance,other allowance of an employee on the monthly basis.
    the data that i have on ot os not on the basis of months it contains datd of more than one month.like the baisc pay of an employee is given on a radom day basis of more than one month.
    but i need to bifercatethe data on monthly basis.
    waiting for the reply.
    thanks and regards

    Hi,
    Use the fun module
    RP_FILL_WAGE_TYPE_TABLE_EXT
    which willget PA0008 results.
    but to get the real payroll results you have to import data from clusters by writing the program. Data will be fetch from RT and CRT internal tables based on the Wage Types
    see the sample code:
    report zporgr0100
           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

  • Payroll Reconciliation Report - HR ABAP --- Urgent

    Hi Guys,
    I am having a doubt regarding a standard report very commonly used in HR Reporting in SAP.
    How does it selects the Payroll Results from the cluster ? Based on which date ...?
    Is it Check Date/Payment date or some other date ?
    Actually I have a requirement where i need to fetch the amount for a wagetype.
    In this I need to fetch the values of that wage type based on the check date, i.e. when the company has paid the amount to the person.
    I have to fetch the amount of this wage type for all the payroll runs :
    1 - Regular
    2 - Retro.
    3 - Offcycle.
    I have used the Payroll Reconciliation Report and exporting the final total table which has all the results for the wage type selected on the selection screen for the person between a particular start date and end date.
    But I want to be sure that this way I will get the accurate results.
    If anyone has any idea or know any link to follow please help me out.

    Hi ,
    sample code..
    LOOP AT fp_i_final INTO l_wa_final.
    FORM read_rgdir USING    fp_v_pernr    TYPE persno
                    CHANGING fp_i_rgdir    TYPE ty_t_rgdir.
                            fp_i_errorlog   TYPE ty_t_errorlog.
    *-- Local Declaration
    DATA: l_wa_errorlog TYPE ty_errorlog. " Errorlog Work Area
    *---->  FM for Read routines for cluster CD
      CALL FUNCTION 'CU_READ_RGDIR'
        EXPORTING
          persnr          = fp_v_pernr
        TABLES
          in_rgdir        = fp_i_rgdir
        EXCEPTIONS
          no_record_found = 0
          OTHERS          = 0.
    *---> Cluster Directory details for Payroll
    *---> Results is initial for perticular employee then continue .
        IF l_i_rgdir IS INITIAL.
          CONTINUE.
        ENDIF.
    *----> Off-cycle dates
        IF cb_ocy NE l_c_x.
        ELSE.
    *---> Off-cycle dates
          IF s_bondt-low IS NOT INITIAL AND
             s_bondt-high IS NOT INITIAL .
            DELETE l_i_rgdir WHERE fpbeg LT s_bondt-low  OR
                                   fpend GT s_bondt-high.
          ENDIF.
        ENDIF.
    *----> Check the ARRRES check box
        IF cb_arr = l_c_x.
    *---> Delete the cluster directory details from check date and check the low date.
          IF NOT s_paydt-low IS INITIAL.
            DELETE l_i_rgdir WHERE paydt LT s_paydt-low .
          ENDIF.
    *---> Delete the cluster directory details from check date and check the high and low dates.
          IF NOT s_paydt-low IS INITIAL AND
             NOT s_paydt-high IS INITIAL.
            DELETE l_i_rgdir WHERE paydt LT s_paydt-low OR
                                   paydt GT s_paydt-high .
          ENDIF.
        ENDIF.
    *-- Get the Payroll details for all Personnel Numbers entered
    *-- on Selection Screen
        LOOP AT l_i_rgdir INTO l_wa_rgdir.
    *---> Check for the flag
          IF l_wa_rgdir-srtza NE l_c_p AND
             l_wa_rgdir-srtza NE l_c_o .
    *----> Sub-Routine to get the Payroll results into the
    *----> Payroll RESULTS Table
    *-- Local Declaration
      DATA: l_wa_errorlog TYPE ty_errorlog. " Errorlog Work Area
    *----> FM to get Payroll Results table
      CALL FUNCTION 'PYXX_READ_PAYROLL_RESULT'
        EXPORTING
          employeenumber               = fp_v_pernr
          sequencenumber               = fp_v_seqnr
         read_only_international      = c_x
        CHANGING
          payroll_result               = fp_i_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 <> 0.
        MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
               WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4
               INTO l_wa_errorlog-line.
    *-- Populate Errorlog Int table
        APPEND l_wa_errorlog TO fp_i_errorlog.
        CLEAR  l_wa_errorlog.
      ENDIF.
    *----> Check the check boxs are either ARRRS,Deductions are not taken and Off-cycle.
            IF ( cb_arr = l_c_x AND cb_ded = l_c_x AND cb_ocy = l_c_x ) OR
               ( cb_arr = l_c_x AND cb_ocy = l_c_x ) OR ( cb_ded = l_c_x AND cb_ocy = l_c_x ).
    *----> Check for the Normal Run, Retroactive run and off-cycle run.
    *---> Check the Normal run in pc_payresult
              IF ( l_wa_rgdir-fpper EQ l_wa_rgdir-inper AND
                   l_wa_rgdir-ocrsn IS INITIAL AND  l_wa_rgdir-inocr IS INITIAL ) OR
    *----> Check the Retroactive run pc_payresult
                 ( ( l_wa_rgdir-fpper NE l_wa_rgdir-inper ) AND
                   ( l_wa_rgdir-ocrsn IS INITIAL ) AND ( l_wa_rgdir-inocr IS INITIAL ) ) OR
    *----> Check the Off-cycle run pc_payresult
                 ( ( l_wa_rgdir-fpper NE l_wa_rgdir-inper ) AND
                   ( l_wa_rgdir-ocrsn IS NOT INITIAL  ) OR ( l_wa_rgdir-inocr IS NOT INITIAL ) ).
    *---> Get the Amount for particular Wagetype based on Wagetype
    *---> entered on selection screen
      CLEAR l_wa_lgart.
      LOOP AT fp_p_lgart INTO l_wa_lgart.
       SORT fp_l_i_payresult-inter-rt BY lgart.
        CLEAR l_wa_rt.
    *---> Read the rt cluster results based on the wage type
        LOOP AT fp_l_i_payresult-inter-rt INTO l_wa_rt WHERE lgart = l_wa_lgart-lgart.
          l_wa_final-betrg =  l_wa_rt-betrg.
          l_wa_final-lgart =  l_wa_lgart-lgart.
    *---> Read the fp_i_vendor internal table based on wage type and
    *---> append the lifnr and ernam value to final internal table.
          SORT fp_i_vendor BY lgart.
          CLEAR l_wa_vendor.
          READ TABLE fp_i_vendor INTO l_wa_vendor WITH KEY lgart = l_wa_lgart-lgart BINARY SEARCH.
          IF sy-subrc EQ 0.
           l_wa_final-lifnr = l_wa_vendor-lifnr.
           l_wa_final-crenr = l_wa_vendor-ernam.
         ENDIF.
            l_v_lifnr = l_wa_vendor-lifnr.
            l_v_crenr = l_wa_vendor-ernam.
          ENDIF.
          l_wa_final-lifnr = l_v_lifnr.
          l_wa_final-crenr = l_v_crenr.
          CLEAR : l_v_crenr,l_v_lifnr.
          APPEND  l_wa_final TO i_final1.
    *---> Modify the tax authority to final internal table .
          SORT fp_l_i_payresult-nat-tcrt BY lgart.
          CLEAR l_wa_tcrt.
    *---> Read the tcrt cluster results based on the wage type and
    *---> Get the tax id and tax authority from tcrt cluster.
          READ TABLE fp_l_i_payresult-nat-tcrt INTO l_wa_tcrt
                                    WITH KEY lgart = l_wa_final-lgart BINARY SEARCH.
          IF sy-subrc = 0.
            READ TABLE i_final1 INTO l_wa_final WITH KEY lgart = l_wa_tcrt-lgart."l_wa_final-lgart.
            IF sy-subrc = 0.
              l_wa_final-txcmp =  l_wa_tcrt-txcmp.
              l_wa_final-taxau =  l_wa_tcrt-taxau.
              MODIFY i_final1 FROM l_wa_final INDEX sy-tabix.
            ENDIF.
          ENDIF.
        ENDLOOP.
    *---Crt
       SORT fp_l_i_payresult-inter-crt BY lgart.
        CLEAR l_wa_crt.
    *---> Read the crt cluster results based on the wage type
        LOOP AT fp_l_i_payresult-inter-crt INTO l_wa_crt
                                   WHERE  lgart = l_wa_lgart-lgart.
         l_wa_final-betrg =  l_wa_crt-betrg.
          l_wa_final-lgart =  l_wa_lgart-lgart.
          IF ( l_wa_crt-cumty = l_c_y ) OR ( l_wa_crt-cumty = l_c_k )
          OR ( l_wa_crt-cumty = l_c_d ).
            l_wa_final-ytd =  l_wa_crt-betrg.
          ELSEIF
          ( l_wa_crt-cumty = l_c_f ) OR ( l_wa_crt-cumty = l_c_m ).
            l_wa_final-mtd =  l_wa_crt-betrg.
          ELSEIF
          ( l_wa_crt-cumty = l_c_h ) OR ( l_wa_crt-cumty = l_c_q ).
            l_wa_final-qtd =  l_wa_crt-betrg.
          ENDIF.
          SORT fp_i_vendor BY lgart.
          CLEAR l_wa_vendor.
          READ TABLE fp_i_vendor INTO l_wa_vendor WITH KEY lgart = l_wa_lgart-lgart BINARY SEARCH.
          IF sy-subrc EQ 0.
           l_wa_final-lifnr = l_wa_vendor-lifnr.
           l_wa_final-crenr = l_wa_vendor-ernam.
         ENDIF.
            l_v_lifnr = l_wa_vendor-lifnr.
            l_v_crenr = l_wa_vendor-ernam.
          ENDIF.
          l_wa_final-lifnr = l_v_lifnr.
          l_wa_final-crenr = l_v_crenr.
          CLEAR : l_v_crenr,l_v_lifnr.
          APPEND  l_wa_final TO i_final1 .
    *---> Modify the tax authority to final internal table .
          SORT fp_l_i_payresult-nat-tcrt BY lgart.
          CLEAR l_wa_tcrt.
    *---> Read the tcrt cluster results based on the wage type and
    *---> Get the tax id and tax authority from tcrt cluster.
          READ TABLE fp_l_i_payresult-nat-tcrt INTO l_wa_tcrt
                                    WITH KEY lgart = l_wa_final-lgart BINARY SEARCH.
          IF sy-subrc = 0.
            READ TABLE i_final1 INTO l_wa_final WITH KEY lgart = l_wa_tcrt-lgart."l_wa_final-lgart.
            IF sy-subrc = 0.
              l_wa_final-txcmp =  l_wa_tcrt-txcmp.
              l_wa_final-taxau =  l_wa_tcrt-taxau.
              MODIFY i_final1 FROM l_wa_final INDEX sy-tabix.
            ENDIF.
          ENDIF.
          CLEAR : l_wa_crt.
        ENDLOOP.
    *---DDNTK
       SORT fp_l_i_payresult-inter-ddntk BY lgart.
        CLEAR l_wa_ddntk.
    *---> Read the ddntk cluster results based on the wage type
        LOOP AT fp_l_i_payresult-inter-ddntk INTO l_wa_ddntk
                                   WHERE lgart = l_wa_lgart-lgart .
          l_wa_final-betrg =  l_wa_ddntk-betrg.
          l_wa_final-lgart =  l_wa_lgart-lgart.
    *---> Read the fp_i_vendor internal table based on wage type and
    *---> append the lifnr and ernam value to final internal table.
          SORT fp_i_vendor BY lgart.
          READ TABLE fp_i_vendor INTO l_wa_vendor WITH KEY lgart = l_wa_lgart-lgart BINARY SEARCH.
          IF sy-subrc EQ 0.
           l_wa_final-lifnr = l_wa_vendor-lifnr.
           l_wa_final-crenr = l_wa_vendor-ernam.
         ENDIF.
            l_v_lifnr = l_wa_vendor-lifnr.
            l_v_crenr = l_wa_vendor-ernam.
          ENDIF.
          l_wa_final-lifnr = l_v_lifnr.
          l_wa_final-crenr = l_v_crenr.
          CLEAR : l_v_crenr,l_v_lifnr.
          APPEND  l_wa_final TO i_final1 .
    **---> Modify the tax authority to final internal table .
          SORT fp_l_i_payresult-nat-tcrt BY lgart.
          CLEAR l_wa_tcrt.
    *---> Read the tcrt cluster results based on the wage type and
    *---> Get the tax id and tax authority from tcrt cluster.
          READ TABLE fp_l_i_payresult-nat-tcrt INTO l_wa_tcrt
                                    WITH KEY lgart =  l_wa_final-lgart BINARY SEARCH.
          IF sy-subrc = 0.
            READ TABLE i_final1 INTO l_wa_final WITH KEY lgart = l_wa_tcrt-lgart."l_wa_final-lgart.
            IF sy-subrc = 0.
              l_wa_final-txcmp =  l_wa_tcrt-txcmp.
              l_wa_final-taxau =  l_wa_tcrt-taxau.
              MODIFY i_final1 FROM l_wa_final INDEX sy-tabix.
            ENDIF.
          ENDIF.
        ENDLOOP.
    *---ARRRS
       SORT fp_l_i_payresult-inter-arrrs BY lgart.
        CLEAR l_wa_arrrs.
    *---> Read the arrrs cluster results based on the wage type
        LOOP AT fp_l_i_payresult-inter-arrrs INTO l_wa_arrrs
                                   WHERE lgart = l_wa_lgart-lgart .
          l_wa_final-betrg =  l_wa_arrrs-betrg.
          l_wa_final-lgart =  l_wa_lgart-lgart.
          SORT fp_i_vendor BY lgart.
          CLEAR l_wa_vendor.
          READ TABLE fp_i_vendor INTO l_wa_vendor WITH KEY lgart = l_wa_lgart-lgart BINARY SEARCH.
          IF sy-subrc EQ 0.
           l_wa_final-lifnr = l_wa_vendor-lifnr.
           l_wa_final-crenr = l_wa_vendor-ernam.
         ENDIF.
            l_v_lifnr = l_wa_vendor-lifnr.
            l_v_crenr = l_wa_vendor-ernam.
          ENDIF.
          l_wa_final-lifnr = l_v_lifnr.
          l_wa_final-crenr = l_v_crenr.
          CLEAR : l_v_crenr,l_v_lifnr.
          APPEND  l_wa_final TO i_final1 .
    **---> Modify the tax authority to final internal table .
          SORT fp_l_i_payresult-nat-tcrt BY lgart.
          CLEAR l_wa_tcrt.
    *---> Read the tcrt cluster results based on the wage type and
    *---> Get the tax id and tax authority from tcrt cluster.
          READ TABLE fp_l_i_payresult-nat-tcrt INTO l_wa_tcrt
                                    WITH KEY lgart = l_wa_final-lgart BINARY SEARCH.
          IF sy-subrc = 0.
            READ TABLE i_final1 INTO l_wa_final WITH KEY lgart = l_wa_tcrt-lgart."l_wa_final-lgart.
            IF sy-subrc = 0.
              l_wa_final-txcmp =  l_wa_tcrt-txcmp.
              l_wa_final-taxau =  l_wa_tcrt-taxau.
              MODIFY i_final1 FROM l_wa_final INDEX sy-tabix.
            ENDIF.
          ENDIF.
        ENDLOOP.
      ENDLOOP.
              ENDIF.
      ENDLOOP.
    **---> Cluster Directory details for Payroll Results is initial
    IF l_i_rgdir IS INITIAL.
       MESSAGE i393 .   " no record found for the selection criteria
       LEAVE LIST-PROCESSING .
    ENDIF.
    *---> Final internal table details for Payroll Results is initial
      IF i_final1 IS INITIAL.
        MESSAGE i393 .   " no record found for the selection criteria
        LEAVE LIST-PROCESSING .
      ENDIF.
    If u have any further clarification i will send one sample program..
    Navin..

  • Authorization for generic object services - GOS - payroll data

    Is there anyway to restrict what people see via GOS?  I can't see any authorisations behind it except S_OC_ROLE.  Seem users can view payroll details of a workflow agent in the workflow logs(view with technical details).   Its a wild shot that an end user will find this information in the container tab but it look like a massive security flaw.
    I will be interested to know if others have the same problem and how they resolved it.
    Thanks

    This issue relates to authorisations.  Depending on infotypes available to the user, they will be able to view data relating to the info type.
    I will now have to review all authorisations to ensure there is no unauthorised access.

  • Reading payroll results for an employee from ABAP-HR?

    Hi,
       I dont know whether i must post this question in this category ? but i had a problem in reading of the payroll data for employees.
        I used the function of PYXX_READ_PAYROLL_RESULT and passed the PERNR(employee number), SEQNR, RELID(clusterid) for a given period of say PN-BEGDA AND PN-ENDDA. And i took the payroll structure of germany (its PAYDE_RESULT). program is showing the exceptions since between the selected periods i had many different country employees other than germany DE. how can i solve that problem ? if i use PAY99_RESULT then i cant read the National wage types? how to solve this problem?
        which function i must use so that i must get all the payroll data of the employees between the given period with inter/national payroll details and also which structure(like PAYDE_RESULT) i must use for holding the payroll data that is unique?
       please help me.
       ***Ratings are must for a possible answer.

    Hi KK,
    In this sample code...you will find the use of the method i meantioned.
    REPORT zgratuity_ipcl MESSAGE-ID zh.
    TABLES : pernr , pa0001, pa0008 , pa0000 , t569v.
    TYPE-POOLS: slis.
    CONSTANTS:
    gc_formname_top_of_page TYPE slis_formname VALUE 'TOP_OF_PAGE'.
    INFOTYPES: 0008 ,0001,0002,0000.
    DATA : period(6),
           pay_period(6),
           c_period(6).
    DATA: number LIKE pc261-seqnr.
    DATA : refdt LIKE p0000-begda.
    DATA: ason_yr LIKE p0347-scryy,
          ason_mon LIKE p0347-scrmm.
    DATA : BEGIN OF it_0000 OCCURS 100,
           pernr LIKE pa0000-pernr,
           stat2 LIKE pa0000-stat2,
           massn LIKE pa0000-massn,
           begda LIKE pa0000-begda,
           endda LIKE pa0000-endda,
           END OF it_0000.
    DATA : g_molga LIKE t512t-molga.
    DATA: BEGIN OF package,
            lga LIKE p0008-lga01,
            bet LIKE p0008-bet01,
          END OF package.
    DATA : BEGIN OF rgdir OCCURS 0.
            INCLUDE STRUCTURE pc261.
    DATA : END OF rgdir.
    DATA : BEGIN OF rx-key OCCURS 0.
            INCLUDE STRUCTURE pc200.
    DATA : END OF rx-key.
    DATA : BEGIN OF crt OCCURS 0.         "result table
            INCLUDE STRUCTURE pc208.
    DATA : END OF crt.
    DATA : b_date LIKE sy-datum,
           e_date LIKE sy-datum.
    DATA : darate LIKE t539j-gwcht.
    DATA : gamt TYPE p.
    DATA : BEGIN OF it_0001 OCCURS 100,
           pernr LIKE pa0000-pernr,
           ename LIKE pa0001-ename,
           bukrs LIKE pa0001-bukrs,
           persk LIKE pa0001-persk,
           persg LIKE pa0001-persg,
           werks LIKE pa0001-werks,
           END OF it_0001.
    **start of mod by tejas on 31.05.06
    DATA : BEGIN OF it_final_sup OCCURS 100,
           pernr LIKE pa0001-pernr,  "PL No
           ename LIKE pa0001-ename,  "NAME
           persg LIKE pa0001-persg,  "EMP GROUP
           persk LIKE pa0001-persk,  "ESG
           zzpla LIKE pa0001-zzpla,  "PLANT/BUSINESS
           orgeh LIKE pa0001-orgeh,  "ORG UNIT
           orgtx LIKE t527x-orgtx,   "ORG UNIT TEXT
           gbdat LIKE pa0002-gbdat,  "DOB
           termn LIKE pa0019-termn,  "DOJ
           zzrtdt LIKE pa0002-zzrtdt,"DOR
           sepdt LIKE pa0000-begda,
           no_years TYPE i,          "SERVICE YEARS
           stat2 LIKE pa0000-stat2,  "STATUS
           s_text(15),               "STATUS TEXT
           basic LIKE pa0008-bet01,  "BASIC
           da LIKE pa0008-bet01,     "DA
           total LIKE pa0008-bet01,  "TOTAL
           crt LIKE pc207-betrg,     "GRTUITY
           massn LIKE pa0000-massn,
           begda LIKE pa0000-begda,
           ason(6) ,
          dates LIKE pa0002-zzrtdt,
           END OF it_final_sup.
    DATA : BEGIN OF it_final_nonsup OCCURS 100,
           pernr LIKE pa0001-pernr,  "PL No
           ename LIKE pa0001-ename,  "NAME
           persg LIKE pa0001-persg,  "EMP GROUP
           persk LIKE pa0001-persk,  "ESG
           zzpla LIKE pa0001-zzpla,  "PLANT/BUSINESS
           orgeh LIKE pa0001-orgeh,  "ORG UNIT
           orgtx LIKE t527x-orgtx,   "ORG UNIT TEXT
           gbdat LIKE pa0002-gbdat,  "DOB
           termn LIKE pa0019-termn,  "DOJ
           zzrtdt LIKE pa0002-zzrtdt,"DOR
           sepdt LIKE pa0000-begda,
           no_years TYPE i,          "SERVICE YEARS
           stat2 LIKE pa0000-stat2,  "STATUS
           s_text(15),               "STATUS TEXT
           basic LIKE pa0008-bet01,  "BASIC
           da LIKE pa0008-bet01,     "DA
           total LIKE pa0008-bet01,  "TOTAL
           crt LIKE pc207-betrg,     "GRTUITY
           massn LIKE pa0000-massn,
           begda LIKE pa0000-begda,
           ason(6) ,
          dates LIKE pa0002-zzrtdt,
           END OF it_final_nonsup.
    DATA : BEGIN OF it_final OCCURS 100,
           pernr LIKE pa0001-pernr,  "PL No
           ename LIKE pa0001-ename,  "NAME
           persg LIKE pa0001-persg,  "EMP GROUP
           persk LIKE pa0001-persk,  "ESG
           zzpla LIKE pa0001-zzpla,  "PLANT/BUSINESS
           orgeh LIKE pa0001-orgeh,  "ORG UNIT
           orgtx LIKE t527x-orgtx,   "ORG UNIT TEXT
           gbdat LIKE pa0002-gbdat,  "DOB
           termn LIKE pa0019-termn,  "DOJ
           zzrtdt LIKE pa0002-zzrtdt,"DOR
           sepdt LIKE pa0000-begda,
           no_years TYPE i,          "SERVICE YEARS
           stat2 LIKE pa0000-stat2,  "STATUS
           s_text(15),               "STATUS TEXT
           basic LIKE pa0008-bet01,  "BASIC
           da LIKE pa0008-bet01,     "DA
           total LIKE pa0008-bet01,  "TOTAL
           crt LIKE pc207-betrg,     "GRTUITY
           massn LIKE pa0000-massn,
           begda LIKE pa0000-begda,
           ason(6) ,
          dates LIKE pa0002-zzrtdt,
           END OF it_final.
    **end of mod by tejas on 31.05.06
    DATA : f_pabrj LIKE t549s-pabrj,
           f_pabrp LIKE t549s-pabrp.
    DECLARATIONS FOR ALV DISPLAY
    DATA: gt_fieldcat TYPE slis_t_fieldcat_alv,
          gs_layout   TYPE slis_layout_alv ,
          gs_print    TYPE slis_print_alv,
          gt_filter   TYPE slis_t_filter_alv,
          gt_sp_group TYPE slis_t_sp_group_alv,
          gt_alv_graphics TYPE dtc_t_tc,
          gt_excluding  TYPE slis_t_extab ,
          gt_events   TYPE slis_t_event,
          gt_print TYPE slis_print_alv.
    DATA: gt_list_top_of_page TYPE slis_t_listheader.
    DATA: g_boxnam TYPE slis_fieldname VALUE  'BOX',
          p_f2code LIKE sy-ucomm       VALUE  '&ETA',
          p_lignam TYPE slis_fieldname VALUE  'LIGHTS',
          g_save(1) TYPE c VALUE 'X',
          g_default(1) TYPE c VALUE 'X',
          g_exit(1) TYPE c,
          gx_variant LIKE disvariant,
          g_variant LIKE disvariant,
          g_repid LIKE sy-repid.
    DATA : result TYPE pay99_result.
    DATA : crt_header TYPE LINE OF hrpay99_crt.
    INITIALIZATION.
      SELECTION-SCREEN: BEGIN OF BLOCK b2 WITH FRAME TITLE text-001.
      SELECT-OPTIONS : sstat2 FOR pa0000-stat2.
      SELECTION-SCREEN: END OF BLOCK b2.
    *SELECTION-SCREEN : BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-001.
    *SELECTION-SCREEN : SKIP.
    *PARAMETERS : P_STAT2 LIKE PA0000-STAT2.
    *SELECTION-SCREEN : SKIP.
    *SELECTION-SCREEN : END OF BLOCK B1.
    AT SELECTION-SCREEN OUTPUT.
      LOOP AT SCREEN.
        IF screen-name = 'PNPABKRS-LOW'.
          screen-required = 1.
          MODIFY SCREEN.
        ENDIF.
      ENDLOOP.
    AT SELECTION-SCREEN." on pnppabrj.
      IF pnptimr9 = 'X'.
        CONCATENATE  pnpdispj pnpdispp INTO period.
        CONCATENATE  pnpdispp pnpdispj INTO  pay_period.
      ELSE.
        CONCATENATE  pnppabrj pnppabrp INTO period.
        CONCATENATE  pnppabrp pnppabrj INTO  pay_period.
      ENDIF.
      IF period < '200505'.
        MESSAGE e001 WITH
        'Gratuity report is for period after month Auguest 2005' .
        STOP.
      ENDIF.
      SELECT SINGLE * FROM t569v
      WHERE abkrs = pnpxabkr.
      CONCATENATE t569v-pabrj t569v-pabrp INTO c_period.
      IF period > c_period.
        MESSAGE e001 WITH 'Payroll for this period is not yet processed' .
        STOP.
      ENDIF.
    CONCATENATE  pnppabrj pnppabrp INTO period.
    CONCATENATE  pnppabrp pnppabrj INTO  pay_period.
    IF period =< '200505'.
       MESSAGE e001 WITH 'Program is not valid for this period' pnppabrj
    *pnppabrp.
    ENDIF.
    START-OF-SELECTION.
    GET pernr.
      PERFORM  fill_data.
    END-OF-SELECTION.
      PERFORM final_data.
      PERFORM display_data.
    *&      Form  FILL_DATA
          text
    -->  p1        text
    <--  p2        text
    FORM fill_data.
      SORT p0000 BY pernr.
      SORT p0001 BY pernr.
      SORT p0002 BY pernr.
      SORT p0008 BY pernr.
    start mod made by kinjal for payroll dates
      IF pnptimr9 = 'X'.
        CALL FUNCTION 'HR_GB_PERIOD_DATES'
             EXPORTING
                 abkrs            = pnpxabkr
            PERMO            =
                  pabrj            = pnpdispj
                  pabrp            = pnpdispp
            IMPORTING
                  begda            = b_date
                  endda            = e_date .
       EXCEPTIONS
            PERIOD_NOT_FOUND = 1
            OTHERS           = 2
      ELSE.
        CALL FUNCTION 'HR_GB_PERIOD_DATES'
            EXPORTING
                abkrs            = pnpxabkr
            PERMO            =
                 pabrj            = pnppabrj
                 pabrp            = pnppabrp
           IMPORTING
                 begda            = b_date
                 endda            = e_date
       EXCEPTIONS
            PERIOD_NOT_FOUND = 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.
      ENDIF.
    CONCATENATE  pnppabrj pnppabrp '01' INTO b_date.
    CALL FUNCTION 'HR_JP_MONTH_BEGIN_END_DATE'
          EXPORTING
               iv_date             = b_date
         IMPORTING
            EV_MONTH_BEGIN_DATE =
              ev_month_end_date   = e_date.
    end of modification
    *DATA FETCHING FOR SUPERVISOR EMPLOYEES
      LOOP AT p0001 WHERE begda <= e_date AND
                          endda >= e_date AND
                              persg = 'R' OR
                              persg = 'P'
                            AND
                              ( persk >= '11' AND
                                persk <= '17'
                              OR
                              ( persk >= 'IA' AND
                                persk <= 'IJ'
        MOVE-CORRESPONDING p0001 TO it_final_sup.
        READ TABLE p0002 WITH KEY pernr = p0001-pernr BINARY SEARCH.
        IF sy-subrc = 0.
          MOVE-CORRESPONDING p0002 TO it_final_sup.
        ENDIF.
      LOOP AT p0000 WHERE pernr = p0001-pernr AND begda <= e_date AND endda
                    >= e_date AND stat2 IN sstat2.
          SELECT SINGLE orgtx INTO it_final_sup-orgtx FROM t527x
          WHERE sprsl = 'EN'
          AND   orgeh = p0001-orgeh.
          SELECT SINGLE text1 INTO it_final_sup-s_text FROM t529u
          WHERE sprsl = 'EN'
          AND statn = '2'
          AND   statv = p0000-stat2.
          MOVE-CORRESPONDING p0000 TO it_final_sup.
          IF p0000-massn = 'A6'.
            MOVE p0000-begda TO it_final_sup-zzrtdt.
          ELSE.
            it_final_sup-zzrtdt = '          '.
          ENDIF.
        ENDLOOP.
        IF sy-subrc <> 0.
          CONTINUE.
        ENDIF.
        SELECT SINGLE termn INTO it_final_sup-termn FROM pa0019
        WHERE pernr = p0001-pernr
        AND  tmart = '06'.
        IF sy-subrc = 0.
          CALL FUNCTION 'HR_HK_DIFF_BT_2_DATES'
               EXPORTING
                    date1                   = sy-datum
                    date2                   = it_final_sup-termn
                   output_format           = '05'
              IMPORTING
                   years                   = ason_yr
                   months                  = ason_mon
            DAYS                    =
              EXCEPTIONS
                   invalid_dates_specified = 1
                   OTHERS                  = 2
          IF ason_mon > 6.
            ason_yr = ason_yr + 1.
          ENDIF.
          MOVE ason_yr TO it_final_sup-no_years.
        ENDIF.
        IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
        ENDIF.
        LOOP AT p0008 WHERE begda <= e_date AND endda >= e_date AND pernr =
                            p0001-pernr.
         DO 20 TIMES VARYING  package-lga FROM p0008-lga01 NEXT p0008-lga02
                      VARYING package-bet FROM p0008-bet01 NEXT p0008-bet02.
            CASE package-lga.
              WHEN '0010'.
                it_final_sup-basic = package-bet + it_final_sup-basic.
              WHEN '0I10'.
                it_final_sup-da = package-bet + it_final_sup-da.
            ENDCASE.
          ENDDO.
          it_final_sup-total = it_final_sup-basic + it_final_sup-da.
        ENDLOOP.
       BREAK-POINT.
    start mod made by kinjal
        it_final_sup-zzrtdt = it_final_sup-zzrtdt - 1.
        CALL FUNCTION 'HR_PAYROLL_PERIODS_GET'
             EXPORTING
                  get_begda       = it_final_sup-zzrtdt
            GET_ENDDA       =
                 get_permo        = '67'
             IMPORTING
                 get_pabrj       = f_pabrj
                 get_pabrp       = f_pabrp
       TABLES
            GET_PERIODS     =
            EXCEPTIONS
                 no_period_found = 1
                 no_valid_permo  = 2
                 OTHERS          = 3
        IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
        ENDIF.
        IF it_final_sup-stat2 <> '3'.
         CONCATENATE  it_final-dates+4(2) INTO period.
          CONCATENATE f_pabrj f_pabrp INTO period.
          it_final_sup-ason = period.
        ENDIF.
    end of mod
        rx-key-pernr = p0001-pernr.
        CALL FUNCTION 'CU_READ_RGDIR'
             EXPORTING
                  persnr          = p0001-pernr
             IMPORTING
                  molga           = g_molga
             TABLES
                  in_rgdir        = rgdir
             EXCEPTIONS
                  no_record_found = 1
                  OTHERS          = 2.
        LOOP AT rgdir  WHERE fpper = period AND inper = period.
        ENDLOOP.
      With this Seq. number as a key for cluster Key
    we can read the RT table from the cluster/..
    IF 2
        IF sy-subrc EQ 0.
          rx-key-seqno = rgdir-seqnr.
          IMPORT crt FROM DATABASE pcl2(in) ID rx-key.
          IF NOT crt[] IS INITIAL.
            PERFORM resultstab.
          ENDIF.
          APPEND it_final_sup.
          CLEAR it_final_sup.
        ENDIF.
    LOOP AT rgdir WHERE
             inper = period AND
             srtza = 'A'.
       rx-key-seqno = rgdir-seqnr.
       number = rgdir-seqnr.
       CLEAR rt.
       REFRESH rt.
    Importing Result table cluster
       IMPORT rt FROM DATABASE pcl2(in) ID rx-key.
       IF NOT rt[] IS INITIAL.
         PERFORM resultstab.
       ENDIF.
    ENDLOOP.
       APPEND it_final.
       CLEAR IT_FINAL.
      ENDLOOP.
    RP-PROVIDE-FROM-LAST P0008 SPACE B_DATE E_DATE.
    BREAK-POINT.
       DO 10 TIMES varying  PACKAGE-LGA from p0008-lga01 next p0008-lga02
                   varying package-bet from p0008-bet01 next p0008-bet02.
         compute itab-gross = itab-gross + package-bet.
         IF sy-index = 10.
           itab-pernr = p0008-pernr.
           append itab.
         endif.
       enddo.
    *DATA FETCHING FOR NON SUPERVISOR EMPLOYEES
      LOOP AT p0001 WHERE begda <= e_date AND
                          endda >= e_date AND
                              persg = 'R' OR
                              persg = 'P'
                            AND
                              persk >= 'IL' AND
                              persk <= 'IV'
        MOVE-CORRESPONDING p0001 TO it_final_nonsup.
        READ TABLE p0002 WITH KEY pernr = p0001-pernr BINARY SEARCH.
        IF sy-subrc = 0.
          MOVE-CORRESPONDING p0002 TO it_final_nonsup.
        ENDIF.
      LOOP AT p0000 WHERE pernr = p0001-pernr AND begda <= e_date AND endda
                    >= e_date AND stat2 IN sstat2.
          SELECT SINGLE orgtx INTO it_final_nonsup-orgtx FROM t527x
          WHERE sprsl = 'EN'
          AND   orgeh = p0001-orgeh.
          SELECT SINGLE text1 INTO it_final_nonsup-s_text FROM t529u
          WHERE sprsl = 'EN'
          AND statn = '2'
          AND   statv = p0000-stat2.
          MOVE-CORRESPONDING p0000 TO it_final_nonsup.
          IF p0000-massn = 'A6'.
            MOVE p0000-begda TO it_final_nonsup-sepdt.
            MOVE p0000-begda TO refdt.
          ELSE.
           MOVE it_final_nonsup-zzrtdt TO refdt.
            MOVE e_date TO refdt.
          ENDIF.
        ENDLOOP.
        IF sy-subrc <> 0.
          CONTINUE.
        ENDIF.
        SELECT SINGLE termn INTO it_final_nonsup-termn FROM pa0019
        WHERE pernr = p0001-pernr
        AND  tmart = '06'.
        IF sy-subrc = 0.
          CALL FUNCTION 'HR_HK_DIFF_BT_2_DATES'
               EXPORTING
                    date1                   = refdt
                    date2                   = it_final_nonsup-termn
                   output_format           = '05'
              IMPORTING
                   years                   = ason_yr
                   months                  = ason_mon
            DAYS                    =
              EXCEPTIONS
                   invalid_dates_specified = 1
                   OTHERS                  = 2
          IF ason_mon > 6.
            ason_yr = ason_yr + 1.
          ENDIF.
          MOVE ason_yr TO it_final_nonsup-no_years.
        ENDIF.
        IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
        ENDIF.
        LOOP AT p0008 WHERE begda <= refdt AND endda >= refdt AND
       LOOP AT p0008 WHERE begda <= e_date AND endda >= e_date AND
                            pernr = p0001-pernr.
         DO 20 TIMES VARYING  package-lga FROM p0008-lga01 NEXT p0008-lga02
                      VARYING package-bet FROM p0008-bet01 NEXT p0008-bet02.
            CASE package-lga.
              WHEN '0010'.
                it_final_nonsup-basic = package-bet.
            ENDCASE.
          ENDDO.
        ENDLOOP.
        IF it_final_nonsup-massn = 'A6'.
          SELECT SINGLE gwcht FROM t539j
          INTO darate
          WHERE molga = '40'
          AND bwlga = '0I10'
          AND begda <= it_final_nonsup-begda
          AND endda >= it_final_nonsup-begda.
        ELSE.
          SELECT SINGLE gwcht FROM t539j
          INTO darate
          WHERE molga = '40'
          AND bwlga = '0I10'
          AND begda <= e_date
          AND endda >= e_date.
        ENDIF.
        it_final_nonsup-da = ( it_final_nonsup-basic * darate ) / 100.
        it_final_nonsup-total = it_final_nonsup-basic + it_final_nonsup-da.
        gamt = 0.
        gamt = ( it_final_nonsup-total * 15 * it_final_nonsup-no_years )
                / 26.
        IF gamt >= 350000.
          gamt = 350000.
        ENDIF.
        MOVE gamt TO it_final_nonsup-crt.
        CLEAR gamt.
        CLEAR refdt.
        APPEND it_final_nonsup.
        CLEAR it_final_nonsup.
    LOOP AT rgdir WHERE
             inper = period AND
             srtza = 'A'.
       rx-key-seqno = rgdir-seqnr.
       number = rgdir-seqnr.
       CLEAR rt.
       REFRESH rt.
    Importing Result table cluster
       IMPORT rt FROM DATABASE pcl2(in) ID rx-key.
       IF NOT rt[] IS INITIAL.
         PERFORM resultstab.
       ENDIF.
    ENDLOOP.
       APPEND it_final.
       CLEAR IT_FINAL.
      ENDLOOP.
    ENDFORM.                    " FILL_DATA
    " GET_GRATUITY
    *&      Form  RESULTSTAB
          text
    -->  p1        text
    <--  p2        text
    FORM resultstab.
      LOOP AT crt WHERE lgart = '9GRA' AND cumty = 'U'.
        it_final_sup-crt = abs( crt-betrg ).
      ENDLOOP.
    ENDFORM.                    " RESULTSTAB
    *&      Form  DISPLAY_DATA
          text
    -->  p1        text
    <--  p2        text
    FORM display_data.
      IF it_final[] IS INITIAL.
        MESSAGE i001 WITH 'No data found'.
        STOP.
      ENDIF.
      g_repid = sy-repid.
      PERFORM e01_fieldcat_init  USING gt_fieldcat[].
      PERFORM eventtab_build CHANGING gt_events.
      PERFORM e04_comment_build USING gt_list_top_of_page[].
      PERFORM display_report.
    ENDFORM.                    " DISPLAY_DATA
    *&      Form  E01_FIELDCAT_INIT
          text
         -->P_GT_FIELDCAT[]  text
    FORM e01_fieldcat_init USING   e01_lt_fieldcat TYPE slis_t_fieldcat_alv.
      DATA: ls_fieldcat TYPE slis_fieldcat_alv.
      gs_layout-group_change_edit = 'X'.
      CLEAR ls_fieldcat.
      ls_fieldcat-fieldname    = 'PERNR'.
      ls_fieldcat-tabname    = 'IT_FINAL'.
      ls_fieldcat-seltext_l    = 'Pers No'.
      ls_fieldcat-no_zero = 'X'.
      APPEND ls_fieldcat TO e01_lt_fieldcat.
      CLEAR ls_fieldcat.
      ls_fieldcat-fieldname    = 'ENAME'.
      ls_fieldcat-tabname    = 'IT_FINAL'.
      ls_fieldcat-seltext_l    = 'Name'.
      ls_fieldcat-no_zero = 'X'.
      APPEND ls_fieldcat TO e01_lt_fieldcat.
      CLEAR ls_fieldcat.
      ls_fieldcat-fieldname    = 'PERSK'.
      ls_fieldcat-tabname    = 'IT_FINAL'.
      ls_fieldcat-seltext_l    = 'ESG Cd'.
      ls_fieldcat-no_zero = 'X'.
      APPEND ls_fieldcat TO e01_lt_fieldcat.
      CLEAR ls_fieldcat.
      ls_fieldcat-fieldname    = 'ZZPLA'.
      ls_fieldcat-tabname    = 'IT_FINAL'.
      ls_fieldcat-seltext_l    = 'Plant/Business'.
      ls_fieldcat-no_zero = 'X'.
      APPEND ls_fieldcat TO e01_lt_fieldcat.
      CLEAR ls_fieldcat.
      ls_fieldcat-fieldname    = 'ORGTX'.
      ls_fieldcat-tabname    = 'IT_FINAL'.
      ls_fieldcat-seltext_l    = 'Org.Unit'.
      ls_fieldcat-no_zero = 'X'.
      APPEND ls_fieldcat TO e01_lt_fieldcat.
      CLEAR ls_fieldcat.
      ls_fieldcat-fieldname    = 'GBDAT'.
      ls_fieldcat-tabname    = 'IT_FINAL'.
      ls_fieldcat-seltext_l    = 'Dt.Of Birth'.
      ls_fieldcat-datatype = 'DATS'.
      ls_fieldcat-no_zero = 'X'.
      APPEND ls_fieldcat TO e01_lt_fieldcat.
      CLEAR ls_fieldcat.
      ls_fieldcat-fieldname    = 'TERMN'.
      ls_fieldcat-tabname    = 'IT_FINAL'.
      ls_fieldcat-seltext_l    = 'Dt.Of Joining'.
      ls_fieldcat-datatype = 'DATS'.
      ls_fieldcat-no_zero = 'X'.
      APPEND ls_fieldcat TO e01_lt_fieldcat.
      CLEAR ls_fieldcat.
      ls_fieldcat-fieldname    = 'ZZRTDT'.
      ls_fieldcat-tabname    = 'IT_FINAL'.
      ls_fieldcat-seltext_l    = 'Superannuation Dt'.
      ls_fieldcat-datatype = 'DATS'.
      ls_fieldcat-no_zero = 'X'.
      APPEND ls_fieldcat TO e01_lt_fieldcat.
      CLEAR ls_fieldcat.
      ls_fieldcat-fieldname    = 'SEPDT'.
      ls_fieldcat-tabname    = 'IT_FINAL'.
      ls_fieldcat-seltext_l    = 'Dt.Of Seperation'.
      ls_fieldcat-datatype = 'DATS'.
      ls_fieldcat-no_zero = 'X'.
      APPEND ls_fieldcat TO e01_lt_fieldcat.
      CLEAR ls_fieldcat.
      ls_fieldcat-fieldname    = 'NO_YEARS'.
      ls_fieldcat-tabname    = 'IT_FINAL'.
      ls_fieldcat-seltext_l    = 'Service Years'.
      ls_fieldcat-datatype = 'CHAR'.
      ls_fieldcat-no_zero = 'X'.
      APPEND ls_fieldcat TO e01_lt_fieldcat.
      CLEAR ls_fieldcat.
      ls_fieldcat-fieldname    = 'S_TEXT'.
      ls_fieldcat-tabname    = 'IT_FINAL'.
      ls_fieldcat-seltext_l    = 'Status'.
      ls_fieldcat-datatype = 'CHAR'.
      ls_fieldcat-no_zero = 'X'.
      APPEND ls_fieldcat TO e01_lt_fieldcat.
      CLEAR ls_fieldcat.
      ls_fieldcat-fieldname    = 'BASIC'.
      ls_fieldcat-tabname    = 'IT_FINAL'.
      ls_fieldcat-seltext_l    = 'Basic'.
      ls_fieldcat-datatype = 'CHAR'.
      ls_fieldcat-no_zero = 'X'.
      APPEND ls_fieldcat TO e01_lt_fieldcat.
      CLEAR ls_fieldcat.
      ls_fieldcat-fieldname    = 'DA'.
      ls_fieldcat-tabname    = 'IT_FINAL'.
      ls_fieldcat-seltext_l    = 'DA'.
      ls_fieldcat-datatype = 'CHAR'.
      ls_fieldcat-no_zero = 'X'.
      APPEND ls_fieldcat TO e01_lt_fieldcat.
      CLEAR ls_fieldcat.
      ls_fieldcat-fieldname    = 'TOTAL'.
      ls_fieldcat-tabname    = 'IT_FINAL'.
      ls_fieldcat-seltext_l    = 'Total'.
      ls_fieldcat-datatype = 'CHAR'.
      ls_fieldcat-no_zero = 'X'.
      APPEND ls_fieldcat TO e01_lt_fieldcat.
      CLEAR ls_fieldcat.
      ls_fieldcat-fieldname    = 'CRT'.
      ls_fieldcat-tabname    = 'IT_FINAL'.
      ls_fieldcat-seltext_l    = 'Gratuity'.
      ls_fieldcat-datatype = 'CHAR'.
      ls_fieldcat-no_zero = 'X'.
      APPEND ls_fieldcat TO e01_lt_fieldcat.
    ENDFORM.                    " E01_FIELDCAT_INIT
    *&      Form  EVENTTAB_BUILD
          text
         <--P_GT_EVENTS  text
    FORM eventtab_build CHANGING lt_events TYPE slis_t_event.
      CONSTANTS:
      gc_formname_top_of_page TYPE slis_formname VALUE 'TOP_OF_PAGE'.
      DATA: ls_event TYPE slis_alv_event.
      CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
           EXPORTING
                i_list_type = 0
           IMPORTING
                et_events   = lt_events.
      READ TABLE lt_events WITH KEY name = slis_ev_top_of_page
      INTO ls_event.
      IF sy-subrc = 0.
        MOVE gc_formname_top_of_page TO ls_event-form.
        APPEND ls_event TO lt_events.
      ENDIF.
    ENDFORM.                    " EVENTTAB_BUILD
    *&      Form  E04_COMMENT_BUILD
          text
         -->P_GT_LIST_TOP_OF_PAGE[]  text
    FORM e04_comment_build USING   e04_lt_top_of_page TYPE slis_t_listheader
      DATA: ls_line TYPE slis_listheader.
      DATA : v_text(100) TYPE c,
             v_text1(100) TYPE c,
             date1(10),
             date2(10).
            v_pernrlines TYPE i,
            v_pernrchar(5).
    DESCRIBE TABLE it_pernr LINES v_pernrlines.
    MOVE v_pernrlines TO v_pernrchar.
      CONCATENATE b_date6(2) '.' b_date4(2) '.' b_date+0(4) INTO date1.
      CONCATENATE e_date6(2) '.' e_date4(2) '.' e_date+0(4) INTO date2.
      CONCATENATE 'Gratuity Information for ' date1 'to' date2
      INTO v_text SEPARATED BY space.
      CLEAR ls_line.
      ls_line-typ  = 'H'.
      ls_line-info = v_text.
      APPEND ls_line TO e04_lt_top_of_page.
    CLEAR ls_line.
    ls_line-typ  = 'H'.
    ls_line-info = v_text1.
    APPEND ls_line TO e04_lt_top_of_page.
    ENDFORM.                    " E04_COMMENT_BUILD
    *&      Form  DISPLAY_REPORT
          text
    -->  p1        text
    <--  p2        text
    FORM display_report.
      gs_layout-colwidth_optimize = 'X'.
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
           EXPORTING
               i_background_id         = 'ALV_BACKGROUND'
                i_callback_program      = g_repid
               i_callback_user_command = 'USER_COMMAND'
               i_structure_name        = 'IT_FINAL'
                is_layout               = gs_layout
                it_fieldcat             = gt_fieldcat
               it_special_groups       = gt_sp_group[]
               it_sort                 = gt_sort[]
               it_filter               = gt_filter[]
               i_save                  = g_save
               is_variant              = g_variant
                it_events               = gt_events
               is_print                = gs_print
               it_alv_graphics         = gt_alv_graphics[]
               it_excluding            = gt_excluding
           TABLES
                t_outtab                = it_final.
    ENDFORM.                    " DISPLAY_REPORT
          FORM top_of_page                                              *
    FORM top_of_page.
      CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
           EXPORTING
               i_logo             = 'ENJOYSAP_LOGO'
                it_list_commentary = gt_list_top_of_page.
    ENDFORM   .                    "TOP_OF_PAGE
    FORM user_command USING g_ucomm TYPE sy-ucomm
                            g_field TYPE slis_selfield.
      CASE g_ucomm.
        WHEN '&IC1'.
      ENDCASE.
    ENDFORM.                    "USER_COMMAND
    *&      Form  FINAL_DATA
          text
    -->  p1        text
    <--  p2        text
    FORM final_data.
      LOOP AT it_final_sup.
        MOVE-CORRESPONDING it_final_sup TO it_final.
        APPEND it_final.
        CLEAR it_final.
      ENDLOOP.
      LOOP AT it_final_nonsup.
        MOVE-CORRESPONDING it_final_nonsup TO it_final.
        APPEND it_final.
        CLEAR it_final.
      ENDLOOP.
      SORT it_final BY pernr.
    ENDFORM.                    " FINAL_DATA
    <b>Reward if useful,</b>
    Regards,
    Tejas

  • Table inside table in smartform for pay statement

    Hi friends,
                       Here is one requirement of PAY STATEMENT in which all details(includes personal, Attendance, Payroll details) of all employee's of particular month should print in smart form. Client demanding the format in their previous system which is like this
    1. In the first row, HEADING Part includes
           a. Ist column - Emp id, name, dept, desig, DOJ
           b. 2nd column splits in to  number of leave types and days worked and working days.
           c. 3rd column - Earnings
           d. 4th column - Deductions
    2. From the second row, Data from driver program
          a. Ist column - Corresponding to Ist rows Ist Column
          b. Vice versa....
    First row is static text, which should display in each page.this should be done for all the existing employees(Almost 300+) with all the details discussed in the 2nd point..
    3. Finally they are asking to display, the total earnings and total deductions spent for the salary from the management.
    According to my knowledge, what i understood is : We need to use TABLE for this requirement, because all the details are dynamic and nothing is static except Personal details heading. What i thought is in the Header of table, Keep the First row, and in the Body, keep another table so that all  the dynamic data will be uploads for all employee..and i will be passing all data of each employee in one 1 row of table.And in the footer print final total earnings and deductions using two tables...
    I think my idea i explained is very complex and also not sure. Please suggest me solution in detail regarding this requirement.
    Please give me a response ..
    Thanks in advance..
    Sai Kiran Rao..
    +919781404778

    Hi Daniel,
                      Thanks a lot for your quick response. Sorry as i am providing L3 training to core users,  i was busy with other requirements similar to this. But this is actual requirement...
                                                                         Company name
                                                                        Company Adress
                                                                         Form Title
    empid            |    Calendar Days | Days worked |                  Leaves                                                   | Earnings  | Deductions|  
    empname      |                             | Days Paid      |           EL         CL              SL               CO       LWP|basic        | Tax            |
    doj                 |                           |                         |OB                                                                            |others      |Others         |
    department   |                            |                         |AV                                                                            |               |                    |
    designation   |                           |                         |BAL                                                                           |               |                    |
    emp1             |    31                    |  26                | -
    similar to others----
    value2
    value3
    value4
    value5
    emp2
    similarly for all the existing employees with all the details. And the header details should print in all pages. and finally they want me to display net calculation of all the earnings and deductions components like net of basic etc.
    They need in the exact format of what i have shown above.... I hope you understand the above requirement and please suggest me how to proceed in designing since go live date is near..
    please draw it in your paper with gaps between pipes and each column so that alignment will be done properly which will show you a actual designing.
    Thanks in advance..
    Sai kiran rao.

  • Salary in the current month and  the previous one

    Hi
    I have a table that stores payroll details like the following stracture
    earn code
    period from
    period to
    user_id
    time
    I want to do one report which displays both the salary of one employee in the current month and his salary is the previous one
    Thank you for your help

    you might use the LAG-function to get the previous months salary. Hard to know, as you did not provide any information about your report and database versions.

  • Formatting a 16 column report in single line?

    he project on which I am working demands a report of all the employees but for each employee there should be a single row only. no wrapping of a record.(Though, a single field not fitting the width can wrap as in case of most of the addresses but it should not be like that the address begins on one line and sal on the other) I have 15 fields regarding payroll details. I could not find the page settings for this. Help me out of this.
    Regards,
    Rajeev Puri.
    [email protected]
    null

    Hi Rajeev,
    You can get this effect by specifying horizontal elasticity as fixed and vertical elasticity as varaible for each field. In the layout arrange all the fields in a row by adjusting the size of each field. This way the fields will wrap to the next line if necessary but all the fields will start in the same row.
    Hope this helps,
    Haritha

  • Pay_element_entry_api_delete_elemeny_entry giving error

    HI,
    Iam trying to end date of the several employees but api giving error as
    ORA-20001: HR_xxxx_INVALID_EVENT_TYPE:
    mY CODE IS:
    DECLARE
    ld_effective_start_date DATE;
    ld_effective_end_date DATE;
    lb_delete_warning BOOLEAN;
    ln_object_version_number PAY_ELEMENT_ENTRIES_F.OBJECT_VERSION_NUMBER%TYPE := 1;
    l_payroll_id NUMBER;
    l_claim_master_id NUMBER;
    l_pay_name VARCHAR2(240);
    l_assign_no VARCHAR2(240);
    l_element_name VARCHAR2(240);
    l_err VARCHAR2(1000);
    l_suc NUMBER;
    l_erc NUMBER;
    l_total NUMBER;
    l_srno NUMBER;
    CURSOR ele_name_cur
    IS
    select distinct c.element_name
    from xxc_mod_ex_014_mile_master_tab a,
    per_all_assignments_f b, xxc_mod_ex_014_mile_detail_tab c,
    pay_all_payrolls_f p
    where a.claim_master_id = c.claim_master_id
    ----and upper(c.element_name) IN (SELECT distinct element_name from xxc_mod_ex_014_mile_detail_tab )
    and c.status_flag = 'P'
    and to_char(payroll_eff_date,'MON') = 'SEP'
    and a.assignment_id = b.assignment_id
    and c.payroll_id = p.payroll_id
    and sysdate between b.effective_start_date and b.effective_end_date
    and sysdate between p.effective_start_date and p.effective_end_date
    and c.element_entry_id IN (
    select element_entry_id from PAY_ELEMENT_ENTRIES_F --element_entry_id
    where element_entry_id in (
    select c.element_entry_id
    from xxc_mod_ex_014_mile_master_tab a,
    per_all_assignments_f b, xxc_mod_ex_014_mile_detail_tab c
    where a.claim_master_id = c.claim_master_id
    ----and upper(c.element_name) IN (SELECT distinct element_name from xxc_mod_ex_014_mile_detail_tab )
    and c.status_flag = 'P'
    and to_char(payroll_eff_date,'MON') = 'SEP'
    and a.assignment_id = b.assignment_id
    and sysdate between b.effective_start_date and b.effective_end_date
    and to_char(effective_end_date,'MON') != 'SEP');
    CURSOR ele_link_cur(p_element_name VARCHAR2)
    IS
    SELECT A.element_entry_id, max(peef.object_version_number) object_version_number
    FROM PAY_ELEMENT_ENTRIES_F peef,
    (SELECT element_entry_id
    FROM PAY_ELEMENT_ENTRIES_F
    WHERE element_entry_id IN
    (SELECT c.element_entry_id
    FROM xxc_mod_ex_014_mile_master_tab a,
    per_all_assignments_f b,
    xxc_mod_ex_014_mile_detail_tab c
    WHERE a.claim_master_id = c.claim_master_id
    AND upper(c.element_name) = upper(nvl(p_element_name,c.element_name))
    AND c.status_flag = 'P'
    AND TO_CHAR(payroll_eff_date,'MON') = 'AUG'
    AND a.assignment_id = b.assignment_id
    ---AND c.payroll_id = 67
    AND sysdate BETWEEN b.effective_start_date AND b.effective_end_date
    AND TO_CHAR(effective_end_date,'MON') != 'AUG'
    GROUP BY element_entry_id)A
    WHERE A.element_entry_id = peef.element_entry_id
    GROUP BY A.element_entry_id;
    BEGIN
    l_suc := 0;
    l_erc := 0;
    l_total := 0;
    l_srno := 0;
    FOR ele_link_rec IN ele_link_cur(null)
    LOOP
    l_total := ele_link_cur%ROWCOUNT;
    END LOOP;
    dbms_output.put_line('-----------------------------------------------------------------------------------------');
    dbms_output.put_line('Sr No Assignment No Element Name Payroll Name Element Entry Id');
    dbms_output.put_line('-----------------------------------------------------------------------------------------');
    FOR ele_name_rec IN ele_name_cur
    LOOP
    FOR ele_link_rec IN ele_link_cur(ele_name_rec.element_name)
    LOOP
    l_srno := l_srno + 1;
    ln_object_version_number := ele_link_rec.object_version_number;
    BEGIN
    -- Delete Element Entry
    pay_element_entry_api.delete_element_entry (
    -- Input data elements
    p_validate => TRUE,
    p_datetrack_delete_mode => 'DELETE',
    p_effective_date => '30-SEP-2012',
    p_element_entry_id => ele_link_rec.element_entry_id,
    -- Output data elements
    p_object_version_number => ln_object_version_number,
    p_effective_start_date => ld_effective_start_date,
    p_effective_end_date => ld_effective_end_date,
    p_delete_warning => lb_delete_warning );
    BEGIN
    SELECT DISTINCT payroll_id,
    claim_master_id,
    element_name
    INTO l_payroll_id,
    l_claim_master_id,
    l_element_name
    FROM xxc_mod_ex_014_mile_detail_tab
    WHERE element_entry_id = ele_link_rec.element_entry_id;
    SELECT payroll_name
    INTO l_pay_name
    FROM pay_all_payrolls_f
    WHERE payroll_id = l_payroll_id
    AND TRUNC(sysdate) BETWEEN effective_start_date AND effective_end_date;
    SELECT b.assignment_number
    INTO l_assign_no
    FROM xxc_mod_ex_014_mile_master_tab a,
    per_all_assignments_f b
    WHERE a.assignment_id = b.assignment_id
    AND a.claim_master_id = l_claim_master_id
    AND TRUNC(sysdate) BETWEEN b.effective_start_date AND b.effective_end_date;
    EXCEPTION
    WHEN OTHERS THEN
    dbms_output.put_line('Error to Fetch Payroll Details -');
    END;
    ------dbms_output.put_line(TO_CHAR(l_srno)||' '||l_assign_no||' '||l_element_name||' '||l_pay_name||' '|| ele_link_rec.element_entry_id );
    insert into xxc_element_entry_delete
    values(l_srno,
    l_assign_no,
    l_element_name,
    l_pay_name,
    ele_link_rec.element_entry_id ,
    'S');
    l_suc := l_suc + 1;
    -------COMMIT;
    EXCEPTION
    WHEN OTHERS THEN
    l_err := SQLERRM;
    dbms_output.put_line('Error to Process Element Entry Id -'||ele_link_rec.element_entry_id||l_err);
    l_erc := l_erc + 1;
    BEGIN
    SELECT DISTINCT payroll_id,
    claim_master_id,
    element_name
    INTO l_payroll_id,
    l_claim_master_id,
    l_element_name
    FROM xxc_mod_ex_014_mile_detail_tab
    WHERE element_entry_id = ele_link_rec.element_entry_id;
    SELECT payroll_name
    INTO l_pay_name
    FROM pay_all_payrolls_f
    WHERE payroll_id = l_payroll_id
    AND TRUNC(sysdate) BETWEEN effective_start_date AND effective_end_date;
    SELECT b.assignment_number
    INTO l_assign_no
    FROM xxc_mod_ex_014_mile_master_tab a,
    per_all_assignments_f b
    WHERE a.assignment_id = b.assignment_id
    AND a.claim_master_id = l_claim_master_id
    AND TRUNC(sysdate) BETWEEN b.effective_start_date AND b.effective_end_date;
    EXCEPTION
    WHEN OTHERS THEN
    dbms_output.put_line('Error to Fetch Payroll Details -');
    END;
    dbms_output.put_line('Assignment No - '||l_assign_no||' Element Name '||l_element_name);
    END;
    END LOOP;
    END LOOP;
    dbms_output.put_line('-----------------------------------------------------------------------------------------');
    dbms_output.put_line(' Total Records - '||l_total);
    dbms_output.put_line(' Success Records - '||l_suc);
    dbms_output.put_line(' Error Records - '||l_erc);
    EXCEPTION
    WHEN OTHERS THEN
    ROLLBACK;
    dbms_output.put_line('Error');
    dbms_output.put_line(SQLERRM);
    END;
    ERROS IS SHOWING AS;
    set serveroutput on
    Sr No Assignment No Element Name Payroll Name Element Entry Id
    Error to Process Element Entry Id -2810829ORA-20001: HR_xxxx_INVALID_EVENT_TYPE:
    Assignment No - 492175 Element Name Cornwall Care Casual
    Error to Process Element Entry Id -2810810ORA-20001: HR_xxxx_INVALID_EVENT_TYPE:
    Assignment No - 031732 Element Name Cornwall Care Casual
    Error to Process Element Entry Id -2810883ORA-20001: HR_xxxx_INVALID_EVENT_TYPE:
    Assignment No - 492175 Element Name Cornwall Care Casual
    Error to Process Element Entry Id -2810830ORA-20001: HR_xxxx_INVALID_EVENT_TYPE:
    Assignment No - 031732 Element Name Cornwall Care Casual
    Error to Process Element Entry Id -2897456ORA-20001: HR_xxxx_INVALID_EVENT_TYPE:
    Assignment No - 018793 Element Name C Care Casual FPCS Rates
    Error to Process Element Entry Id -2897455ORA-20001: HR_xxxx_INVALID_EVENT_TYPE:
    Assignment No - 018793 Element Name C Care Casual FPCS Rates
    Error to Process Element Entry Id -2810699ORA-20001: HR_xxxx_INVALID_EVENT_TYPE:
    Assignment No - 680575 Element Name PETROC Scheme 1
    Error to Process Element Entry Id -2810657ORA-20001: HR_xxxx_INVALID_EVENT_TYPE:
    Assignment No - 680155 Element Name PETROC Scheme 1
    Error to Process Element Entry Id -2810680ORA-20001: HR_xxxx_INVALID_EVENT_TYPE:
    Assignment No - 680045 Element Name PETROC Scheme 1
    Error to Process Element Entry Id -2810683ORA-20001: HR_xxxx_INVALID_EVENT_TYPE:
    Assignment No - 681071 Element Name PETROC Scheme 1
    Error to Process Element Entry Id -2810685ORA-20001: HR_xxxx_INVALID_EVENT_TYPE:
    Assignment No - 681763 Element Name PETROC Scheme 1
    Error to Process Element Entry Id -2810705ORA-20001: HR_xxxx_INVALID_EVENT_TYPE:
    Assignment No - 681610 Element Name PETROC Scheme 1
    Error to Process Element Entry Id -2810628ORA-20001: HR_xxxx_INVALID_EVENT_TYPE:
    Assignment No - 681714 Element Name PETROC Scheme 1
    Error to Process Element Entry Id -2810698ORA-20001: HR_xxxx_INVALID_EVENT_TYPE:
    Assignment No - 680024 Element Name PETROC Scheme 1
    Error to Process Element Entry Id -2810702ORA-20001: HR_xxxx_INVALID_EVENT_TYPE:
    Assignment No - 680084 Element Name PETROC Scheme 1
    Error to Process Element Entry Id -2810706ORA-20001: HR_xxxx_INVALID_EVENT_TYPE:
    Assignment No - 681610 Element Name PETROC Scheme 1
    Error to Process Element Entry Id -2810629ORA-20001: HR_xxxx_INVALID_EVENT_TYPE:
    Assignment No - 682877 Element Name PETROC Scheme 1
    Error to Process Element Entry Id -2810704ORA-20001: HR_xxxx_INVALID_EVENT_TYPE:
    Assignment No - 682388 Element Name PETROC Scheme 1
    Error to Process Element Entry Id -2810684ORA-20001: HR_xxxx_INVALID_EVENT_TYPE:
    Assignment No - 681763 Element Name PETROC Scheme 1
    Error to Process Element Entry Id -2810630ORA-20001: HR_xxxx_INVALID_EVENT_TYPE:
    Assignment No - 683005 Element Name PETROC Scheme 1
    Error to Process Element Entry Id -2810700ORA-20001: HR_xxxx_INVALID_EVENT_TYPE:
    Assignment No - 680038 Element Name PETROC Scheme 1
    Error to Process Element Entry Id -2810701ORA-20001: HR_xxxx_INVALID_EVENT_TYPE:
    Assignment No - 682872 Element Name PETROC Scheme 1
    Error to Process Element Entry Id -2810686ORA-20001: HR_xxxx_INVALID_EVENT_TYPE:
    Assignment No - 682290 Element Name PETROC Scheme 1
    Error to Process Element Entry Id -2810703ORA-20001: HR_xxxx_INVALID_EVENT_TYPE:
    Assignment No - 681156 Element Name PETROC Scheme 1
    Total Records - 24
    Success Records - 0
    Error Records - 24
    pLEASE ANYONE PROVIDE SOLUTION:::
    tHANKS,
    RAKESH

    Sharath Gajula wrote:
    Yes I agree with Vinayak. This could be because of the issue with the Custom Process that creates the BEE Entries. Avoiding Zero entries from the custom process should also resolve the issue.Hi there
    You guys are right, I am avoiding when Zero value comes from the other system and not creating Batch Line.
    BUT When I have already a Element Entry with the Employee and I have to End Date that one, how could I End Date that Entry, unless and untill i create a record with the Zero.
    It looks like I am missing some thing, Am I?
    I am using pay_batch_element_entry_api.create_batch_line to create Batch Line, DO I have to use pay_batch_element_entry_api.update_batch_line to End Date the Existing Entry?
    Thanks for Participating this thread.
    Regards.

  • OTL CLA Error

    Hi All ,
    I am trying to setup CLA in OTL . Following are the CLA Preference Values I have set :
    CLA Flow : Self Service Flow : Audit
    CLA Audit Rule : Time Store Audit Requirements : <custom CLA Time enry rule group>
    -Projects and Payroll Timecard Layout
    -Projects and Payroll Change and Late Review Layout
    -Projects and Payroll Change and Late Confirmation Layout
    -Projects and Payroll Details Layout
    -Projects and Payroll Change and Late Audit Entry Layout
    -Projects and Payroll Change and Late Notification Layout
    When I click on the Time Entry menu , the error message I get is :
    "Your Change and Late Audit setup is invalid. Contact your system administrator" . I did look into the Metalink and they say timecard layout shud have audit layouts and as described above , I have set all Audti layouts .
    But if I give NULL value to "CLA Audit Rule" preference , I am able to enter the timecard , reasons and submit properly . Can someone please give me a quick response , if I am missing some setup here .
    Thanks,
    Chandu

    Chandu,
    You have answered the question yourself :)
    "The Preference values for the timecard approver remains the same"
    You need to set the CLA enabled notification layout for the manager.--Shiv                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • Can we show the details of off-cycle payroll in regular monthly payslip?

    Hi!!!
    My client wants to see the details of off-cycle payments with the payments and deductions during the regular payroll in the regular payslip. How can we do this?
    Please suggest a solution.
    regards
    MD

    Hi,
    With SAP Standard, it is not possible.........If still client insists on the same, need to go for enhancement of the payslip writing the logic of retrieving the offcycle results for display.
    Regards
    Team Member.

  • Tax details are not showing in Form 16 ..India payroll

    Hi Experts,
    I have done all configurations with respect to India Payroll.But im unable to see follwing details in form 16.
    A. Value of perquisites under section 17(2) are not showing in form 16.
    B. Less: Allowance to the extent exempt under section 10 ....are not showing  in     Form 16.
    C.Deductions under chapter 6A are not showing in form 16.
    D.Total income .Tax on total income ,surcharge ,Tax payable are also not  showing in form 16.
    Probably i might have missed some important steps while configuring.Please tell and advice me to resolve the problem.Thank you very much.
    Regards,
    Sai.

    Hi,
    Firstly, check in the RT cluster table for the employee if the folowing wagetypes aare fetching values.
    /416, /418, /130, /432.....few more for surcharge etc..but if the given wagetypes are fetching values, then other will also be caputured.
    Also, did u maintain Tax infotypes 586, 585, 582 etc..
    If yes, then problem can be with the confuguration of the wagetypes.
    Please check the above and let us know...
    Regards,
    Pranitha

  • HR Payroll- Hard Furnishing Details

    Hi All,
    I am required to create a report on the hard-furnishing component of the salary. We are using wage type 1450 for that. In BW we are using the cube 0py_02 but here we can find only the cumulative value of hard-furnishing but we need line-items details for that. What are the standard infoproviders and data sources for teh same. Plz guide.
    Regards,
    Saurabh Diwakar

    Hi
    The extractor for payroll results reads data from payroll cluster PCL2, not from standard tables, hence As far I know it does not have any line item pay roll DS, Try with HR Functional consultant to build one INFO TYPE for item wise.
    Hope it helps

  • Can any body please explain the hr payroll process  in detail

    Hi Experts,
                      I am newbie to HR abap.Can any body give their valuable experience regarding payroll proces in hr.
    Thanks and Regards,
    Sravanthi.

    Check this out,
    payroll
    Re: payroll material
    Hope this will help.
    ashish

  • Detailed Log of Deleted Payroll Results.

    I have deleted payroll results for an employee. This result had retro entries. Now I have no clue what was the Earliest MD Change date. Is there any way i can get this date???
    Transaction SLG1 gives me the log but it does not say what all were the retro periods which got deleted...
    Please help...
    Thanks in anticipation......
    Ravi

    Hi Ravi,
    If retroactive accounting runs were linked to the deleted payroll results, all the payroll results that were affected by this retroactive accounting run will be reset to the original status. That means that these payroll results get the status indicator A instead of the status indicator P that they acquired through retroactive accounting.
    So, checking the status indicator might for the retro results may help you in this case.
    Best Regards,
    Venkat.

Maybe you are looking for

  • Status Bar displays "Access is denied"

    Hi, We have EP 7 SP 11 portal where we are displaying Web Dynpro Java Iviews. Whenever a user logs in into the portal, the status bar displays a message" Access is denied" . Though this does not affect the funcitonality of the system but customers ar

  • Problem in converting .txt to .pdf

    import java.io.*; import java.text.DecimalFormat; import java.util.*; public class StudentGrade public static void main (String[] args) throws IOException, FileNotFoundException //Declare Variables double test1, test2, test3, test4, test5; double ave

  • Error executing filter in query using a Collection as a parameter

    Hi, I am getting a null pointer exception when executing my query. When it gets to Kodo it looks like the following: Filter - ((emailView._email._text.ext:stringContains(keyword) || emailView._email._subject.ext:stringContains(keyword)) && (folders.c

  • SCSM "How can you change a Incident to a Change Request?"

    I was wanting to know if there is a Automated script that if a Tech has a Work Item that came in as a Incident but is really a Change Request how they can convert it ot upgrade it to a CR. Right now we are having to Close/Delete the IR and then re-cr

  • IPhoto CRASHES when I try ti import short video shot with my Canon Rebel..HELP!!!

    HELP!    I have a Canon Rebel EOS T3i.  I shoot many wonderful still pixs.  I have also shot some video (movies) during recent cruise which I was able to download and edit properly and include it in my overall Cruise Album.   I have been editing all