SAP Reports / Programs

TREX_RFC_FILE_TRANSFER SAP ABAP Report - Upload / download a file from a TREX SERVER to a local workstation







TREX_RFC_FILE_TRANSFER is a standard Executable ABAP Report available within your SAP system (depending on your version and release level). Below is the basic information available for this SAP report including which OBJECTS it interacts with such as TABLES, FUNCTION MODULES, INCLUDES ETC. Also check out the submitted Comments related to this SAP report or see any standard documentation available.

If you would like to execute this report or see the full code listing simply enter TREX_RFC_FILE_TRANSFER into the relevant SAP transactions such as SE38 or SE80


ABAP code to call this SAP report using the submit statement

This report can be called from another progam/report simply by using the ABAP SUBMIT statement, see below for example ABAP code snipts of how to do this.






SUBMIT TREX_RFC_FILE_TRANSFER. "Basic submit
SUBMIT TREX_RFC_FILE_TRANSFER AND RETURN. "Return to original report after report execution complete
SUBMIT TREX_RFC_FILE_TRANSFER VIA SELECTION-SCREEN. "Display selection screen of submitted report to user
    See more syntax options for the ABAP SUBMIT statement


Text pool values


Selection Text: BINMODE = file in binary mode
Selection Text: DEST = source file path / name
Selection Text: DOWNLOD = download from a TREX Server
Selection Text: HOST = hostname
Selection Text: LENGTH = file length (download only)
Selection Text: OFFSET = file offset (download only)
Selection Text: PARTSIZE = download in 100k parts
Selection Text: RFCDEST = RFC destination
Selection Text: SIZEONLY = show file size only
Selection Text: SOURCE = target file path / name
Selection Text: UPLOAD = upload to a TREX server
Title: Upload / download a file from a TREX SERVER to a local workstation
Text Symbol: 001 = Choose method
Text Symbol: 002 = Method parameter


INCLUDES used within this REPORT TREX_RFC_FILE_TRANSFER

No INCLUDES are used within this REPORT code!


TABLES used within REPORT and the associated SELECT statement:





No SAP DATABASE tables are accessed within this REPORT code!


Function Modules used within report and the associated call statement:

TREX_EXT_GET_FILE CALL FUNCTION 'TREX_EXT_GET_FILE' EXPORTING i_rfc_destination = rfcdest i_file_path = dest_file_path i_host = host i_head_offset = offset i_head_length = length i_bin_mode = binmode i_size_only = sizeonly IMPORTING e_return_code = return_code e_return_text = return_text e_lines_bin = xlines e_lines = lines e_file_size = file_size EXCEPTIONS conversion_error = 1 error = 2 OTHERS = 3.

GUI_DOWNLOAD CALL FUNCTION 'GUI_DOWNLOAD' EXPORTING bin_filesize = file_size_i filename = source_s filetype = 'BIN' confirm_overwrite = ' ' IMPORTING filelength = filelength TABLES data_tab = xlines EXCEPTIONS file_write_error = 1 no_batch = 2 gui_refuse_filetransfer = 3 invalid_type = 4 no_authority = 5 unknown_error = 6 header_not_allowed = 7 separator_not_allowed = 8 filesize_not_allowed = 9 header_too_long = 10 dp_error_create = 11 dp_error_send = 12 dp_error_write = 13 unknown_dp_error = 14 access_denied = 15 dp_out_of_memory = 16 disk_full = 17 dp_timeout = 18 file_not_found = 19 dataprovider_exception = 20 control_flush_error = 21 OTHERS = 22.

GUI_DOWNLOAD CALL FUNCTION 'GUI_DOWNLOAD' EXPORTING filename = source_s filetype = 'ASC' confirm_overwrite = ' ' IMPORTING filelength = filelength TABLES data_tab = lines EXCEPTIONS file_write_error = 1 no_batch = 2 gui_refuse_filetransfer = 3 invalid_type = 4 no_authority = 5 unknown_error = 6 header_not_allowed = 7 separator_not_allowed = 8 filesize_not_allowed = 9 header_too_long = 10 dp_error_create = 11 dp_error_send = 12 dp_error_write = 13 unknown_dp_error = 14 access_denied = 15 dp_out_of_memory = 16 disk_full = 17 dp_timeout = 18 file_not_found = 19 dataprovider_exception = 20 control_flush_error = 21 OTHERS = 22.

TREX_EXT_GET_FILE CALL FUNCTION 'TREX_EXT_GET_FILE' EXPORTING i_rfc_destination = rfcdest i_file_path = dest_file_path i_host = host i_head_offset = offset i_head_length = length i_bin_mode = binmode i_size_only = ' ' IMPORTING e_return_code = return_code e_return_text = return_text e_lines_bin = xlines e_lines = lines e_file_size = file_size EXCEPTIONS conversion_error = 1 error = 2 OTHERS = 3.

GUI_DOWNLOAD CALL FUNCTION 'GUI_DOWNLOAD' EXPORTING bin_filesize = cursor_cnt filename = source_s filetype = 'BIN' append = 'X' confirm_overwrite = ' ' IMPORTING filelength = filelength TABLES data_tab = xlines EXCEPTIONS file_write_error = 1 no_batch = 2 gui_refuse_filetransfer = 3 invalid_type = 4 no_authority = 5 unknown_error = 6 header_not_allowed = 7 separator_not_allowed = 8 filesize_not_allowed = 9 header_too_long = 10 dp_error_create = 11 dp_error_send = 12 dp_error_write = 13 unknown_dp_error = 14 access_denied = 15 dp_out_of_memory = 16 disk_full = 17 dp_timeout = 18 file_not_found = 19 dataprovider_exception = 20 control_flush_error = 21 OTHERS = 22.

SAPGUI_PROGRESS_INDICATOR CALL FUNCTION 'SAPGUI_PROGRESS_INDICATOR' EXPORTING * PERCENTAGE = 0 text = progress_str.

GUI_UPLOAD CALL FUNCTION 'GUI_UPLOAD' EXPORTING filename = source_s filetype = 'BIN' IMPORTING filelength = filelength TABLES data_tab = xlines EXCEPTIONS file_open_error = 1 file_read_error = 2 no_batch = 3 gui_refuse_filetransfer = 4 invalid_type = 5 no_authority = 6 unknown_error = 7 bad_data_format = 8 header_not_allowed = 9 separator_not_allowed = 10 header_too_long = 11 unknown_dp_error = 12 access_denied = 13 dp_out_of_memory = 14 disk_full = 15 dp_timeout = 16 OTHERS = 17.

TREX_EXT_WRITE_FILE CALL FUNCTION 'TREX_EXT_WRITE_FILE' EXPORTING i_rfc_destination = rfcdest i_file_path = SOURCE i_host = host i_bin_mode = binmode i_lines = lines i_lines_bin = xlines i_file_size = file_size IMPORTING e_return_code = return_code e_return_text = return_text EXCEPTIONS conversion_error = 1 error = 2 no_authorization = 3 OTHERS = 4.

GUI_UPLOAD CALL FUNCTION 'GUI_UPLOAD' EXPORTING filename = source_s filetype = 'ASC' IMPORTING filelength = filelength TABLES data_tab = lines EXCEPTIONS file_open_error = 1 file_read_error = 2 no_batch = 3 gui_refuse_filetransfer = 4 invalid_type = 5 no_authority = 6 unknown_error = 7 bad_data_format = 8 header_not_allowed = 9 separator_not_allowed = 10 header_too_long = 11 unknown_dp_error = 12 access_denied = 13 dp_out_of_memory = 14 disk_full = 15 dp_timeout = 16 OTHERS = 17.

TREX_EXT_WRITE_FILE CALL FUNCTION 'TREX_EXT_WRITE_FILE' EXPORTING i_rfc_destination = rfcdest i_file_path = SOURCE i_host = host i_bin_mode = space i_lines = lines i_lines_bin = xlines i_file_size = file_size IMPORTING e_return_code = return_code e_return_text = return_text EXCEPTIONS conversion_error = 1 error = 2 no_authorization = 3 OTHERS = 4.

TREX_EXT_GET_FILE CALL FUNCTION 'TREX_EXT_GET_FILE' EXPORTING i_rfc_destination = rfcdest i_file_path = dest_file_path i_host = host i_head_offset = 0 i_head_length = 0 i_bin_mode = binmode i_size_only = ' ' IMPORTING e_return_code = return_code e_return_text = return_text e_lines_bin = xlines e_lines = lines e_file_size = file_size EXCEPTIONS conversion_error = 1 error = 2 OTHERS = 3.



Contribute (Add Comments)

Although this basic information may have limited use it does provide an easy to find location to store any knowledge about this program/report.







The contribute/comments section below therefore offer's an opportunity for anyone to add additional information. This can be anything from useful hints, tips and screen shots to relevant SAP notes or anything else you feel is relevant to this report.

This will then be available for everyone to easily find by simply searching on the report name TREX_RFC_FILE_TRANSFER or its description.