cancel
Showing results for 
Search instead for 
Did you mean: 

ALV help required

Former Member
0 Kudos

Hi All,

I require to download the ALV output in excel format using the export button in the toolbar. Can anyone please tell the process how to implement this functionality.

Regards,

Mainak

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

This is the default option provided in ALV Output i.e EXPORT TO EXCEL Button in Tool bar.

I think in your case it hided by programatically check this code to activate the button.

l_value->IF_SALV_WD_STD_FUNCTIONS~SET_EXPORT_ALLOWED( abap_true ).

thanks

Suman.

Former Member
0 Kudos

Hi,

Even after checking the flag in method if_if_salv_wd_std_functions->set_export_allowed( ), the export functionality in ALV is not working. Can you please suggest, how to activate the functionality.

Regards,

Mainak

Former Member
0 Kudos

Can you paste your code here

Thanks

Suman

Former Member
0 Kudos

Hi,

I have written the below code in WDDOINIT of the main view to enable export functionality. Please suggest if there is any other way.

DATA:

lr_salv_wd_table_usage TYPE REF TO if_wd_component_usage.

DATA:

lr_salv_wd_table TYPE REF TO iwci_salv_wd_table.

DATA: lr_export_settings TYPE REF TO if_salv_wd_export_settings,

r_table type ref to CL_SALV_WD_CONFIG_TABLE,

lr_std_func TYPE REF TO if_salv_wd_std_functions.

lr_salv_wd_table_usage = wd_this->wd_cpuse_alv( ).

IF lr_salv_wd_table_usage->has_active_component( ) IS INITIAL.

lr_salv_wd_table_usage->create_component( ).

ENDIF.

*... get ALV component

lr_salv_wd_table = wd_this->wd_cpifc_alv( ).

*... (1) get ConfigurationModel from ALV Component

wd_this->r_table = lr_salv_wd_table->get_model( ).

*... init FunctionSettings

cl_salv_wd_model_table_util=>if_salv_wd_table_util_stdfuncs~set_all(

r_model = wd_this->r_table ).

lr_std_func ?= wd_this->r_table.

lr_std_func->set_export_allowed( abap_true ).

Former Member
0 Kudos

Your code is perfectly working,i tested i am able to see the button Export to Excel in the Tool bar of ALV.

Actually by default you will get this button unless you write set_export_allowed is false.

check in your code some where else they might disabled this option.

check in WDMODIFYVIEW.....

Thanks,

Suman.

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

> the export functionality in ALV is not working

What isn't working? Is the export option not showing up on the toolbar or is the export failing? As stated the default option is to have the ALV Export function and it should work "out of the box" without any additional coding or configuration on your part.

vmadhuvarshi_
Contributor
0 Kudos

Mainak,

With component SALV_WD_TABLE, Excel export functionality is available by default. To learn how to use this component to create ALV, follow [this link|https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/media/uuid/39c54fe7-0b01-0010-0eb6-d63ac2bdd637].

Hope this helps.

Vishwas.