Skip to Content

Format in a text file

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.

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

7 Answers

  • Best Answer
    author's profile photo
    Former Member
    Posted on Sep 27, 2007 at 11:34 AM

    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!!!

    Add comment
    10|10000 characters needed characters exceeded

    • 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.

  • author's profile photo
    Former Member
    Posted on Sep 27, 2007 at 09:35 AM

    Hi Kiran,

    use this

    write_field_separator = 'X'

    Thanks.

    Add comment
    10|10000 characters needed characters exceeded

  • author's profile photo
    Former Member
    Posted on Sep 27, 2007 at 09:37 AM

    i thik with gui_download its not possible.

    Add comment
    10|10000 characters needed characters exceeded

  • author's profile photo
    Former Member
    Posted on Sep 27, 2007 at 09:42 AM

    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

    Add comment
    10|10000 characters needed characters exceeded

  • author's profile photo
    Former Member
    Posted on Sep 27, 2007 at 09:47 AM

    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

    Add comment
    10|10000 characters needed characters exceeded

  • author's profile photo
    Former Member
    Posted on Sep 27, 2007 at 09:52 AM

    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

    Add comment
    10|10000 characters needed characters exceeded

  • author's profile photo
    Former Member
    Posted on Sep 27, 2007 at 09:38 AM

    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..........

    Add comment
    10|10000 characters needed characters exceeded