cancel
Showing results for 
Search instead for 
Did you mean: 

Dropdown list in alv toolbar

Former Member
0 Kudos

Hi all..

I want to display a dropdown list in the ALV toolbar..

How can i do it using user defined functions...

I also tried using the class cl_salv_wd_fe_dropdown_by_key

  • Creating a DropDown List in ALV Toolbar.

DATA lr_drdwnui TYPE REF TO cl_salv_wd_fe_dropdown_by_key.

CREATE OBJECT lr_drdwnui EXPORTING selected_key_elementname =

lr_drdwnui->set_label_text( 'Colors' ).

But not getting what value should i give to selected_key_elementname?????

A small piece of code is appreciated..\

jagruti

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Jagruti,

I am providing the some peice of code which will be helpful to you.

<b>Adding the DropDown list to the ALV toolbar:</b>

lr_functions ?= wd_this->r_table.

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( 'MYDROPDOWNBYINDEX' ).

lr_function->set_editor( lr_dropdown_by_idx ).

<b>Providing the values to that DropDown:</b>

Here in my example DROPDOWNBYINDEX.VALUE is the context attrubute. And i write the Supply function for that node as follows:

data:

lt_dropdownbyindex type if_componentcontroller=>elements_dropdownbyindex,

ls_dropdownbyindex type if_componentcontroller=>element_dropdownbyindex.

ls_dropdownbyindex-value = 'Nothing'. "#EC NOTEXT

append ls_dropdownbyindex to lt_dropdownbyindex.

ls_dropdownbyindex-value = 'ActionDropdownByIndex'. "#EC NOTEXT

append ls_dropdownbyindex to lt_dropdownbyindex.

node->bind_table( lt_dropdownbyindex ).

For reference you can refer the WD component SALV_WD_TEST_TABLE_TOOLBR which holds the same code

Warm Regards,

Vijay

Answers (0)