cancel
Showing results for 
Search instead for 
Did you mean: 

DropDown By Index for a Column in ALV

Former Member
0 Kudos

Hi,

I am trying to create a dropdown for a column in ALV. I have used the following code for the same.

data:

lr_drdn_by_index type ref to cl_salv_wd_uie_dropdown_by_idx.

create object lr_drdn_by_index

exporting

selected_key_fieldname = ls_column-id.

lr_drdn_by_index->set_valueset_fieldname( 'VALUESET' ).

lr_drdn_by_index->set_type( if_salv_wd_c_uie_drdn_by_index=>type_key_value ).

ls_column-r_column->set_cell_editor( lr_drdn_by_index ).

"VALUESET" Contains the Dropdown Data.

Is there any settings that I have to do which is missing?

Regards,

Shruthi

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

follow these steps :

1) create a node for example (NODE_LIST)

2) crrate an attribute (LIST: type WDY_UIE_LIBRARY_ENUM_TYPE)

3) in your WDDOINIT method, populate your list :

lr_node = wd_context->get_child_node('NODE_LIST').

lr_node_info = lr_node->get_node_info( ).

ls_value_set-key = 10.

ls_value_set-value = 'tes'.

INSERT ls_value_set INTO TABLE lt_value_set.

ls_value_set-key = 20.

ls_value_set-value = 'tes'.

INSERT ls_value_set INTO TABLE lt_value_set.

lr_node_info->set_attribute_value_set(

name = 'LIST'

value_set = lt_value_set ).

4) in your table settings :

data :

list_field TYPE REF TO cl_salv_wd_uie_dropdown_by_key.

CREATE OBJECT list_field

EXPORTING selected_key_fieldname = ls_columns-id.

ls_columns-r_column->set_cell_editor( list_field ).

I hoep this helps, if not please clarify your question.

Regards

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Shruthi,

Kindly check out following,

Please see Package SWDP_DEMO_TUTORIALS >> In webDynpro see

WDT_ALV.

There is a web dynpro example called ALV_TABLE.

Or you can check SWDP package also.

Hope this will help you.

Cheers,

Darshna.