Application Development and Automation 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: 
Read only

Problem in down loading data to Excel sheet

Former Member
0 Likes
432

Hi all

I have to down load the certain fields in to EXCEL sheet.

i need to download the FIELD HEADING ALSO down load dynamically.

its not hard coding in the function module.

please let me know how to do it?

4 REPLIES 4
Read only

anversha_s
Active Contributor
0 Likes
401

hi,

1) first download the headings only to the excel sheet.

2) then download the data to the same excel sheet.

Regards

anver

Read only

former_member188829
Active Contributor
0 Likes
401

use FM:gui_download

Read only

Former Member
0 Likes
401

Hi,

Store the final data you want to download in a seperate internal table say gt_tab1 having all filed type as string.

Now insert the table heading in each column as required in index 1 i.e first row of gt_tab1.

Download gt_tab1 .

Thanks,

Sutapa.

Read only

anversha_s
Active Contributor
0 Likes
401

hi,

as i mentioned above, look this

Use that FM GUI_DOWNLOAD twice:

First time download only header

Second time append table contents to the same file (import parameter append = 'X')

egx:

or example if your itab used for writing the abap list is like below.

data: begin of details occurs 0 ,

customer type kna1-kunnr,

name type kna1-name1 ,

end of details.

declare another internal table.

data: begin of headers occurs 0 ,

customer(100) ,

name(100),

end of headers.

move: '010101' to headers-customer ,

'Anver' to headers-name .

append headers.

now call GUI_download to download headers to filename c:/tem.xls

again call gui_download with APPEND = 'X' to the same file name and download details itab

Regards

Anver