Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

separator

Former Member
0 Likes
898

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?

1 ACCEPTED SOLUTION
Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
849

The WRITE_FIELD_SEPARATOR is used when you are writing a column separated file, this works good when you are creating an excel file. It will put the columns of the ITAB into columns in the excel sheet. In order to trigger this, you must set it to "X"

WRITE_FIELD_SEPARATOR = 'X'

Regards,

Rich Heilman

5 REPLIES 5
Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
850

The WRITE_FIELD_SEPARATOR is used when you are writing a column separated file, this works good when you are creating an excel file. It will put the columns of the ITAB into columns in the excel sheet. In order to trigger this, you must set it to "X"

WRITE_FIELD_SEPARATOR = 'X'

Regards,

Rich Heilman

Read only

0 Likes
849

hi rich

so how i can make separator in txt file?

i need to put filetype too?

Read only

0 Likes
849

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

Read only

0 Likes
849

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

Read only

Former Member
0 Likes
849

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