cancel
Showing results for 
Search instead for 
Did you mean: 

DropDownByKey into a Table

Former Member
0 Kudos

Hi experts,

I need insert a Drop Down By Key into a Table, in a WebDynpro application.

I have created a node (cardinality 0...1) which has all fields that I have to populate in the table. The table only must show one row.

I think that I must create a SubNode (cardinality 0...n) into the other Node to map this with my DropDown, but I'm not sure.

Could anybody tell me how can I add a Drop Down By Key into a Table?

Thanks in Advance!

Lucas

Accepted Solutions (1)

Accepted Solutions (1)

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

The process is no different than if the DDBK was used outside a table. You don't need another context node for the values. You would just set them into the Node Info of the node for your table using the IF_WD_CONTEXT_NODE_INFO=>SET_ATTRIBUTE_VALUE_SET method call. Something like the following:

data l_activities type zpm_activity_typ_tbl.
  l_activities = wd_assist->read_all_activities( ).
  data lt_valueset type wdr_context_attr_value_list.
  field-symbols <wa_act> like line of l_activities.
  field-symbols <wa_vs>  like line of lt_valueset.

  loop at l_activities assigning <wa_act>.
    append initial line to lt_valueset assigning <wa_vs>.
    <wa_vs>-value = <wa_act>-activity_type.
    <wa_vs>-text  = <wa_act>-activity_desc.
  endloop.

  data lo_nd_meeting type ref to if_wd_context_node.
* navigate from <CONTEXT> to <MEETING> via lead selection
  lo_nd_meeting = wd_context->get_child_node( name = wd_this->wdctx_meeting ).
  data lo_node_info type ref to if_wd_context_node_info.
  lo_node_info = lo_nd_meeting->get_node_info( ).
  lo_node_info->set_attribute_value_set(
     name = 'ACTIVITY_TYPE'
     value_set = lt_valueset ).

Answers (1)

Answers (1)

Former Member
0 Kudos

Thank you Thomas,

Your response is very useful.

Kind Regards,

Lucas