Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

HR Payroll ALV Report

Former Member
0 Kudos

Dear experts,

i have one zreport which shows the Payroll of employee, I m getting the out put of Single Employe only how can i get all user list employee payroll, Selection screen is GET PERNR

My Code which i need to pass all employee NUmber is


CALL FUNCTION 'PYXX_GET_EVALUATION_PERIODS'
    EXPORTING
      clusterid                     = 'RX'
      employeenumber                = pernr-pernr      "if user leave the balnk on selection screen this function take all employee
*   BONUS_DATE                    =
     inper_modif                   = pn-permo
     inper                         = dl_inper
*   PAY_TYPE                      =
*   PAY_IDENT                     =
*   READ_ONLY_INTERNATIONAL       =
    TABLES
*   RGDIR                         =
      evaluated_periods             = it_pay_result
 EXCEPTIONS
   no_payroll_results            = 1
   no_entry_found_on_cu          = 2
   import_error                  = 3
   OTHERS                        = 4            .
  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 sy-subrc EQ 0.
  ELSE.

Thanks in Advance.

1 ACCEPTED SOLUTION

former_member226519
Active Contributor
0 Kudos

between GET PERNR and END-OF-SELECTION alle personnel numbers that match the selection creteria are processed.

8 REPLIES 8

former_member226519
Active Contributor
0 Kudos

between GET PERNR and END-OF-SELECTION alle personnel numbers that match the selection creteria are processed.

0 Kudos

Hellow, thanks for your replay but i didnt get youractuall point here is below my slection screen code.


START-OF-SELECTION.
DATA  :  dg_begda  TYPE sy-datum,

           dg_endda  TYPE sy-datum.

  PERFORM  get_data.
* RANGES: ra_pernr FOR pernr-pernr OCCURS 0.



GET PERNR.

*To process final data
  PERFORM process_data.

*  rp_provide_from_last p0000 space dg_begda dg_endda.
*PERFORM  process_data.
call screen 0100.

Its really apricate if you edit the above code.

0 Kudos

you have to specify logical data base PNP in the report properties.

daclare tables: PERNR.

that will create a standard selection screen.


START-OF-SELECTION.
* do all the things PERNR independent
GET PERNR
* provides all PERNRs sequentially
* read the payroll result and save it into an internal table
END-OF-SELECTION.
* display your internal table with all the payroll results.

and read the documentation of report SAPDBPNP.

0 Kudos

Hi,

In Attributes of ur program edit->attributes -> logical database as PNP.

Tables; Pernr. (Once u declare this statement u will get select selection screen ).

START-OF-SELECTION.

GET PERNR.

*To process final data

PERFORM process_data.

  • rp_provide_from_last p0000 space dg_begda dg_endda.

*PERFORM process_data.

call screen 0100.

end-of-selection.

  • Use the Perform to display the internal table data.

Regards,

PraVeen.

0 Kudos

Hellow All,

Thanks for your response but i think i did not clear you my issue, i have slection screen that i populate from GET PERNR.

in that screen i can put only one EMployee number. I need to put all employee number means if user did not enter any employee code should understand to get all employee.

my current out put is if select Employee ID 1001 in selection screen,.


EmpID    EmpName   T.A     F.A  Total earing
1001     xyz       150     20     170 

I need if user did not enter any employee number from selection screen , the output shold come like below


EmpID    EmpName   T.A     F.A  Total earing
1001     xyz       150     20     170 
1003     xyz       150     20     170 
1004     xyz       150     20     170 
.....

1011     xyz       150     20     170 

Thanks.

0 Kudos

Hi,,

No problems.. System will pick all the emloyee details.

First u have to declare in PNP -attributes of ur program..

start-of-selection.

get pernr. (Acts a Loop )

end-selection. (acts as End loop ).

regards,

Praveen.

0 Kudos

Thank praveenreddys , I alreay select the PNP logical database when i create report , the issue is if i did not select any employee it shows only first employee like 1001 but rest of employee does not appear. plz help me out for this.

0 Kudos

Hi,

Check the FM - PYXX_READ_PAYROLL_RESULT.. ( This function module has in between ger Pernr & End of selection )

Append the records to ut internal table..

See the Sample snippet..

get pernr.

wirte this code under Perform (Routine).

CALL FUNCTION 'PYXX_READ_PAYROLL_RESULT'

EXPORTING

clusterid = '40'

employeenumber = wa_final-empno

sequencenumber = wa_261-seqnr

CHANGING

payroll_result = i_payroll

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.

ENDIF.

IF i_payroll IS NOT INITIAL.

LOOP AT i_payroll-inter-rt INTO i_rt_line.

CASE i_rt_line-lgart.

WHEN '5098'.

wa_final-car_remb = wa_final-car_remb + i_rt_line-betrg .

WHEN '5099'.

wa_final-tel_remb = wa_final-tel_remb + i_rt_line-betrg .

WHEN '5440'.

wa_final-med_remb = wa_final-med_remb + i_rt_line-betrg .

WHEN '5660'.

wa_final-lta_remb = wa_final-lta_remb + i_rt_line-betrg .

ENDCASE.

CLEAR i_rt_line.

ENDLOOP.

Append your workarea to internal table,

ENDIF.

end-of-selection.

Regards,

Praveen