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 Export Top of page and End of Page

benlim
Contributor
0 Kudos

Hi Expert,

I've search through various blog on this solution but fail to find one.

My requirement is to export the ALV to excel including top of page, table and end of page.

I used FM REUSE_ALV_GRID_DISPLAY with exporting i_callback_html_top_of_page,i_callback_html_end_of_list.

How could I export these information using standard ALV export function?

Thanks.

Regards,

Ben

8 REPLIES 8

Jelena
Active Contributor

Google -> ALV header export to Excel -> 32300 results

I don't believe it's feasible exactly as you're expecting. The top part is most likely removed on purpose when exporting into Excel (MHTML) format. And it makes sense to me. Instead of export to Excel button, you could use Save to local file option to save XLS and that should include the top part too.

Search in Google for other options and make sure to search next time before posting a question.

0 Kudos

Hi @Jelena Perfiljeva,

Thats the reason I'm posting to confirm my technical findings. Thanks for pointing out that this approach is not feasible.

On top of that, I've tried using both ALV Grid, and ALV List to extract the top of page and end of page by using Events parameter in the FM. However, when extracted using ALV List(although in print preview the content is center), the content in top of page and end of page, will always sit on the left. While for ALV Grid, it is able to extracted in the center part but the table content will have additional column added in order to fit the top of page content which is in the center.

May I know which part goes wrong for this? or is it the limitation of ALV Grid/List display?

Thanks.

Jelena
Active Contributor

The question is - why do you even need this? Normally, when users choose export to Excel they need only data. They don't need any headers or footers. It's actually quite annoying that these are included when using save to local file, I have to delete them 99% of the time. Without the header part, the users can quickly start working with the data in Excel (sort / filter).

If you're attempting some sort of an Excel form then you might want to look up using Excel templates. Or the well known ABAP2XLSX. Look this up in Google.

0 Kudos

Hi @Jelena Perfiljeva,

That's the requirement. There will be no working on the data in the Excel after export to local. It will serves for reporting purposes. The headers display some title type information and footer will have some comments and leaving some space with the signature information(title of the person who signed) when exported out.

Thanks for giving the hints on ABAP2XLSX. This has definitely solve my requirement. ABAP2XLSX allow me to freely manipulate/formatting the output to excel.

Thanks.

Jelena
Active Contributor
0 Kudos
There will be no working on the data in the Excel after export to local.

Then you don't need Excel at all IMHO, you just need a form (Smartform or Adobe). That's what they're for.

0 Kudos

Hi jelena.perfiljeva ,

That's the question we throw to our client. They insists to have excel format for the output with ALV display.

Appreciate your help for the guidance. 🙂

Jelena
Active Contributor

Well, you could explain to them that this just creates "technical debt" since such options most likely won't work in S/4HANA if that's their ERP path. These days, we can't just continue doing everything as we did 10 years ago. Need to think about the future. It's coming sooner than we might think.

0 Kudos

Its helpful. Thank you.