SAP HR_PAYROLL_SIMULATION Function Module for Start Payroll in Simulation
HR_PAYROLL_SIMULATION is a standard hr payroll simulation 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 in Simulation 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 simulation FM, simply by entering the name HR_PAYROLL_SIMULATION into the relevant SAP transaction such as SE37 or SE38.
Function Group: HRPR
Program Name: SAPLHRPR
Main Program:
Appliation area: P
Release date: N/A
Mode(Normal, Remote etc): Normal Function Module
Update:

Function HR_PAYROLL_SIMULATION 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_SIMULATION'"Start Payroll in Simulation.
EXPORTING
* PAYROLL_AREA = "Payroll Area
EMPLOYEE_NUMBER = "Personnel Number
* PAYROLL_PERIOD = "Payroll period
* PAYROLL_YEAR = "Payroll year
* PAYROLL_TYPE = "Payroll type
* PAYROLL_ID = "Payroll ID
* PAYROLL_DATE = "Date of Payroll Run
SELECTION_VARIANT = "Report Variant for Payroll
PROGRAM_NAME = "Name of Payroll Program
* OFF_CYCLE = ' ' "Flag: Off-Cycle Payroll yes/no ('X', ' ')
EXCEPTIONS
PROGRAM_NOT_EXIST = 1 VARIANT_NOT_EXIST = 2 MISSING_PARAMETER = 3 WRONG_PARAMETER = 4 WRONG_COUNTRY_GROUP = 5 UNKNOWN_ERROR = 6
IMPORTING Parameters details for HR_PAYROLL_SIMULATION
PAYROLL_AREA - Payroll Area
Data type: T549A-ABKRSOptional: Yes
Call by Reference: No ( called with pass by value option)
EMPLOYEE_NUMBER - Personnel Number
Data type: PERNR-PERNROptional: No
Call by Reference: No ( called with pass by value option)
PAYROLL_PERIOD - Payroll period
Data type: T549Q-PABRPOptional: Yes
Call by Reference: No ( called with pass by value option)
PAYROLL_YEAR - Payroll year
Data type: T549Q-PABRJOptional: Yes
Call by Reference: No ( called with pass by value option)
PAYROLL_TYPE - Payroll type
Data type: PC261-PAYTYOptional: Yes
Call by Reference: No ( called with pass by value option)
PAYROLL_ID - Payroll ID
Data type: PC261-PAYIDOptional: Yes
Call by Reference: No ( called with pass by value option)
PAYROLL_DATE - Date of Payroll Run
Data type: PC261-BONDTOptional: Yes
Call by Reference: No ( called with pass by value option)
SELECTION_VARIANT - Report Variant for Payroll
Data type: VARI-VARIANTOptional: No
Call by Reference: No ( called with pass by value option)
PROGRAM_NAME - Name of Payroll Program
Data type: TRDIR-NAMEOptional: No
Call by Reference: No ( called with pass by value option)
OFF_CYCLE - Flag: Off-Cycle Payroll yes/no ('X', ' ')
Data type: PC261-PAYTYDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
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)
UNKNOWN_ERROR - Unknown error
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
Copy and paste ABAP code example for HR_PAYROLL_SIMULATION 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, " | |||
| lv_program_not_exist | TYPE T549A, " | |||
| lv_employee_number | TYPE PERNR-PERNR, " | |||
| lv_payroll_period | TYPE T549Q-PABRP, " | |||
| lv_variant_not_exist | TYPE T549Q, " | |||
| lv_payroll_year | TYPE T549Q-PABRJ, " | |||
| lv_missing_parameter | TYPE T549Q, " | |||
| lv_payroll_type | TYPE PC261-PAYTY, " | |||
| lv_wrong_parameter | TYPE PC261, " | |||
| lv_payroll_id | TYPE PC261-PAYID, " | |||
| lv_wrong_country_group | TYPE PC261, " | |||
| lv_payroll_date | TYPE PC261-BONDT, " | |||
| lv_unknown_error | TYPE PC261, " | |||
| lv_selection_variant | TYPE VARI-VARIANT, " | |||
| lv_program_name | TYPE TRDIR-NAME, " | |||
| lv_off_cycle | TYPE PC261-PAYTY. " SPACE |
|   CALL FUNCTION 'HR_PAYROLL_SIMULATION' "Start Payroll in Simulation |
| EXPORTING | ||
| PAYROLL_AREA | = lv_payroll_area | |
| EMPLOYEE_NUMBER | = lv_employee_number | |
| PAYROLL_PERIOD | = lv_payroll_period | |
| PAYROLL_YEAR | = lv_payroll_year | |
| PAYROLL_TYPE | = lv_payroll_type | |
| PAYROLL_ID | = lv_payroll_id | |
| PAYROLL_DATE | = lv_payroll_date | |
| SELECTION_VARIANT | = lv_selection_variant | |
| PROGRAM_NAME | = lv_program_name | |
| OFF_CYCLE | = lv_off_cycle | |
| EXCEPTIONS | ||
| PROGRAM_NOT_EXIST = 1 | ||
| VARIANT_NOT_EXIST = 2 | ||
| MISSING_PARAMETER = 3 | ||
| WRONG_PARAMETER = 4 | ||
| WRONG_COUNTRY_GROUP = 5 | ||
| UNKNOWN_ERROR = 6 | ||
| . " HR_PAYROLL_SIMULATION | ||
ABAP code using 7.40 inline data declarations to call FM HR_PAYROLL_SIMULATION
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 PERNR FROM PERNR INTO @DATA(ld_employee_number). | ||||
| "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 VARIANT FROM VARI INTO @DATA(ld_selection_variant). | ||||
| "SELECT single NAME FROM TRDIR INTO @DATA(ld_program_name). | ||||
| "SELECT single PAYTY FROM PC261 INTO @DATA(ld_off_cycle). | ||||
| DATA(ld_off_cycle) | = ' '. | |||
Search for further information about these or an SAP related objects