cancel
Showing results for 
Search instead for 
Did you mean: 

How to access an ALV by clicking button

former_member224404
Active Participant
0 Kudos

Hi team,

I have created a ALV display (by using SALV_WD_TABLE component usage) in wddoinit method of my view.Now I have a button.If I click on button,one of the field of ALV would be hidden.

Now I know how to hidden the field but I don't know the way to access my ALV inside the onclick method of the button.

Waiting for your help...

Thanks,

Mainak

Accepted Solutions (1)

Accepted Solutions (1)

abhimanyu_lagishetti7
Active Contributor
0 Kudos

Hi Mainak,

You can use this code to get access to your alv

DATA: l_ref_interfacecontroller TYPE REF TO iwci_salv_wd_table .

l_ref_interfacecontroller = wd_this->wd_cpifc_alv( ).

DATA: l_value TYPE REF TO cl_salv_wd_config_table.

l_value = l_ref_interfacecontroller->get_model( ).

Regards

Abhimanyu L

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi , You can do it by following way .

  • create an instance of ALV component

DATA:

lr_salv_wd_table_usage TYPE REF TO if_wd_component_usage.

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.

<b>* hide field CURR_ISO</b> DATA:

lr_column_settings TYPE REF TO if_salv_wd_column_settings,

lr_column TYPE REF TO cl_salv_wd_column.

lr_column_settings ?= wd_this->alv_config_table.

<b><i>lr_column = lr_column_settings->get_column( 'CURR_ISO' ).

lr_column->set_visible( if_wdl_core=>visibility_none ).</i></b>

Please see Package<b> SWDP_DEMO_TUTORIALS</b> >> In webDynpro see <b>

WDT_ALV</b>

I have another idea but not have tried it .This Set_Visible parameter is Boolean . So make same boolean node and change its value onclick and send its value as parameter to Set Visible.