05-09-2006 7:01 AM
Hi,
i have a requirement wherein ..if the user checks a checkbox download as file. and then executes the report.. the report has to be downloaded and also displayed simultaneously...if i use GUI_DOWNLOAD ..i dont get the header , the column names etc..what shud i do.
05-09-2006 7:05 AM
Write the header, field names into an internal table of field string and download it into a file using GUI_DOWNLOAD, next call GUI_DOWNLOAD again in append mode and pass the internal table with the list data and save it in the same file.
05-09-2006 7:09 AM
No , the formating is also different..it has to be the same way it appears when done frm ALV display..Please suggest some other ways.
05-09-2006 7:21 AM
Hi,
While downloading file, u wont get the header part, u have to append the header part before the data. Then u pass the final output table with header to the function module.
So that it will read the first line that will be header and then remaning data.
U can create an internal table.
TYPES: begin of ty_itab ,
name(4) TYPE c,
sex(3) Type c,
end of ty_itab.
DATA: i_itab type standard table of ty_itab,
w_itab type ty_itab.
Then do as below.
w_itab-name = 'NAME'.
w_itab-sex = 'SEX'.
APPEND w_itab to i_output_final.
i_output[] = i_output_final.
APPEND i_output_final.
Now pass this final table to the functionmodule, so it is now with header.
Refer this link