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: 

ALV Grid display from selection screen

vinotha_m
Participant
0 Kudos

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.

3 REPLIES 3

Former Member
0 Kudos

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.

0 Kudos

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.

Former Member
0 Kudos

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