Application Development 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: 

GUI_DOWNLOAD field seperator not appering in downloaded data

Former Member
0 Kudos

Hi Experts,

I am dowladong data on presentation server using GUI_DOWNLOAD fm . the write fieldseperator i have passed is

'|' which is no appearing at end of each record . below is my code

CALL FUNCTION 'GUI_DOWNLOAD'

EXPORTING

filename = 'D:/test.txt'

write_field_separator = '|'

TABLES

data_tab = itab

EXCEPTIONS

OTHERS = 22.

and the output is

000000000000000001 ROH 00000000

000000000000000002 00000000

000000000000000003 00000000

000000000000000004 ROH 00000000

Thamnks in advance

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi,

WRITE_FIELD_SEPARATOR = ' | '

WRITE_FIELD_SEPARATOR in GUI_DOWNLOAD works in SAP R/3 4.7 and later version.

or for example:

report ZFIELD_SEPARATOR.

data: begin of ioutput occurs 0,

rect(1000) type c,

end of ioutput.

data: begin of itab occurs 0,

field1(1) type c,

field2(2) type c,

field3(3) type c,

end of itab.

itab-field1 = 'A'.

itab-field2 = 'B'.

itab-field3 = 'C'.

append itab.

itab-field1 = '1'.

itab-field2 = '2'.

itab-field3 = '3'.

append itab.

itab-field1 = '$'.

itab-field2 = '@'.

itab-field3 = '#'.

append itab.

loop at itab.

concatenate itab-field1

itab-field2

itab-field3

into iout-rect

separated by '|'.

condense ioutput-rect no-gaps.

append ioutput.

endloop.

call function 'GUI_DOWNLOAD'

exporting

filename = 'C:/test.txt'

tables

data_tab = ioutput

5 REPLIES 5

former_member907073
Participant
0 Kudos

Hi,

WRITE_FIELD_SEPARATOR- Separate Columns by Tabs in Case of ASCII Download

Its only appropriate for FILETYPE values ASC, DAT, and IBM. It is set implicitly for DAT.

Values it can take : 'X' or SPACE

Regds,

AS

former_member206439
Contributor
0 Kudos

Please read the documentation of the Field

Separate Columns by Tabs in Case of ASCII Download

Description

In the downloaded file, the columns are separated by tab characters (cl_abap_char_utilities=>horizontal_tab). You should use this setting if you want to upload the data from the file at a later time, because this is the only way of identifying individual columns.

The parameter makes sense only for the FILETYPE values ASC, DAT and IBM; for DAT it is set implicitly.

Value range

'X' : Write separator.

SPACE : Do not write separator.

Default

SPACE

Former Member
0 Kudos

Hi ,

Thanks for your reply . now my requirement is like having field seperator as '| ' at the end of each record .Can you guide me to this

<< Moderator message - Please do not promise points and please read the documentation before posting. >>

thanks in advance.

Edited by: Rob Burbank on Oct 24, 2011 9:56 AM

Former Member
0 Kudos

Hi,

WRITE_FIELD_SEPARATOR = ' | '

WRITE_FIELD_SEPARATOR in GUI_DOWNLOAD works in SAP R/3 4.7 and later version.

or for example:

report ZFIELD_SEPARATOR.

data: begin of ioutput occurs 0,

rect(1000) type c,

end of ioutput.

data: begin of itab occurs 0,

field1(1) type c,

field2(2) type c,

field3(3) type c,

end of itab.

itab-field1 = 'A'.

itab-field2 = 'B'.

itab-field3 = 'C'.

append itab.

itab-field1 = '1'.

itab-field2 = '2'.

itab-field3 = '3'.

append itab.

itab-field1 = '$'.

itab-field2 = '@'.

itab-field3 = '#'.

append itab.

loop at itab.

concatenate itab-field1

itab-field2

itab-field3

into iout-rect

separated by '|'.

condense ioutput-rect no-gaps.

append ioutput.

endloop.

call function 'GUI_DOWNLOAD'

exporting

filename = 'C:/test.txt'

tables

data_tab = ioutput

Former Member
0 Kudos

Hi All ,

thanks for your valuable replies . but in downloaded file if i have material description field length of 40 char , Data in material description is only of 20 characters, my requirement is data should be downloaded to sap standard field length of 40 char(20 char data and 20 char of remaining space ) and | as separator at the end of 40 characters