cancel
Showing results for 
Search instead for 
Did you mean: 

dropdown in table element using webDynpro for ABAP

Former Member
0 Kudos

Hi All,

My requirement is:

i have a dropdown in table ui element . before i do a bind_table with context , my dropdown should be loaded.

how to do this ??

pls help me with sample code.

thanks,

Hema.

Accepted Solutions (1)

Accepted Solutions (1)

former_member182190
Active Participant
0 Kudos

Hi Hema Sundar,

You just need to create an Attribute in your context node and bind it to the

SelectedKey property of the dropdown.

Populate the value of the attribute when you are fetching data to fill in

your internal table.

Also If you want to populate data into the dropdown on your own

you can refer to the below code

data:

lr_node type ref to if_wd_context_node,

lr_node_info type ref to if_wd_context_node_info,

lt_nv type wdr_context_attr_value_list,

ls_nv type wdr_context_attr_value.

lr_node = wd_context->get_child_node( if_componentcontroller=>wdctx_element ).

lr_node_info = lr_node->get_node_info( ).

  • build lt_nv ...

lr_node_info->set_attribute_value_set(

name = 'ATTRIBUTE'

value_set = lt_nv ).

Hope this helps.

Regards,

Ismail.

Answers (2)

Answers (2)

Former Member
0 Kudos

completed.

Former Member
0 Kudos

Hi Hema.

You can do it 2 ways: DropDownByKey and DropDownByIndex.

For this first one, you can bind the values to the context node's attribute in the Component Controller Init method, or View Init method as follows:

lo_nd_info->set_attribute_value_set( name = <att_name>

value_set = lt_value ).

where lt_value is of type wdy_key_value_table.

Eg:

lo_nd_info = wd_context->get_node_info( ).

lo_nd_info = lo_nd_info->get_child_node( 'N0' ).

lo_nd_info->set_attribute_value_set( name = 'ATT1_DDBYKEY'

value_set = lt_value ).

If you use DropDownByIndex, you need to bind values using bind_table only in the INIT method.

Hope it helps.