Skip to Content

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 NODISPLAY DEFAULT ‘X’.
PARAMETERS p_addret TYPE h99_add_retroes NODISPLAY DEFAULT ‘X’.
PARAMETERS p_simce TYPE h99_simce NODISPLAY.

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 sysubrc = 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                      = peraspernr
       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 sysubrc = 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                 = pnbegda
           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                = pnbegda
           im_endda                = pnendda
           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                = pnpaperpabrp
           im_pabrj                = pnpaperpabrj
           im_permo                = pnpermo
           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                = pnbegda
           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

To report this post you need to login first.

Be the first to leave a comment

You must be Logged on to comment or reply to a post.

Leave a Reply