‎2006 May 21 7:44 PM
CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
BIN_FILESIZE =
FILENAME = filename
FILETYPE = 'ASC'
APPEND = ' '
<b>* WRITE_FIELD_SEPARATOR = ' '</b>* HEADER = '00'
TRUNC_TRAILING_BLANKS = ' '
WRITE_LF = 'X'
COL_SELECT = ' '
COL_SELECT_MASK = ' '
IMPORTING
FILELENGTH =
what is the used of this?
‎2006 May 21 7:54 PM
‎2006 May 21 7:54 PM
‎2006 May 21 8:06 PM
hi rich
so how i can make separator in txt file?
i need to put filetype too?
‎2006 May 21 8:49 PM
Hi
The parameter WRITE_FIELD_SEPARATOR (just as Rich said) insert a TAB like separator (and it means a colunm for excel file), so it depends on which kind separator you need to insert in your text file.
Max
‎2006 May 22 1:33 AM
Max is right, if you want your .txt file to be tab delimited, then this will work for you. If you want a comma delimited file, you must go a different way. You will need a flat internal table.
Data: itab type table of string with header line.Then you need to build the data record and append to the internal table.
field-symbols: <fs>.
Loop at idata.
clear itab.
do.
assign component sy-index of structure itab to <fs>.
if sy-subrc <> 0.
exit.
endif.
if sy-index = 1.
itab = <fs>.
else.
concatenate itab <fs> into itab separated by ','.
endif.
enddo.
append itab.
endloop.Now you can use the GUI_DOWNLOAD function module and download the itab to PC, in this case you would not set the WRITE_FIELD_SEPARATOR parameter.
REgards,
Rich Heilman
‎2006 May 22 5:11 AM
Hi,
The Import parameter WRITE_FIELD_SEPARATOR of function GUI_DOWNLOAD can be used if you want fields to be seperated by tabs in downloaded file. If we pass 'X' to this parameter, the fields will be separated by tabs.
(it won't be any visible charcter like ; : | etc.
Example if u downloaded a table with this parameter as 'X' and then again with this parameter as blank:
This will be the o/p
File generated with WRITE_FIELD_SEPARATOR = ''
1Field1 Row1
2Field2 Row2
3Field3 Row3
File generated with WRITE_FIELD_SEPARATOR = 'X'
1<spaces> Field1 <spaces> Row1
2<spaces> Field2 <spaces> Row2
3<spaces> Field3 <spaces> Row3
You also need to pass parameter DAT_MODE as 'X' and FILETYPE as 'ASC' to download to tab delimited file.
Hope that clears your doubt.
Regards,
Anjali