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

Export multiple tables to excel

Former Member
0 Likes
3,165

I know how to export a single table directly to an excel file. What I need to know is how I can include three, unrelated, tables in the same excel file? I want to create this excel file directly, not use an ALV first.

Regards,

Aaron

1 ACCEPTED SOLUTION
Read only

rajasekhar_matukumalli3
Active Participant
0 Likes
1,863

Hi,

Use GUI_DOWNLOAD.

1) While downloading the tables, maintain same filename.

2) From the second GUI_DOWNLOAD function call use the "APPEND" option.

append = 'X'

Hope this solves your problem.

Regards,

Raj

6 REPLIES 6
Read only

Former Member
0 Likes
1,863

Hi Aaron Shover,

You can fill one internal table with all three or four tables data in one internal table...

and pass this internal table in FMs

like

GUI_DOWNLOAD

SAP_CONVERT_TO_XLS_FORMAT

etc...

Hope it will solve your problem

<REMOVED BY MODERATOR>

Thanks & Regards

ilesh 24x7

Edited by: Alvaro Tejada Galindo on Apr 30, 2008 1:14 PM

Read only

0 Likes
1,863

How can I fill one table with all three if they all have different fields?

What I am envisioning is one table followed by several blank rows then another, etc...

Regards,

Aaron

Read only

0 Likes
1,863

Hi Aaron Shover,

You can not do like that...

As it will not gonna give u correct result...

u will hv to create separate columns for each table fileds...

u can not append the one table data and then another table data in the same internaltable... where itab1 and itab2 are having different structures...

if u do so then also the data may not be correct in final internal table and also in excel file in which u will download it....

better create one Z Structure in DDIC which contains all fields u required in final table..

Create internal table of that structure...

runtime populate the data in the internal tables as per the conditions u wanna insert it...

The fields which r blank ... keep it blank...

Concentrate on what fields u require...

It seems strange requirement as u want multiple table data in one excel file which r not linked (related) by any keys or any fields...

or else u can call the GUI_DOWNLOAD 4 times for each table and then u can manually copy one excel file data to another...

But i think there should be some relation between these fields...

eg table_1


mat_no prise 
mat1     345
mat2     465 

table_2


pernr    salary
204      20000
345      46588

Now how u can have this data in one excel file... and wht will be the purpose of it.. as its nowhere related to each other


mat_no prise  pernr    salary
mat1     345   204      20000
mat2     465   345      46588

Hope it will solve ur prob....

<REMOVED BY MODERATOR>

Thanks & Regards

ilesh 24x7

Edited by: Alvaro Tejada Galindo on Apr 30, 2008 1:16 PM

Read only

0 Likes
1,863

I need to do this because I have created one report that does three seperate queries, based off one key. I want to export these three tables to an excel file but I don't want the user to have to use three files because they will end up storing them in the same file anyway (via copy and paste).

Regards,

Aaron

Read only

rajasekhar_matukumalli3
Active Participant
0 Likes
1,864

Hi,

Use GUI_DOWNLOAD.

1) While downloading the tables, maintain same filename.

2) From the second GUI_DOWNLOAD function call use the "APPEND" option.

append = 'X'

Hope this solves your problem.

Regards,

Raj

Read only

0 Likes
1,863

That sounds like a wonderful option!

Thanks,

Aaron