cancel
Showing results for 
Search instead for 
Did you mean: 

Creating Dropdown in ALV toolbar

Former Member
0 Kudos

Hi,

I am trying to implement Table level filtering in Webdynpro ALV.

I created a dropdown in the Toolbar in ALV. I am not able to retrieve the values in the dropdown.

I have written the following code.

method WDDOINIT .

data: lr_ref_cmp_usage type ref to if_wd_component_usage.

lr_ref_cmp_usage = wd_this->wd_cpuse_alv_test( ).

IF lr_ref_cmp_usage->has_active_component( ) IS INITIAL.

lr_ref_cmp_usage->create_component( ).

ENDIF.

data: l_ref_interfacecontroller type ref to iwci_salv_wd_table,

l_value type ref to cl_salv_wd_config_table.

l_ref_interfacecontroller = wd_this->wd_cpifc_alv_test( ).

l_value = l_ref_interfacecontroller->get_model( ).

data: lr_table_settings type ref to if_salv_wd_table_settings.

lr_table_settings ?= l_value.

lr_table_settings->set_read_only( abap_false ).

data: lr_functions type ref to if_salv_wd_function_settings,

lr_function type ref to cl_salv_wd_function,

lr_dropdown_by_idx type ref to CL_SALV_WD_FE_DROPDOWN_BY_IDX.

  • Add self-defined functions in toolbar

lr_functions ?= l_value.

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

create object lr_dropdown_by_idx

exporting

texts_elementname = 'DROPDOWNBYINDEX.VALUE'.

lr_dropdown_by_idx->set_label_text( 'CURRENCY' ).

lr_function->set_editor( lr_dropdown_by_idx ).

data:

lt_dropdownbyindex type ig_componentcontroller=>elements_dropdownbyindex,

ls_dropdownbyindex type ig_componentcontroller=>element_dropdownbyindex,

node TYPE REF TO if_wd_context_node.

ls_dropdownbyindex-value = 'ACTIVE'.

append ls_dropdownbyindex to lt_dropdownbyindex.

ls_dropdownbyindex-value = 'QUALIFIED'.

append ls_dropdownbyindex to lt_dropdownbyindex.

node->bind_table( lt_dropdownbyindex ).

endmethod.

I have seen in some threads that i need to write the following statement to bind the values.

node->bind_table( lt_dropdownbyindex ).

Could someone help me out to which node I need to bind to. I am now geting the dropdown in menubar but not geting the values in it. Also I need to do filtering depending on the value selected in the dropdown list.

Kindly send some useful links which helps in creating dropdowns in ALV toolbar.

Thanks,

Suvarna.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi

i think you need to use method SET_TEXTS_ELEMENTNAME of CL_SALV_WD_FE_DROPDOWN_BY_IDX to set the value of dropdown

see the documenation for this method.

Regards

Naresh

Answers (1)

Answers (1)

Former Member
0 Kudos

Problem Solved.

Thanks,

Suvarna.