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: 

(ABAP) ALV grid "Spreadsheet" export button vs "Microsoft excel" export button.

klef
Explorer
2,957

Hi.

I'm using this code to export the output into a sheet:

      o_functions = o_salv->get_functions( ).<br>      o_functions->set_all( abap_true ).<br>


However, I have a problem because my ALV grid is colored and apparently that means the export to Microsoft Excel takes an enormous amount of time (I'm talking a couple of minutes for less than a thousand lines). The colors are being copied too (which I would rather not) and some values are not correct.

I noticed that if I right click on the output ALV grid and select "Spreadsheet", the result is much quicker and instead of the table being directly opened in Microsoft Excel, it instead opens a Save As dialog, and the table is fine.

I noticed that in some programs I see "Microsoft Excel" buttons and in some I see "Spreadsheet" buttons. They are very similar in looks but function differently.

So the question is.

How do I get the "Spreadsheet" button instead of "Microsoft Excel" button?

Thanks!

1 REPLY 1

Sandra_Rossi
Active Contributor
2,681

Good question, and well asked. I'm not sure whether I have the most simple answer but let's see what other people say.

The export buttons are different between full screen (old, slow and ugly XXL) and grid (the fast and modern XLSX + many other possible formats = function code &XXL)

In full screen, either you use the standard solution to use modern XLSX:

  • context menu > Spreadsheet
  • List menu > Export > Spreadsheet
  • type &XXL in the command field

Or custom code:

  • duplicate GUI Status SALV_TABLE_STANDARD of function group SALV_METADATA_STATUS into your custom program
  • in the application toolbar, replace the function codes &VGRID &VEXCEL &VLOTUS &VCRYSTAL SL &GRAPH with &XXL only
  • in your program, add salv->set_screen_status( report = sy-repid pfstatus = 'SALV_TABLE_STANDARD' ).

NB: what I call "full screen" mode, is when you call this way:

cl_salv_table=>factory( IMPORTING ... CHANGING ... ).

(without mentioning EXPORTING followed by any of these 3 parameters R_CONTAINER ("grid" mode), LIST_DISPLAY ("ABAP list" mode) and CONTAINER_NAME (also "grid" mode), or they are somewhat possibly passed empty).