SAP REBUILD_PAYROLL_DIRECTORY Function Module for Build Payroll Directory from the Payroll Results









REBUILD_PAYROLL_DIRECTORY is a standard rebuild payroll directory SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used for Build Payroll Directory from the Payroll Results 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 rebuild payroll directory FM, simply by entering the name REBUILD_PAYROLL_DIRECTORY into the relevant SAP transaction such as SE37 or SE38.

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



Function REBUILD_PAYROLL_DIRECTORY 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 'REBUILD_PAYROLL_DIRECTORY'"Build Payroll Directory from the Payroll Results
EXPORTING
EMPLOYEE_NUMBER = "Personnel Number
COUNTRY_GROUPING = "Country Grouping
PAYROLL_CLUSTER = "Payroll Results Cluster
* SAVE_NEW_DIRECTORY = ' ' "Save New Directory ('X' = Yes, ' ' = No)
* EXPORT_TO_MEMORY = ' ' "Export of New and Old Directory to Memory
* NO_AUTHORITY_CHECK = ' ' "

TABLES
NEW_DIRECTORY = "Newly Built Directory
* OLD_DIRECTORY = "Old Directory

EXCEPTIONS
COUNTRY_GROUPING_INCORRECT = 1 CANT_REORGANIZE_DIRECTORY = 10 DUPLICATE_RECORDS = 11 CANT_UPDATE_NEW_DIRECTORY = 12 EMPLOYEE_NUMBER_INITIAL = 13 NO_AUTHORITY_FOR_DIRECTORY = 14 WRONG_PAYROLL_COUNTRY_GROUP_DI = 15 TABLE_ENTRY_NOT_FOUND = 16 COUNTRY_GROUPING_INITIAL = 2 NO_AUTHORITY_FOR_CLUSTER = 3 ERROR_LOADING_FUNCTION_POOL = 4 ERROR_GENERATING_FUNCTION_POOL = 5 CANT_LOAD_PAYROLL_RESULTS = 6 NO_PAYROLL_RESULTS_EXIST = 7 CANT_READ_PAYROLL_RESULT = 8 WRONG_PAYROLL_COUNTRY_GROUP = 9
.



IMPORTING Parameters details for REBUILD_PAYROLL_DIRECTORY

EMPLOYEE_NUMBER - Personnel Number

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

COUNTRY_GROUPING - Country Grouping

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

PAYROLL_CLUSTER - Payroll Results Cluster

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

SAVE_NEW_DIRECTORY - Save New Directory ('X' = Yes, ' ' = No)

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

EXPORT_TO_MEMORY - Export of New and Old Directory to Memory

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

NO_AUTHORITY_CHECK -

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

TABLES Parameters details for REBUILD_PAYROLL_DIRECTORY

NEW_DIRECTORY - Newly Built Directory

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

OLD_DIRECTORY - Old Directory

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

EXCEPTIONS details

COUNTRY_GROUPING_INCORRECT - The Table Grouping is not in Table T500L

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

CANT_REORGANIZE_DIRECTORY - Status Indicator Could Not be Built

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

DUPLICATE_RECORDS - Several Records Exist with Same Information

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

CANT_UPDATE_NEW_DIRECTORY - Error when Updating the New Directory

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

EMPLOYEE_NUMBER_INITIAL - Personnel Number Not Specified

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

NO_AUTHORITY_FOR_DIRECTORY -

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

WRONG_PAYROLL_COUNTRY_GROUP_DI -

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

TABLE_ENTRY_NOT_FOUND -

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

COUNTRY_GROUPING_INITIAL - Country Grouping Not Specified

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

NO_AUTHORITY_FOR_CLUSTER - User Has No Update Authorization for Cluster

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

ERROR_LOADING_FUNCTION_POOL - System Error: Form Pool is not Available

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

ERROR_GENERATING_FUNCTION_POOL - System Error: Form Pool Cannot Be Generated

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

CANT_LOAD_PAYROLL_RESULTS - Payroll Results Cannot be Loaded

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

NO_PAYROLL_RESULTS_EXIST - No Payroll Results Exist

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

CANT_READ_PAYROLL_RESULT - A Payroll Result Cannot be Read

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

WRONG_PAYROLL_COUNTRY_GROUP - Country Grouping Not Compatible with VERSC-MOLGA

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

Copy and paste ABAP code example for REBUILD_PAYROLL_DIRECTORY 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:
lt_new_directory  TYPE STANDARD TABLE OF PC261, "   
lv_employee_number  TYPE PERNR-PERNR, "   
lv_country_grouping_incorrect  TYPE PERNR, "   
lv_cant_reorganize_directory  TYPE PERNR, "   
lv_duplicate_records  TYPE PERNR, "   
lv_cant_update_new_directory  TYPE PERNR, "   
lv_employee_number_initial  TYPE PERNR, "   
lv_no_authority_for_directory  TYPE PERNR, "   
lv_wrong_payroll_country_group_di  TYPE PERNR, "   
lv_table_entry_not_found  TYPE PERNR, "   
lt_old_directory  TYPE STANDARD TABLE OF PC261, "   
lv_country_grouping  TYPE T500L-MOLGA, "   
lv_country_grouping_initial  TYPE T500L, "   
lv_payroll_cluster  TYPE PCL2-RELID, "   
lv_no_authority_for_cluster  TYPE PCL2, "   
lv_save_new_directory  TYPE PC261-VOID, "   SPACE
lv_error_loading_function_pool  TYPE PC261, "   
lv_export_to_memory  TYPE PC261-VOID, "   SPACE
lv_error_generating_function_pool  TYPE PC261, "   
lv_no_authority_check  TYPE PC261, "   SPACE
lv_cant_load_payroll_results  TYPE PC261, "   
lv_no_payroll_results_exist  TYPE PC261, "   
lv_cant_read_payroll_result  TYPE PC261, "   
lv_wrong_payroll_country_group  TYPE PC261. "   

  CALL FUNCTION 'REBUILD_PAYROLL_DIRECTORY'  "Build Payroll Directory from the Payroll Results
    EXPORTING
         EMPLOYEE_NUMBER = lv_employee_number
         COUNTRY_GROUPING = lv_country_grouping
         PAYROLL_CLUSTER = lv_payroll_cluster
         SAVE_NEW_DIRECTORY = lv_save_new_directory
         EXPORT_TO_MEMORY = lv_export_to_memory
         NO_AUTHORITY_CHECK = lv_no_authority_check
    TABLES
         NEW_DIRECTORY = lt_new_directory
         OLD_DIRECTORY = lt_old_directory
    EXCEPTIONS
        COUNTRY_GROUPING_INCORRECT = 1
        CANT_REORGANIZE_DIRECTORY = 10
        DUPLICATE_RECORDS = 11
        CANT_UPDATE_NEW_DIRECTORY = 12
        EMPLOYEE_NUMBER_INITIAL = 13
        NO_AUTHORITY_FOR_DIRECTORY = 14
        WRONG_PAYROLL_COUNTRY_GROUP_DI = 15
        TABLE_ENTRY_NOT_FOUND = 16
        COUNTRY_GROUPING_INITIAL = 2
        NO_AUTHORITY_FOR_CLUSTER = 3
        ERROR_LOADING_FUNCTION_POOL = 4
        ERROR_GENERATING_FUNCTION_POOL = 5
        CANT_LOAD_PAYROLL_RESULTS = 6
        NO_PAYROLL_RESULTS_EXIST = 7
        CANT_READ_PAYROLL_RESULT = 8
        WRONG_PAYROLL_COUNTRY_GROUP = 9
. " REBUILD_PAYROLL_DIRECTORY




ABAP code using 7.40 inline data declarations to call FM REBUILD_PAYROLL_DIRECTORY

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 PERNR FROM PERNR INTO @DATA(ld_employee_number).
 
 
 
 
 
 
 
 
 
 
"SELECT single MOLGA FROM T500L INTO @DATA(ld_country_grouping).
 
 
"SELECT single RELID FROM PCL2 INTO @DATA(ld_payroll_cluster).
 
 
"SELECT single VOID FROM PC261 INTO @DATA(ld_save_new_directory).
DATA(ld_save_new_directory) = ' '.
 
 
"SELECT single VOID FROM PC261 INTO @DATA(ld_export_to_memory).
DATA(ld_export_to_memory) = ' '.
 
 
DATA(ld_no_authority_check) = ' '.
 
 
 
 
 


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!