cancel
Showing results for 
Search instead for 
Did you mean: 

dropdown by key

Former Member
0 Kudos

Hi all,

I want to implement Dropdown by KEY in my application.

I learnt that i have to pass one value set for the dropdown by KEY and this value set (internal table must be of type WDY_KEY_VALUE_TABLE. So, in WDDOINIT method, i have written coding to populate the attribute of my context node (NODE name - CONTENT, the attribute name created beneath CONTENT node is KEY). This internal table of type WDY_KEY_VALUE_TABLE is then binded to the KEY attribute.

Now i dont know how i should declare the KEY attribute under CONTEXT node.

When i declare the KEY as WDY_KEY_VALUE_TABLE, it is returning the following error..

"Conversion of type h to type g not supported. "

Can anyone let me know, what is the error i have done here, and how to correct it.. for implementing dropdown by KEY

Regards,

Shanthi

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Try this code.


" Attribute  KEY is of type String
DATA:
  node_category TYPE REF TO if_wd_context_node_info,
  nd_category   TYPE REF TO if_wd_context_node.

  node_category = wd_context->get_node_info( ).
  node_category = node_category->get_child_node( 'CN_DPDWN' ).

  nd_category = wd_context->get_child_node( 'CN_DPDWN' ).

  DATA: lt_valueset TYPE wdr_context_attr_value_list,
    l_value TYPE wdr_context_attr_value.

  l_value-value = 'Last 30 Days'.
  l_value-text  = 'Last 30 Days'.
  INSERT l_value INTO TABLE lt_valueset.

  l_value-value = 'Last 60 Days'.
  l_value-text  = 'Last 60 Days'.
  INSERT l_value INTO TABLE lt_valueset.

  l_value-value = 'Last 90 Days'.
  l_value-text  = 'Last 90 Days'.
  INSERT l_value INTO TABLE lt_valueset.

  SORT lt_valueset.

  node_category->set_attribute_value_set(
  name = 'KEY'
  value_set = lt_valueset ).

Answers (2)

Answers (2)

Former Member
0 Kudos

check this wiki [https://wiki.sdn.sap.com/wiki/pages/viewpage.action?pageId=83657471]

Former Member
0 Kudos