TABLES: pernr.
NODES: person , peras.
CONSTANTS: c_molga TYPE molga VALUE '99'.
DATA gt_peras_results TYPE h99_hr_pay_result_tab.
DATA gt_person_results TYPE h99_hr_pay_result_person_tab.
DATA go_prr TYPE REF TO cl_hrpay99_prr_4_pnpce_reps.
DATA go_prr_payper TYPE REF TO cl_hrpay99_prr_4_pnpce_payper.
DATA go_prr_tispan TYPE REF TO cl_hrpay99_prr_4_pnpce_tispan.
DATA go_prr_sngday TYPE REF TO cl_hrpay99_prr_4_pnpce_sngday.
FIELD-SYMBOLS <gs_peras_result> LIKE LINE OF gt_peras_results.
FIELD-SYMBOLS <gs_person_result> LIKE LINE OF gt_person_results.
FIELD-SYMBOLS: <gs_rt> TYPE pc207.
PARAMETERS p_ipview TYPE inperview NO-DISPLAY DEFAULT 'X'.
PARAMETERS p_addret TYPE h99_add_retroes NO-DISPLAY DEFAULT 'X'.
PARAMETERS p_simce TYPE h99_simce NO-DISPLAY.
START-OF-SELECTION.
PERFORM create_prr.
GET person.
GET peras.
CALL METHOD go_prr->get_person_payr_results_allin1
EXPORTING
im_person = person
IMPORTING
* EX_PERAS_NIL_PAYROLL_RESULTS = GT_PERAS_RESULTS
ex_person_payroll_results = gt_person_results
EXCEPTIONS
country_version_not_available = 1
no_authorization = 2
no_person_data = 3
read_error = 4
OTHERS = 5.
IF sy-subrc = 0.
LOOP AT gt_person_results ASSIGNING <gs_person_result>.
ENDLOOP.
ELSE.
CALL METHOD go_prr->get_peras_payr_results_allin1
EXPORTING
im_person = person
im_pernr = peras-pernr
IMPORTING
ex_peras_payroll_results = gt_peras_results
EXCEPTIONS
country_version_not_available = 1
no_authorization = 2
no_peras_data = 3
read_error = 4
OTHERS = 5.
IF sy-subrc = 0.
LOOP AT gt_peras_results ASSIGNING <gs_peras_result>.
ENDLOOP.
ENDIF.
ENDIF.
END-OF-SELECTION.
*&-------------------------------------------------------------------*
*& Form create_prr
*&-------------------------------------------------------------------*
FORM create_prr.
*Create instance of payroll result reader (GO_PRR)
* values of pnptimed come from domain PCCE_PERIOD
CASE pnptimed.
WHEN cl_hrpay99_prr_4_pnpce_reps=>c_today
OR cl_hrpay99_prr_4_pnpce_reps=>c_day.
"Payroll Results for PNPCE Reports with Key Date Selection
CREATE OBJECT go_prr_sngday
EXPORTING
im_date = pn-begda
im_payty_selopt = pnpxpyty[]
im_ipview = p_ipview
im_molga = c_molga
im_add_retroes_to_rgdir = p_addret
im_abkrs_selopt = pnpabkrs[]
im_sim_ce_result = p_simce
EXCEPTIONS
invalid_entries = 1
OTHERS = 2.
go_prr = go_prr_sngday.
WHEN cl_hrpay99_prr_4_pnpce_reps=>c_all
OR cl_hrpay99_prr_4_pnpce_reps=>c_timespan
OR cl_hrpay99_prr_4_pnpce_reps=>c_thismonth
OR cl_hrpay99_prr_4_pnpce_reps=>c_thisyear
OR cl_hrpay99_prr_4_pnpce_reps=>c_untiltoday
OR cl_hrpay99_prr_4_pnpce_reps=>c_fromtoday.
"Pyr Res. Reader for PNPCE Reports with free period selection
CREATE OBJECT go_prr_tispan
EXPORTING
im_begda = pn-begda
im_endda = pn-endda
im_payty_selopt = pnpxpyty[]
im_ipview = p_ipview
im_molga = c_molga
im_add_retroes_to_rgdir = p_addret
im_abkrs_selopt = pnpabkrs[]
im_sim_ce_result = p_simce
EXCEPTIONS
invalid_entries = 1
OTHERS = 2.
go_prr = go_prr_tispan.
WHEN cl_hrpay99_prr_4_pnpce_reps=>c_thispayper
OR cl_hrpay99_prr_4_pnpce_reps=>c_payper.
"Payroll Res. for PNPCE Reports with reg. payroll run or 1 OC
CREATE OBJECT go_prr_payper
EXPORTING
im_pabrp = pn-paper-pabrp
im_pabrj = pn-paper-pabrj
im_permo = pn-permo
im_ipview = p_ipview
im_molga = c_molga
im_add_retroes_to_rgdir = p_addret
im_abkrs_selopt = pnpabkrs[]
im_sim_ce_result = p_simce
EXCEPTIONS
invalid_entries = 1
OTHERS = 2.
go_prr = go_prr_payper.
WHEN cl_hrpay99_prr_4_pnpce_reps=>c_offcycle.
"Payroll Res. for PNPCE Reports with reg. payroll run or 1 OC
CREATE OBJECT go_prr_payper
EXPORTING
im_payty = pnppayty
im_payid = pnppayid
im_bondt = pn-begda
im_ipview = p_ipview
im_molga = c_molga
im_add_retroes_to_rgdir = p_addret
im_abkrs_selopt = pnpabkrs[]
im_sim_ce_result = p_simce
EXCEPTIONS
invalid_entries = 1
OTHERS = 2.
go_prr = go_prr_payper.
WHEN OTHERS.
ENDCASE.
ENDFORM. "create_prr
↧
Payresult using Class!!
↧