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: 

how to post a header using GUI_DOWNLOAD

Former Member
0 Kudos

hello:

i would like to ask one favor, i trying to download a fiel to a PC i am using the GUI_DOWNLOAD function when i sent the it_table to the function this works well , but now i need to sent the name of the colums for each colums, i sending a tables with the names of that colums but the function is sending an error.

CALL FUNCTION 'GUI_DOWNLOAD'

EXPORTING

filename = nombre

filetype = 'ASC'

confirm_overwrite = 'X'

TABLES

data_tab = t_itab2

fieldnames = t_fieldnames. HERE SEND THE ERROR MSG.

note: this file is gonna be download from ITS that why iam using the GUI_DOWNLOAD.

please does anybody knows how to send the names of the colums for one file using this function?

thanks a lot for you help.

2 REPLIES 2

Former Member
0 Kudos

Make sure you have as many rows in t_fieldnames as you have columns in t_itab2.

Rob

RichHeilman
Developer Advocate
Developer Advocate
0 Kudos

If you are using a newer system, then the GUI_DOWNLOAD funciton module does contain a TABLES parameter for fieldnames. Here is an example.



REPORT  zrich_0001.

TYPES: BEGIN OF t_fldnames,
       fldname(30) type c,
       END OF t_fldnames.

DATA: ifldnm TYPE TABLE OF t_fldnames WITH HEADER LINE.
DATA: ispfli TYPE TABLE OF spfli.

SELECT * INTO TABLE ispfli FROM spfli.

ifldnm-fldname = 'Client'.     append ifldnm.
ifldnm-fldname = 'Airline Code'. append ifldnm.
ifldnm-fldname = 'Flight Connection Number'. append ifldnm.
ifldnm-fldname = 'Country Key'.   append ifldnm.
ifldnm-fldname = 'Departure city'.  append ifldnm.
ifldnm-fldname = 'Departure airport'.  append ifldnm.
ifldnm-fldname = 'Country Key'.  append ifldnm.
ifldnm-fldname = 'Arrival city'.  append ifldnm.
ifldnm-fldname = 'Destination airport'.  append ifldnm.
ifldnm-fldname = 'Flight time'.  append ifldnm.
ifldnm-fldname = 'Departure time'.  append ifldnm.
ifldnm-fldname = 'Arrival time'.  append ifldnm.
ifldnm-fldname = 'Distance'.  append ifldnm.
ifldnm-fldname = 'Mass unit of distance (kms, miles)'.  append ifldnm.
ifldnm-fldname = 'Flight type'.  append ifldnm.
ifldnm-fldname = 'Arrival n day(s) later'.   append ifldnm.

CALL FUNCTION 'GUI_DOWNLOAD'
  EXPORTING
    filename              = 'c:/test.xls'
    write_field_separator = 'X'
  TABLES
    data_tab              = ispfli
    fieldnames            = ifldnm.

This parameter is not supported in a 46c system

Regards,

Rich Heilman