cancel
Showing results for 
Search instead for 
Did you mean: 

How to Add drop down in ALV toolbar in webdynpro abap?

0 Kudos

I have added a button in ALV toolbar, similarly i have to add drop down in the toolbar. please provide a solution.

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi Satya,

try below code.

Adding the DropDown list to the ALV toolbar:

  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 ).

Providing the values to that DropDown:

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'.                   

  append ls_dropdownbyindex to lt_dropdownbyindex.

  ls_dropdownbyindex-value = 'ActionDropdownByIndex'.      

  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

Regards,

venkat

Former Member
0 Kudos

Since, you have added Button to tool bar, you have used Class cl_salv_wd_fe_button. Please use CL_SALV_WD_FE_A_DROPDOWN for dropdown.For more attirbutes, search CL_SALV_WD_FE*

Thanks

Mohinder

Th

T

0 Kudos

getting an error like "You cannot generate instances of the abstract class 

"CL_SALV_WD_FE_A_DROPDOWN "

Please guide me how to do that .. or sample code