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

Format in a text file

kiran_k8
Active Contributor
0 Likes
985

Hi Folks,

I am dowloading some data from an Internal table to textfile using gui_download function module.

I am getting the data as

TEST 1234 XYSJH

Is it possible to get the text as

TEST

1234

XYSJH.

Thanks,

K.Kiran.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
949

make changes as shown below and split data into a new internal table, and download the new internal table.....

data:

begin of itab occurs 0,

data(255),

end of itab,

itab2 like table of itab with header line.

itab-data = 'TEST 1234 XYSJH bkgbxkshg hhkdwhd'.

append itab.

loop at itab.

split itab-data at SPACE into table itab2.

endloop.

loop at itab2.

write:/ itab2.

endloop.

Reward points if useful, get back in case of query...

Cheers!!!

make changes as shown below and split data into a new internal table, and download the new internal table.....

data:

begin of itab occurs 0,

data(255),

end of itab,

itab2 like table of itab with header line.

itab-data = 'TEST 1234 XYSJH bkgbxkshg hhkdwhd'.

append itab.

loop at itab.

split itab-data at SPACE into table itab2.

endloop.

loop at itab2.

write:/ itab2.

endloop.

Reward points if useful, get back in case of query...

Cheers!!!

8 REPLIES 8
Read only

Former Member
0 Likes
949

Hi Kiran,

use this

write_field_separator = 'X'

Thanks.

Read only

hymavathi_oruganti
Active Contributor
0 Likes
949

i thik with gui_download its not possible.

Read only

Former Member
0 Likes
949

hi

u r sending the value for a row

material werks meins

test 1234 xysjh

u can send the material if u want like this

material werks meins

test - -

1234 - -

xysjh - -

the output is going to the table so we can do those are correct materials

but those are not materials it will go wrong results..........

Read only

Former Member
0 Likes
949

Hi

there is no way to put like that

you can use the above line of code for only to separate the fields with tab delimited space

reward if usefull

Read only

Former Member
0 Likes
949

Hi,

No you cant make it. because whatever you are downloading the data as such row by row alll your internal table fields will be treated as row.

so its not possible. But after downloaded we can change the data as what ever you required.

Thanks

Yogesh

Read only

Former Member
0 Likes
949

hi,

sap doesnt provide any option for your requirement

if u want like that ... download the data file as the format that is generally downloaded...

then write a z.program to convert data as format as you like ....

reward if useful

regards

sree

Read only

Former Member
0 Likes
950

make changes as shown below and split data into a new internal table, and download the new internal table.....

data:

begin of itab occurs 0,

data(255),

end of itab,

itab2 like table of itab with header line.

itab-data = 'TEST 1234 XYSJH bkgbxkshg hhkdwhd'.

append itab.

loop at itab.

split itab-data at SPACE into table itab2.

endloop.

loop at itab2.

write:/ itab2.

endloop.

Reward points if useful, get back in case of query...

Cheers!!!

Read only

0 Likes
949

Tripat,

Thanks alot.I had followed your logic and tweaked my code a bit and here and there and BINGO I was able to generate a text file in an format as required.

Thanks once again,

K.Kiran.