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: 

Total problem in Exporting ALV GRID to Excel

rameshkumar_ramasamy2
Participant
0 Kudos

Hi all,

I have manipulated the Total of ALV Grid by using GET_SUBTOTALS and REFRESH method of CL_GUI_ALV_GRID. The ALV Output is also correct. When i export to Excel,only the Original total is displaying not the calculated one. How to download the exact output which is displaying in the ALV Grid to Excel.

Please help me out to solve this.

Thanks,

Ramesh

1 ACCEPTED SOLUTION

madhu_vadlamani
Active Contributor
0 Kudos

HI,

Download in html format and see .How it it appearing.

Regards,

Madhu.

8 REPLIES 8

former_member184578
Active Contributor
0 Kudos

Hi,

You can calculate total manually by loop internal table and pass your final internal table to ALV.

Thanks & regards,

Kiran.

0 Kudos

Hi Kiran,

I think you misunderstood my post. The ALV Output is correct but when i export to Local File, the calculated(Custom) Total are not exported, only the Original Summing is exported.

0 Kudos

Hi,

Check in your field catalog. If you use do_sum = 'X' . comment it and try.. Also convert to list using preview and check.

Hope this helps u.,

Thanks & regards,

Kiran.

madhu_vadlamani
Active Contributor
0 Kudos

HI,

Download in html format and see .How it it appearing.

Regards,

Madhu.

0 Kudos

Hi Madhu,

In HTML is working fine. But i need to export to Excel.

@ Kiran,

I have to do it because after DO_SUM = 'X' only i will get the Total

Thanks,

Ramesh

0 Kudos

Not sure,

But best way you can do is, calculate your total before passing to alv.

and pass total also as a data to internal table to alv.

0 Kudos

> I have to do it because after DO_SUM = 'X' only i will get the Total

Hi Ramesh,

This is what I mentioned in first post. Normally if you do total and export it has to come when export to excel also. If not try that as alternative. Comment do_sum = 'X' and calculate total manually by looping your internal table and append total line to your final internal table and then pass final internal table to ALV.

If you bother about color of total line, you can set the color also manually to the total line.

Hope this helps u.,

Thanks & Regards,

Kiran.

Former Member
0 Kudos

DEAR,

AS U WANT UPLOAD WITH THE SUB TOTAL YOU TRY THIS.

FIRST to get subtotal in ALV output you select at least one column of total and then press ctrl + F6 . u will see the sub total .

and now how to download it so press ctrl + shift + F9 .

now screen appears and select second option ie spreadsheet and press enter

now a screen appear in wich u have to give file name.

so double click on search button of file name . click on desktop give ur file name as u want suppose zreport u have given.

and save type = excel file.

now save it and then generate it your output bytes will be transmitted .

now u can see in your desktop in your file name . ur output with subtotal.

regards

navin