SAP RH_START_EXCEL_WITH_DATA Function Module for Starting Excel with Data Download and Execution of a Macro
RH_START_EXCEL_WITH_DATA is a standard rh start excel with data SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used for Starting Excel with Data Download and Execution of a Macro 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 rh start excel with data FM, simply by entering the name RH_START_EXCEL_WITH_DATA into the relevant SAP transaction such as SE37 or SE38.
Function Group: HRBAS00OFFICE
Program Name: SAPLHRBAS00OFFICE
Main Program: SAPLHRBAS00OFFICE
Appliation area: H
Release date: 13-Nov-2000
Mode(Normal, Remote etc): Normal Function Module
Update:

Function RH_START_EXCEL_WITH_DATA 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 'RH_START_EXCEL_WITH_DATA'"Starting Excel with Data Download and Execution of a Macro.
EXPORTING
* DATA_FILENAME = "Name of Data File on Frontend
* CODEPAGE = "Identifier for Character Format (UTF-8, UCS-2, ...)
* DATA_PATH_FLAG = 'W' "Flag for Directory Extension
* DATA_ENVIRONMENT = "
* DATA_TABLE = "Data Table
* MACRO_FILENAME = "Name of Macro to Be Started
* MACRO_PATH_FLAG = 'E' "Flag for Directory Extension
* MACRO_ENVIRONMENT = "Environment Variable for Path Determination
* WAIT = 'X' "X=Start Excel and Wait
* DELETE_FILE = 'X' "General Flag
EXCEPTIONS
NO_BATCH = 1 EXCEL_NOT_INSTALLED = 2 INTERNAL_ERROR = 3 CANCELLED = 4 DOWNLOAD_ERROR = 5 NO_AUTHORITY = 6 FILE_NOT_DELETED = 7
IMPORTING Parameters details for RH_START_EXCEL_WITH_DATA
DATA_FILENAME - Name of Data File on Frontend
Data type: STRINGOptional: Yes
Call by Reference: Yes
CODEPAGE - Identifier for Character Format (UTF-8, UCS-2, ...)
Data type: ABAP_ENCODOptional: Yes
Call by Reference: No ( called with pass by value option)
DATA_PATH_FLAG - Flag for Directory Extension
Data type: HRPATHFLAGDefault: 'W'
Optional: Yes
Call by Reference: Yes
DATA_ENVIRONMENT -
Data type: HRPATHENVMOptional: Yes
Call by Reference: Yes
DATA_TABLE - Data Table
Data type: TABLEOptional: Yes
Call by Reference: No ( called with pass by value option)
MACRO_FILENAME - Name of Macro to Be Started
Data type: STRINGOptional: Yes
Call by Reference: Yes
MACRO_PATH_FLAG - Flag for Directory Extension
Data type: HRPATHFLAGDefault: 'E'
Optional: Yes
Call by Reference: Yes
MACRO_ENVIRONMENT - Environment Variable for Path Determination
Data type: HRPATHENVMOptional: Yes
Call by Reference: Yes
WAIT - X=Start Excel and Wait
Data type: FLAGDefault: 'X'
Optional: Yes
Call by Reference: Yes
DELETE_FILE - General Flag
Data type: FLAGDefault: 'X'
Optional: Yes
Call by Reference: Yes
EXCEPTIONS details
NO_BATCH - Batch Call Not Permitted
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
EXCEL_NOT_INSTALLED - Excel Is not Installed on the Frontend
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
INTERNAL_ERROR - Internal error
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
CANCELLED - Action was canceled by user
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
DOWNLOAD_ERROR - File could not be created
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
NO_AUTHORITY - No Download Authorization
Data type:Optional: No
Call by Reference: Yes
FILE_NOT_DELETED - File Could Not Be Deleted After Call
Data type:Optional: No
Call by Reference: Yes
Copy and paste ABAP code example for RH_START_EXCEL_WITH_DATA 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_no_batch | TYPE STRING, " | |||
| lv_data_filename | TYPE STRING, " | |||
| lv_codepage | TYPE ABAP_ENCOD, " | |||
| lv_data_path_flag | TYPE HRPATHFLAG, " 'W' | |||
| lv_excel_not_installed | TYPE HRPATHFLAG, " | |||
| lv_internal_error | TYPE HRPATHFLAG, " | |||
| lv_data_environment | TYPE HRPATHENVM, " | |||
| lv_cancelled | TYPE HRPATHENVM, " | |||
| lv_data_table | TYPE TABLE, " | |||
| lv_download_error | TYPE TABLE, " | |||
| lv_macro_filename | TYPE STRING, " | |||
| lv_no_authority | TYPE STRING, " | |||
| lv_macro_path_flag | TYPE HRPATHFLAG, " 'E' | |||
| lv_file_not_deleted | TYPE HRPATHFLAG, " | |||
| lv_macro_environment | TYPE HRPATHENVM, " | |||
| lv_wait | TYPE FLAG, " 'X' | |||
| lv_delete_file | TYPE FLAG. " 'X' |
|   CALL FUNCTION 'RH_START_EXCEL_WITH_DATA' "Starting Excel with Data Download and Execution of a Macro |
| EXPORTING | ||
| DATA_FILENAME | = lv_data_filename | |
| CODEPAGE | = lv_codepage | |
| DATA_PATH_FLAG | = lv_data_path_flag | |
| DATA_ENVIRONMENT | = lv_data_environment | |
| DATA_TABLE | = lv_data_table | |
| MACRO_FILENAME | = lv_macro_filename | |
| MACRO_PATH_FLAG | = lv_macro_path_flag | |
| MACRO_ENVIRONMENT | = lv_macro_environment | |
| WAIT | = lv_wait | |
| DELETE_FILE | = lv_delete_file | |
| EXCEPTIONS | ||
| NO_BATCH = 1 | ||
| EXCEL_NOT_INSTALLED = 2 | ||
| INTERNAL_ERROR = 3 | ||
| CANCELLED = 4 | ||
| DOWNLOAD_ERROR = 5 | ||
| NO_AUTHORITY = 6 | ||
| FILE_NOT_DELETED = 7 | ||
| . " RH_START_EXCEL_WITH_DATA | ||
ABAP code using 7.40 inline data declarations to call FM RH_START_EXCEL_WITH_DATA
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.| DATA(ld_data_path_flag) | = 'W'. | |||
| DATA(ld_macro_path_flag) | = 'E'. | |||
| DATA(ld_wait) | = 'X'. | |||
| DATA(ld_delete_file) | = 'X'. | |||
Search for further information about these or an SAP related objects