cancel
Showing results for 
Search instead for 
Did you mean: 

Drop down by key in a table colum in web dynpro

mahesh_jagnani
Participant
0 Kudos

Hi Experts,

Can u plz let me know how we can do the dropdown by key at column level in a table.

The data which we want to display in dropdown is in the interbal table and is only one field of that internal table.

Please help.

Accepted Solutions (0)

Answers (2)

Answers (2)

mahesh_jagnani
Participant
0 Kudos

solve

Madhu2004
Active Contributor
0 Kudos

HI,

All you need to do is form value set from the internal table.

Pass and key and value as same field and form the valuset.

Now bind this value set to the attribute in the node using the SET_ATTRIBUTE_VALUE_SET method of IF_WD_CONTEXT_NODE_INFO interface.

Regards,

madhu

mahesh_jagnani
Participant
0 Kudos

Hi ,

Thanks but the problem is :-

Code:-

DATA lt_regions TYPE wdy_key_value_table.

DATA lwa_region TYPE wdy_key_value.

lwa_region-key = 'EAST'.

lwa_region-value = 'East'.

APPEND lwa_region TO lt_regions.

lwa_region-key = 'NORTH'.

lwa_region-value = 'North'.

APPEND lwa_region TO lt_regions.

lwa_region-key = 'SOUTH'.

lwa_region-value = 'South'.

APPEND lwa_region TO lt_regions.

lwa_region-key = 'WEST'.

lwa_region-value = 'West'.

APPEND lwa_region TO lt_regions.

data lr_nodeinfo_flightinfo TYPE REF TO if_wd_context_node_info.

DATA lo_nd_t_emp_ess TYPE REF TO if_wd_context_node.

DATA lo_el_t_emp_ess TYPE REF TO if_wd_context_element.

DATA ls_t_emp_ess TYPE wd_this->Element_t_emp_ess.

DATA lv_pgtxt TYPE wd_this->Element_t_emp_ess-pgtxt.

  • navigate from <CONTEXT> to <T_EMP_ESS> via lead selection

lo_nd_t_emp_ess = wd_context->path_get_node( path = `HGT_EMP_CARRIER_ESS.CHANGING.T_EMP_ESS` ).

  • get element via lead selection

lo_el_t_emp_ess = lo_nd_t_emp_ess->get_element( ).

  • get single attribute

lo_el_t_emp_ess->get_attribute(

EXPORTING

name = `PGTXT`

IMPORTING

value = lv_pgtxt ).

lr_nodeinfo_flightinfo = wd_context->get_node_info( ).

  • set single attribute

lr_nodeinfo_flightinfo->set_attribute_value_set(

name = `PGTXT`

value_set = lt_regions ).

here lt_regions is the internal table of type wdy_key_value_table.

when i execute the application , it say "Could not find attribute PGTXT " . The PGTXT is the attribute of the table with property "drop down by key".

P

Former Member
0 Kudos

Hi,

Instead of :

lr_nodeinfo_flightinfo = wd_context ->get_node_info( ). <--will search for Attribute in Context

write :

lr_nodeinfo_flightinfo = lo_nd_t_emp_ess ->get_node_info( ). <-- Will search for Attribute in Flight Node

Reagrds,

Nawal Kishor Mittal