SAP HR_PAYROLL Function Module for Start Payroll









HR_PAYROLL is a standard hr payroll SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used for Start Payroll processing and below is the pattern details for this FM, showing its interface including any import and export parameters, exceptions etc. there is also a full "cut and paste" ABAP pattern code example, along with implementation ABAP coding, documentation and contribution comments specific to this or related objects.


See here to view full function module documentation and code listing for hr payroll FM, simply by entering the name HR_PAYROLL into the relevant SAP transaction such as SE37 or SE38.

Function Group: HRPR
Program Name: SAPLHRPR
Main Program: SAPLHRPR
Appliation area: P
Release date: N/A
Mode(Normal, Remote etc): Normal Function Module
Update:



Function HR_PAYROLL pattern details

In-order to call this FM within your sap programs, simply using the below ABAP pattern details to trigger the function call...or see the full ABAP code listing at the end of this article. You can simply cut and paste this code into your ABAP progrom as it is, including variable declarations.
CALL FUNCTION 'HR_PAYROLL'"Start Payroll
EXPORTING
* PAYROLL_AREA = "Payroll Area
* OFF_CYCLE = ' ' "
* LOG_MEM_KEY = "
* COUNTRY_GRP = "
* TST_ON = 'X' "Test Switch
* IMP_BUFF = ' ' "
* OBJ_IPREL = "
* COSTPLANNING = ' ' "
* PRT_PROT = ' ' "
* SEL_ALL_AREAS = ' ' "
* SCHEMA = "
* PAYROLL_PERIOD = "Payroll Period
* RUECK_AB = "
* PAYROLL_YEAR = "Payroll Year
* PAYROLL_TYPE = "Payroll Type
* PAYROLL_ID = "Payroll ID
* PAYROLL_DATE = "Date of Payroll Run
* PAYROLL_OCRSN = "Reason for Off-Cycle Payroll Run
SELECTION_VARIANT = "Report Variant for Payroll
PROGRAM_NAME = "Name of Payroll Program

TABLES
EMPLOYEE_NUMBERS = "Personnel Numbers to be Accounted
* ADVANCE_PERIODS = "
* BUFFER = "PCLx-Buffer
* BUFFER_DIRECTORY = "PCLx Puffer for Directory
* DELETE_PCLX = "Table of Deleted PCLx Records
* PS_OPER = "
* PT_BEFORE_IMAGE = "
* PT_BEFORE_IMAGE_PCLX = "

EXCEPTIONS
PROGRAM_NOT_EXIST = 1 VARIANT_NOT_EXIST = 2 MISSING_PARAMETER = 3 WRONG_PARAMETER = 4 WRONG_COUNTRY_GROUP = 5
.



IMPORTING Parameters details for HR_PAYROLL

PAYROLL_AREA - Payroll Area

Data type: T549A-ABKRS
Optional: Yes
Call by Reference: No ( called with pass by value option)

OFF_CYCLE -

Data type: PC261-PAYTY
Default: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)

LOG_MEM_KEY -

Data type:
Optional: Yes
Call by Reference: No ( called with pass by value option)

COUNTRY_GRP -

Data type: T500L-MOLGA
Optional: Yes
Call by Reference: No ( called with pass by value option)

TST_ON - Test Switch

Data type: RPCALCX0-TST_ON
Default: 'X'
Optional: Yes
Call by Reference: No ( called with pass by value option)

IMP_BUFF -

Data type: RPCALCX0-EXP_BUFF
Default: ' '
Optional: Yes
Call by Reference: No ( called with pass by value option)

OBJ_IPREL -

Data type: CL_HRPAY99_FILL_INFOTYPES
Optional: Yes
Call by Reference: No ( called with pass by value option)

COSTPLANNING -

Data type: RPCALCX0-COSTPLAN
Default: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)

PRT_PROT -

Data type: PRT_PROT
Default: ' '
Optional: Yes
Call by Reference: No ( called with pass by value option)

SEL_ALL_AREAS -

Data type: RP_XFELD
Default: ' '
Optional: Yes
Call by Reference: No ( called with pass by value option)

SCHEMA -

Data type: SCHEM
Optional: Yes
Call by Reference: No ( called with pass by value option)

PAYROLL_PERIOD - Payroll Period

Data type: T549Q-PABRP
Optional: Yes
Call by Reference: No ( called with pass by value option)

RUECK_AB -

Data type: STAG_RP
Optional: Yes
Call by Reference: No ( called with pass by value option)

PAYROLL_YEAR - Payroll Year

Data type: T549Q-PABRJ
Optional: Yes
Call by Reference: No ( called with pass by value option)

PAYROLL_TYPE - Payroll Type

Data type: PC261-PAYTY
Optional: Yes
Call by Reference: No ( called with pass by value option)

PAYROLL_ID - Payroll ID

Data type: PC261-PAYID
Optional: Yes
Call by Reference: No ( called with pass by value option)

PAYROLL_DATE - Date of Payroll Run

Data type: PC261-BONDT
Optional: Yes
Call by Reference: No ( called with pass by value option)

PAYROLL_OCRSN - Reason for Off-Cycle Payroll Run

Data type: PC261-OCRSN
Optional: Yes
Call by Reference: No ( called with pass by value option)

SELECTION_VARIANT - Report Variant for Payroll

Data type: VARI-VARIANT
Optional: No
Call by Reference: No ( called with pass by value option)

PROGRAM_NAME - Name of Payroll Program

Data type: TRDIR-NAME
Optional: No
Call by Reference: No ( called with pass by value option)

TABLES Parameters details for HR_PAYROLL

EMPLOYEE_NUMBERS - Personnel Numbers to be Accounted

Data type: PAY_SIM_PERNR
Optional: No
Call by Reference: No ( called with pass by value option)

ADVANCE_PERIODS -

Data type:
Optional: Yes
Call by Reference: No ( called with pass by value option)

BUFFER - PCLx-Buffer

Data type:
Optional: Yes
Call by Reference: No ( called with pass by value option)

BUFFER_DIRECTORY - PCLx Puffer for Directory

Data type:
Optional: Yes
Call by Reference: No ( called with pass by value option)

DELETE_PCLX - Table of Deleted PCLx Records

Data type:
Optional: Yes
Call by Reference: No ( called with pass by value option)

PS_OPER -

Data type:
Optional: Yes
Call by Reference: No ( called with pass by value option)

PT_BEFORE_IMAGE -

Data type:
Optional: Yes
Call by Reference: Yes

PT_BEFORE_IMAGE_PCLX -

Data type:
Optional: Yes
Call by Reference: Yes

EXCEPTIONS details

PROGRAM_NOT_EXIST - Payroll Program Does Not Exist

Data type:
Optional: No
Call by Reference: No ( called with pass by value option)

VARIANT_NOT_EXIST - Variant does not exist

Data type:
Optional: No
Call by Reference: No ( called with pass by value option)

MISSING_PARAMETER - An Input Parameter was not Specified

Data type:
Optional: No
Call by Reference: No ( called with pass by value option)

WRONG_PARAMETER - There is an Incorrect Parameter Combination

Data type:
Optional: No
Call by Reference: No ( called with pass by value option)

WRONG_COUNTRY_GROUP - The Payroll Country Grouping is Incorrect

Data type:
Optional: No
Call by Reference: No ( called with pass by value option)

Copy and paste ABAP code example for HR_PAYROLL Function Module

The ABAP code below is a full code listing to execute function module POPUP_TO_CONFIRM including all data declarations. The code uses the original data declarations rather than the latest in-line data DECLARATION SYNTAX but I have included an ABAP code snippet at the end to show how declarations would look using the newer method of declaring data variables on the fly. This will allow you to compare and fully understand the new inline method. Please note some of the newer syntax such as the @DATA is not available until a later 4.70 service pack (SP8), which i why i have stuck to the origianl for this example.

DATA:
lv_payroll_area  TYPE T549A-ABKRS, "   
lt_employee_numbers  TYPE STANDARD TABLE OF PAY_SIM_PERNR, "   
lv_program_not_exist  TYPE PAY_SIM_PERNR, "   
lv_off_cycle  TYPE PC261-PAYTY, "   SPACE
lv_log_mem_key  TYPE PC261, "   
lv_country_grp  TYPE T500L-MOLGA, "   
lv_tst_on  TYPE RPCALCX0-TST_ON, "   'X'
lv_imp_buff  TYPE RPCALCX0-EXP_BUFF, "   ' '
lv_obj_iprel  TYPE CL_HRPAY99_FILL_INFOTYPES, "   
lv_costplanning  TYPE RPCALCX0-COSTPLAN, "   SPACE
lv_prt_prot  TYPE PRT_PROT, "   ' '
lv_sel_all_areas  TYPE RP_XFELD, "   ' '
lv_schema  TYPE SCHEM, "   
lv_payroll_period  TYPE T549Q-PABRP, "   
lt_advance_periods  TYPE STANDARD TABLE OF T549Q, "   
lv_variant_not_exist  TYPE T549Q, "   
lv_rueck_ab  TYPE STAG_RP, "   
lt_buffer  TYPE STANDARD TABLE OF STAG_RP, "   
lv_payroll_year  TYPE T549Q-PABRJ, "   
lv_missing_parameter  TYPE T549Q, "   
lv_payroll_type  TYPE PC261-PAYTY, "   
lv_wrong_parameter  TYPE PC261, "   
lt_buffer_directory  TYPE STANDARD TABLE OF PC261, "   
lv_payroll_id  TYPE PC261-PAYID, "   
lt_delete_pclx  TYPE STANDARD TABLE OF PC261, "   
lv_wrong_country_group  TYPE PC261, "   
lt_ps_oper  TYPE STANDARD TABLE OF PC261, "   
lv_payroll_date  TYPE PC261-BONDT, "   
lv_payroll_ocrsn  TYPE PC261-OCRSN, "   
lt_pt_before_image  TYPE STANDARD TABLE OF PC261, "   
lv_selection_variant  TYPE VARI-VARIANT, "   
lt_pt_before_image_pclx  TYPE STANDARD TABLE OF VARI, "   
lv_program_name  TYPE TRDIR-NAME. "   

  CALL FUNCTION 'HR_PAYROLL'  "Start Payroll
    EXPORTING
         PAYROLL_AREA = lv_payroll_area
         OFF_CYCLE = lv_off_cycle
         LOG_MEM_KEY = lv_log_mem_key
         COUNTRY_GRP = lv_country_grp
         TST_ON = lv_tst_on
         IMP_BUFF = lv_imp_buff
         OBJ_IPREL = lv_obj_iprel
         COSTPLANNING = lv_costplanning
         PRT_PROT = lv_prt_prot
         SEL_ALL_AREAS = lv_sel_all_areas
         SCHEMA = lv_schema
         PAYROLL_PERIOD = lv_payroll_period
         RUECK_AB = lv_rueck_ab
         PAYROLL_YEAR = lv_payroll_year
         PAYROLL_TYPE = lv_payroll_type
         PAYROLL_ID = lv_payroll_id
         PAYROLL_DATE = lv_payroll_date
         PAYROLL_OCRSN = lv_payroll_ocrsn
         SELECTION_VARIANT = lv_selection_variant
         PROGRAM_NAME = lv_program_name
    TABLES
         EMPLOYEE_NUMBERS = lt_employee_numbers
         ADVANCE_PERIODS = lt_advance_periods
         BUFFER = lt_buffer
         BUFFER_DIRECTORY = lt_buffer_directory
         DELETE_PCLX = lt_delete_pclx
         PS_OPER = lt_ps_oper
         PT_BEFORE_IMAGE = lt_pt_before_image
         PT_BEFORE_IMAGE_PCLX = lt_pt_before_image_pclx
    EXCEPTIONS
        PROGRAM_NOT_EXIST = 1
        VARIANT_NOT_EXIST = 2
        MISSING_PARAMETER = 3
        WRONG_PARAMETER = 4
        WRONG_COUNTRY_GROUP = 5
. " HR_PAYROLL




ABAP code using 7.40 inline data declarations to call FM HR_PAYROLL

The below ABAP code uses the newer in-line data declarations. This allows you to see the coding differences/benefits of the later inline syntax. Please note some of the newer syntax below, such as the @DATA is not available until 4.70 EHP 8.

"SELECT single ABKRS FROM T549A INTO @DATA(ld_payroll_area).
 
 
 
"SELECT single PAYTY FROM PC261 INTO @DATA(ld_off_cycle).
DATA(ld_off_cycle) = ' '.
 
 
"SELECT single MOLGA FROM T500L INTO @DATA(ld_country_grp).
 
"SELECT single TST_ON FROM RPCALCX0 INTO @DATA(ld_tst_on).
DATA(ld_tst_on) = 'X'.
 
"SELECT single EXP_BUFF FROM RPCALCX0 INTO @DATA(ld_imp_buff).
DATA(ld_imp_buff) = ' '.
 
 
"SELECT single COSTPLAN FROM RPCALCX0 INTO @DATA(ld_costplanning).
DATA(ld_costplanning) = ' '.
 
DATA(ld_prt_prot) = ' '.
 
DATA(ld_sel_all_areas) = ' '.
 
 
"SELECT single PABRP FROM T549Q INTO @DATA(ld_payroll_period).
 
 
 
 
 
"SELECT single PABRJ FROM T549Q INTO @DATA(ld_payroll_year).
 
 
"SELECT single PAYTY FROM PC261 INTO @DATA(ld_payroll_type).
 
 
 
"SELECT single PAYID FROM PC261 INTO @DATA(ld_payroll_id).
 
 
 
 
"SELECT single BONDT FROM PC261 INTO @DATA(ld_payroll_date).
 
"SELECT single OCRSN FROM PC261 INTO @DATA(ld_payroll_ocrsn).
 
 
"SELECT single VARIANT FROM VARI INTO @DATA(ld_selection_variant).
 
 
"SELECT single NAME FROM TRDIR INTO @DATA(ld_program_name).
 


Search for further information about these or an SAP related objects



Comments on this SAP object

What made you want to lookup this SAP object? Please tell us what you were looking for and anything you would like to be included on this page!