‎2006 Jan 29 8:00 AM
hello!
i used gui_download in order to create an excel file.
i need to add columns heading to the file before downloading it.
i try to add hard code text into the table for each field, and the insert the line into the table as first line,but some of the table fields are numeric and i get dump.
how can i add a column line to the internal table before downloading it?
regards
yifat
‎2006 Jan 29 10:58 AM
lets say you want to download a itab with four columns.
create another itab with four columns,
like
data: begin of h_itab occurs 0 with header line ,
fc(30),
sc(30),
tc(30),
frc(40) ,
end of h_itab .
move: 'column1 title' to h_itab-fc ,
'column2 title' to h_itab-sc ,
'column3 title' to h_itab-tc ,
'column4 title' to h_itab-frc ,
append h_itab .
first download h_itab using GUI_DOWNLOAD to say file name c:/tem.xls
again call GUI_DOWNLOAD to download the itab which is holding the data to the same location (c:/tem.xls), but this time when calling GUI_DOWNLOAD pass 'X' to parameter <b>APPEND</b>.
Hope this is clear.
Regards
Raja
‎2006 Jan 29 10:58 AM
HI Yifat
You need to call gui_download twice, Once with the header and next time with the data....
Make sure that when you call the gui_download next time you append the data inside it...
Regards
Mithlesh
‎2006 Jan 29 10:58 AM
lets say you want to download a itab with four columns.
create another itab with four columns,
like
data: begin of h_itab occurs 0 with header line ,
fc(30),
sc(30),
tc(30),
frc(40) ,
end of h_itab .
move: 'column1 title' to h_itab-fc ,
'column2 title' to h_itab-sc ,
'column3 title' to h_itab-tc ,
'column4 title' to h_itab-frc ,
append h_itab .
first download h_itab using GUI_DOWNLOAD to say file name c:/tem.xls
again call GUI_DOWNLOAD to download the itab which is holding the data to the same location (c:/tem.xls), but this time when calling GUI_DOWNLOAD pass 'X' to parameter <b>APPEND</b>.
Hope this is clear.
Regards
Raja
‎2006 Jan 29 12:57 PM
Hi,
*declare an internal table it_header and it_downloads to *download the data
data:begin of it_header occurs 0,
string(100),
end of it_header.
Perform Insert_header.
Call Function GUI_DOWNLOAD
exporting
filename = c:\xyz.xls
filetype = DAT
tables
data_tab = it_download
fieldnames = it_header
exceptions
...
...
if sy-subrc <> 0.
endif.
Form Insert_header.
it_header-string = text-001.
append it_header.Clear it_header.
it_header-string = text-002.
append it_header.Clear it_header.
it_header-string = text-003.
append it_header.Clear it_header.
it_header-string = text-004.
append it_header.Clear it_header.
Endform.
Please reward points if it is helpful.
Thanks,
Pramod