‎2009 Apr 23 1:57 PM
Hi All,
Is there any function module to create the file?
My requirement is to upload the data into the file running u2018GUI_DOWNLOADu2019 function module, but that file should not be created manually, it should automatically create through the program, any help plsu2026?
Puppy
‎2009 Apr 23 2:01 PM
Hi Puppy,
GUI_DOWNLOAD itself takes care of cratiing file Automatically on Local drive.
For Example in below code file will be created with name l_file1 with contents of table t_tab.
CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
* BIN_FILESIZE =
filename = l_file1
filetype = 'TXT'
* APPEND = ' '
write_field_separator = 'X'
TABLES
data_tab = t_tab
fieldnames = t_headers.
Regards
Shital
‎2009 Apr 23 2:01 PM
Hi Puppy,
GUI_DOWNLOAD itself takes care of cratiing file Automatically on Local drive.
For Example in below code file will be created with name l_file1 with contents of table t_tab.
CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
* BIN_FILESIZE =
filename = l_file1
filetype = 'TXT'
* APPEND = ' '
write_field_separator = 'X'
TABLES
data_tab = t_tab
fieldnames = t_headers.
Regards
Shital
‎2009 Apr 23 2:07 PM
Hi shital,
in file name place i think we have to mention the file path.
Puppy.
‎2009 Apr 23 2:12 PM
It might be Fully Qualified Windows path Like C:\Folder\Filename.txt.
‎2009 Apr 23 2:45 PM
Hi,
Use this.
v_file = 'C:\Documents and Settings\test\Desktop\file.txt'
CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
filename = v_file
filetype = 'ASC'
TABLES
data_tab = it_final
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.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
‎2009 Apr 23 2:40 PM