cancel
Showing results for 
Search instead for 
Did you mean: 

Adding an EXIT button in ALV toolbar

Former Member
0 Kudos

Hi,

i want to add an exit button in my ALV toolbar wherein it should exit the browser or the URL which displays the output. Plzz help me on this.

Thanks.

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi,

the following code may help you:

DATA:

l_ref_cmp_usage TYPE REF TO if_wd_component_usage,

l_interface TYPE REF TO iwci_salv_wd_table,

lr_table TYPE REF TO cl_salv_wd_config_table.

  • create alv component

l_ref_cmp_usage = wd_this->wd_cpuse_<name_of_alv_comp>( ).

IF l_ref_cmp_usage->has_active_component( ) IS INITIAL.

l_ref_cmp_usage->create_component( ).

ENDIF.

  • get config models

l_interface = wd_this->wd_cpifc_alv_activities_prdstd( ).

lr_table = l_interface->get_model( ).

  • create the toolbar button

DATA:

lr_functions TYPE REF TO if_salv_wd_function_settings,

lr_function TYPE REF TO cl_salv_wd_function,

lr_fe_button TYPE REF TO cl_salv_wd_fe_button.

lr_functions ?= lr_table.

lr_function = lr_functions->create_function( 'MYBUTTON' ).

CREATE OBJECT lr_fe_button.

lr_fe_button->set_text( 'MyButton' ).

lr_function->set_editor( lr_fe_button ).

After that add an event handler for the ON_FUNCTION event of the alv. In this method you can do whatever you want.

Kind Regards,

Anika