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 in not coming in alv popup

Former Member
0 Kudos

Hi All,

Please have a look at the demo program SALV_DEMO_TABLE_POPUP. The ALV displayed as a popup don not have button to download the data into a excel sheet/ spread sheet. Can someone please suggest how it can be added to alv toolbar ?

I have similar requirement to display alv as popup with that button.

I dont have any choice to use any other way to create ALV apart from CL_SALV_TABLE class.

Regards

Vishal Kapoor

8 REPLIES 8

Former Member
0 Kudos

Please ignore previous message.

JerryWang
Advisor
Advisor
0 Kudos

Hello friend,

add following codes and it will work.

DATA: gr_functions TYPE REF TO CL_SALV_FUNCTIONS_LIST.
gr_functions = gr_ALV->get_functions( ).
      gr_functions->set_all( abap_true ).

Best Regards,

Jerry

meena_choudhary
Explorer

Please go through below given steps to get the download to excel button:

1) Goto SE80 > Function Group

2) Enter the function group: SALV_METADATA_STATUS

3) Copy the standard GUI Status: SALV_TABLE_STANDARD to your program by creating a Z status.

4) Copy the below given code to your program:

gr_table->set_screen_status(

pfstatus = 'ZSALV_TABLE_STANDARD'

report = sy-repid

set_functions = gr_table->c_functions_all ).

Now you will get the button in your ALV displayed as popup.

Regards,

Meena

Former Member
0 Kudos

fixed

0 Kudos

Hi Vishal,

I have a same problem like you got. I am not able to get download option in ALV popup though I am using the below code.

Could you please let me know how you fixed this issue? I mean how you got the download option button in pop up screen? Thanks in advance. Request you please reach out me at sreddy.kotha@gmail.com.

DATA: lo_table      TYPE REF TO cl_salv_table,

               lo_functions  TYPE REF TO cl_salv_functions_list,

               lo_columns    TYPE REF TO cl_salv_columns.

         DATA: lt_data TYPE TABLE OF zehs_stderr.

         TRY.

             cl_salv_table=>factory(

             IMPORTING

             r_salv_table = lo_table

             CHANGING

             t_table      = it_zehs_stderr ).

           CATCH cx_salv_msg.

         ENDTRY.

         lo_functions = lo_table->get_functions( ).

         lo_functions->set_all( abap_true ).

         lo_columns = lo_table->get_columns( ).

         lo_columns->set_optimize( abap_true ).

0 Kudos

Hi all,

I have the same issue today, so is someone find any way to add the "Spreadsheet" or "Export to local file" buttons in the ALV Popup toolbar with CL_SALV_TABLE class ?

The following 2 lines do not include these buttons (in screen popup):

lr_functions = go_alv->get_functions( ).
lr_functions->set_all( abap_true ).

And adding the following have no effect

lr_functions->set_export_spreadsheet( abap_true ).

lr_functions->set_export_localfile( abap_true ).

Regards

Hi All,

for all who have the same problem.

I did also not find a way to add the Excel Export as a button to the Popup ALV.

BUT: You can right-click into the popup. There you have the option "Spreadsheet", which will do the Excel Export for you.

And also intresting:

o_salv_popup->get_functions( )->set_view_excel( abap_false ).

This has no effect to the possiblity of saving as excel. It is still possible.

Best regards,

Sebastian

0 Kudos

Hi Sebastian!

You are right, it works. Interesting SAP features 🙂

Thank you,

Adam