Registration

Dear SAP Community Member,
In order to fully benefit from what the SAP Community has to offer, please register at:
http://scn.sap.com
Thank you,
The SAP Community team.
Skip to end of metadata
Go to start of metadata
Error rendering macro 'code': Invalid value specified for parameter 'lang'
REPORT  ZABZ_PAYROLLRESULT_USING_CLASSES.
TABLES: PERNR.
NODES: PERSON , PERAS.
CONSTANTS: C_MOLGA TYPE MOLGA VALUE '01'. "Germany (for example)
DATA GT_PERAS_RESULTS TYPE H99_HR_PAY_RESULT_TAB.
DATA GT_PERSON_RESULTS TYPE H99_HR_PAY_RESULT_PERSON_TAB.
DATA GO_TABLE         TYPE REF TO CL_SALV_TABLE.
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>.
      TRY.
          CALL METHOD CL_SALV_TABLE=>FACTORY
            IMPORTING
              R_SALV_TABLE = GO_TABLE
            CHANGING
              T_TABLE      = <GS_PERSON_RESULT>->INTER-RT_PERSON.
          GO_TABLE->DISPLAY( ).
        CATCH CX_SALV_MSG .
      ENDTRY.
    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>.
        TRY.
            CALL METHOD CL_SALV_TABLE=>FACTORY
              IMPORTING
                R_SALV_TABLE = GO_TABLE
              CHANGING
                T_TABLE      = <GS_PERAS_RESULT>->INTER-RT.
            GO_TABLE->DISPLAY( ).
          CATCH CX_SALV_MSG .
        ENDTRY.
      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
  • No labels

2 Comments

  1. Former Member

    This is brilliant - very helpful indeed!

    Thank you

  2. Former Member

    Nice. It's not easy to see how all the SAP delivered methods deliver pay results. Will use this as a template.