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: 

Download to excel from ALV

Former Member
0 Kudos

Hi All,

I am modifying the subtotals/totals in my ALV before display and refreshing the table.

  • Refresh the table display

CALL METHOD lo_grid->refresh_table_display

EXPORTING

i_soft_refresh = 'X'.

  • Refresh the table

Call Method lo_grid->check_changed_data.

The output is indeed get modified and my new subtotals/totals are getting dispalyed, But when I use the Excel download button option from ALV-toolbar. I could only see my old data (previous subtotals/totals).

How can I get the modified subtotal/total in excel file.

P.S - Enduser will only use the excel button for download.

Regards,

DNP

11 REPLIES 11

saranwin
Contributor
0 Kudos

Hi,

You should update (or) Modify the data after changing in the display screen (or) where your changing. your trying to download the data from the internal table not from display screen. So, Check your internal table before calling the download function module.

Regards,

Saran

Former Member
0 Kudos

Hi Saran,

Can you be more clear/elaborate?

Regards,

DNP

Former Member
0 Kudos

Your internal table still has the old data. ALV will displpay new data but when downloaded, it will still refer your internal table.

Modify your internal table and everyting will work.

You can refer to program BCALVEDIT*03

Cheers,

Verma.

0 Kudos

Hi Santosh,

My internal table doesn't have subtotals/totals they are getting calculated during ALV display.

I checked the internal table and it is same before/after I refresh/change the subtotals/totals. What do I change in the internal table.

Regards,

DNP

0 Kudos

When you press the "Download to Excel" button, system again reclculate the totals and Subtotal. So, your updated subtotals are not coming into your download file.

Regards,

Naimesh Patel

0 Kudos

Hi Naimesh,

So what is the solution to this. How can I get the data with modified subtotals/totals in an excel file???

Regards,

DNP

0 Kudos

Is there anyone who knws te awnser? I'm facing the same issue...

0 Kudos

Hi,

Please check [Download to Excel from ALV |http://wiki.sdn.sap.com/wiki/pages/viewpage.action?pageId=82805744]

Thanks,

Abhijit

Edited by: Abhijit Mandal on Feb 23, 2010 6:22 PM

0 Kudos

I did check the code in your link but it doesn't solve my problem...

I want to download the ALV output including totals and subtotals to excel. I've tried using FM GUI_DOWNLOAD but I only get the header and the table data in excel no totals and subtotals...

If you know a solution for this, it would really help me.

0 Kudos

Hi,

Take a field in an internal table for sub totals which is mentioned in gui_download.

Thanks.

Ramya.

0 Kudos

What I have done in the past is insert additional rows in the internal table with the column I'm totaling populated with a subtotal at that point, and an additional row at the end with the grand total. Of course, this is going to royally foul up your ALV display if you try to continue to use the ALV AFTER you insert totals and do the download.

What everybody is saying is that the ALV is a formatted presentation of your internal table with the subtotals and totals generated within the ALV display.

Ideally, we'd want to recreate the subtotals and grand total in Excel, but you probably have the problem of having the data arrive in Excel or in a tab-delimited file as text instead of numeric values.