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: 

header in text file.

Former Member
0 Kudos

Hi expert,

wn i m downloading a text file into presentation server , hw can i add header there for heading of the particular fieds which is showing in file.plz suggest.

thanx and regards...

sunil.

3 REPLIES 3

Former Member
0 Kudos

Hi Sunil,

When you want to add header details for the records at the time of downloading it to presentation server, Just add the Header Values as the first Row of your internal table and then append other records.

Then use your internal table in 'GUI_DOWNLOAD' FM to download it to presentation server.

Hope this helps your requirement.

Award points if helpful.

Regards,

Ananth

0 Kudos

hello,

you can try doing as mentioned above

however, in some cases, the datatype of the internal table may not allow you to entire the text header string that you need

in such cases you can use this method

what i have done here, is to make a simple internal table with text values to insert the text

i used that table with the FM first

then i called the function module again and passed the data

in the second call, i set the append parameter to 'X'.


types: begin of header_type,
  field1(20),
  field2(20),
  field3(20),
 end of header_type.
data: it_header type header_type occurs 0 with header line.

it_header-field1 = 'field_1'.
it_header-field2 = 'field_2'.
it_header-field3 = 'field_3'.
append it_header.

CALL FUNCTION 'GUI_DOWNLOAD'
  EXPORTING
    filename              = 'c:\test_xls.xls'
    filetype              = 'ASC'
    write_field_separator = 'X'
    DAT_MODE              = 'X'
    TRUNC_TRAILING_BLANKS = 'X'
  TABLES
    data_tab              = it_header.


CALL FUNCTION 'GUI_DOWNLOAD'
  EXPORTING
    filename              = 'c:\test_xls.xls'
    filetype              = 'ASC'
    append                = 'X'
    write_field_separator = 'X'
    DAT_MODE              = 'X'
    TRUNC_TRAILING_BLANKS = 'X'
  TABLES
    data_tab              = itab.

Former Member
0 Kudos

hi

good

declare the header fields as the character types, before moving the internal table data to the final internal table which will display data to the output try to move the header details to the particular internal table.

thanks

mrutyun^