SAP HR_99S_DOWNLOAD Function Module for Download a file
HR_99S_DOWNLOAD is a standard hr 99s download SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used for Download a file 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 99s download FM, simply by entering the name HR_99S_DOWNLOAD into the relevant SAP transaction such as SE37 or SE38.
Function Group: HR99S00_TOOLS
Program Name: SAPLHR99S00_TOOLS
Main Program: SAPLHR99S00_TOOLS
Appliation area:
Release date: N/A
Mode(Normal, Remote etc): Normal Function Module
Update:
Function HR_99S_DOWNLOAD 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_99S_DOWNLOAD'"Download a file.
EXPORTING
* P_BIN_FILESIZE = "File length for binary files
* P_ITEM = "Title Of File Open Dialog
* P_CODEPAGE = ' ' "Codepage
* P_INITIAL_DIRECTORY = 'C: TEMP' "
* P_FILENAME = "
* P_FILETYPE = 'ASC' "Character field length = 10
* P_WRITE_LF = "Single-character flag
* P_FSDIALOG = 'X' "Einstelliges Kennzeichen
* P_APPEND = "Append modus
* P_TRUNC_BLANKS_EOL = "Single-character flag
* P_TRUNC_BLANKS = "Single-character flag
IMPORTING
P_FILELENGTH = "
P_FULLPATH = "
TABLES
DATA_TAB = "
EXCEPTIONS
FILE_SAVE_DIALOG = 1 FILE_WRITE_ERROR = 2 NO_BATCH = 3 GUI_REFUSE_FILETRANSFER = 4 INVALID_TYPE = 5 UNKNOWN_ERROR = 6 WRONG_TAB_FORMAT = 7
IMPORTING Parameters details for HR_99S_DOWNLOAD
P_BIN_FILESIZE - File length for binary files
Data type: IOptional: Yes
Call by Reference: Yes
P_ITEM - Title Of File Open Dialog
Data type: STRINGOptional: Yes
Call by Reference: No ( called with pass by value option)
P_CODEPAGE - Codepage
Data type: ABAP_ENCODDefault: SPACE
Optional: Yes
Call by Reference: Yes
P_INITIAL_DIRECTORY -
Data type:Default: 'C: TEMP'
Optional: Yes
Call by Reference: Yes
P_FILENAME -
Data type:Optional: Yes
Call by Reference: Yes
P_FILETYPE - Character field length = 10
Data type: CHAR10Default: 'ASC'
Optional: Yes
Call by Reference: Yes
P_WRITE_LF - Single-character flag
Data type: CHAR1Optional: Yes
Call by Reference: Yes
P_FSDIALOG - Einstelliges Kennzeichen
Data type: CHAR1Default: 'X'
Optional: Yes
Call by Reference: Yes
P_APPEND - Append modus
Data type: CHAR1Optional: Yes
Call by Reference: Yes
P_TRUNC_BLANKS_EOL - Single-character flag
Data type: CHAR1Optional: Yes
Call by Reference: Yes
P_TRUNC_BLANKS - Single-character flag
Data type: CHAR1Optional: Yes
Call by Reference: Yes
EXPORTING Parameters details for HR_99S_DOWNLOAD
P_FILELENGTH -
Data type: IOptional: No
Call by Reference: Yes
P_FULLPATH -
Data type:Optional: No
Call by Reference: Yes
TABLES Parameters details for HR_99S_DOWNLOAD
DATA_TAB -
Data type:Optional: No
Call by Reference: Yes
EXCEPTIONS details
FILE_SAVE_DIALOG - File Save Dialog error
Data type:Optional: No
Call by Reference: Yes
FILE_WRITE_ERROR - Cannot Write to File
Data type:Optional: No
Call by Reference: Yes
NO_BATCH - Front end function cannot be executed in batch
Data type:Optional: No
Call by Reference: Yes
GUI_REFUSE_FILETRANSFER - Incorrect front end, or error in front end
Data type:Optional: No
Call by Reference: Yes
INVALID_TYPE - Invalid value for parameter FILETYPE
Data type:Optional: No
Call by Reference: Yes
UNKNOWN_ERROR - Unknown Error
Data type:Optional: No
Call by Reference: Yes
WRONG_TAB_FORMAT - Wrong format
Data type:Optional: No
Call by Reference: Yes
Copy and paste ABAP code example for HR_99S_DOWNLOAD 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_data_tab | TYPE STANDARD TABLE OF STRING, " | |||
lv_p_filelength | TYPE I, " | |||
lv_p_bin_filesize | TYPE I, " | |||
lv_file_save_dialog | TYPE I, " | |||
lv_p_item | TYPE STRING, " | |||
lv_p_codepage | TYPE ABAP_ENCOD, " SPACE | |||
lv_p_fullpath | TYPE ABAP_ENCOD, " | |||
lv_file_write_error | TYPE ABAP_ENCOD, " | |||
lv_p_initial_directory | TYPE ABAP_ENCOD, " 'C: TEMP' | |||
lv_no_batch | TYPE ABAP_ENCOD, " | |||
lv_p_filename | TYPE ABAP_ENCOD, " | |||
lv_p_filetype | TYPE CHAR10, " 'ASC' | |||
lv_gui_refuse_filetransfer | TYPE CHAR10, " | |||
lv_p_write_lf | TYPE CHAR1, " | |||
lv_invalid_type | TYPE CHAR1, " | |||
lv_p_fsdialog | TYPE CHAR1, " 'X' | |||
lv_unknown_error | TYPE CHAR1, " | |||
lv_p_append | TYPE CHAR1, " | |||
lv_wrong_tab_format | TYPE CHAR1, " | |||
lv_p_trunc_blanks_eol | TYPE CHAR1, " | |||
lv_p_trunc_blanks | TYPE CHAR1. " |
  CALL FUNCTION 'HR_99S_DOWNLOAD' "Download a file |
EXPORTING | ||
P_BIN_FILESIZE | = lv_p_bin_filesize | |
P_ITEM | = lv_p_item | |
P_CODEPAGE | = lv_p_codepage | |
P_INITIAL_DIRECTORY | = lv_p_initial_directory | |
P_FILENAME | = lv_p_filename | |
P_FILETYPE | = lv_p_filetype | |
P_WRITE_LF | = lv_p_write_lf | |
P_FSDIALOG | = lv_p_fsdialog | |
P_APPEND | = lv_p_append | |
P_TRUNC_BLANKS_EOL | = lv_p_trunc_blanks_eol | |
P_TRUNC_BLANKS | = lv_p_trunc_blanks | |
IMPORTING | ||
P_FILELENGTH | = lv_p_filelength | |
P_FULLPATH | = lv_p_fullpath | |
TABLES | ||
DATA_TAB | = lt_data_tab | |
EXCEPTIONS | ||
FILE_SAVE_DIALOG = 1 | ||
FILE_WRITE_ERROR = 2 | ||
NO_BATCH = 3 | ||
GUI_REFUSE_FILETRANSFER = 4 | ||
INVALID_TYPE = 5 | ||
UNKNOWN_ERROR = 6 | ||
WRONG_TAB_FORMAT = 7 | ||
. " HR_99S_DOWNLOAD |
ABAP code using 7.40 inline data declarations to call FM HR_99S_DOWNLOAD
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_p_codepage) | = ' '. | |||
DATA(ld_p_initial_directory) | = 'C: TEMP'. | |||
DATA(ld_p_filetype) | = 'ASC'. | |||
DATA(ld_p_fsdialog) | = 'X'. | |||
Search for further information about these or an SAP related objects