cancel
Showing results for 
Search instead for 
Did you mean: 

How can i read drop down list entries?

former_member194142
Participant
0 Kudos

Hello

I am aware of fillling a drop down list for a DDK field of UI by using below code, but am looking to read / get the value list of a DDK field, so that i can delete 1 entry from that, pls. let me know how can get / read value list of a DDK

IF_WD_CONTEXT_NODE_INFO-SET_ATTRIBUET_VALUE_SET

Thank you

Accepted Solutions (1)

Accepted Solutions (1)

ramakrishnappa
Active Contributor
0 Kudos

Hi,

You can get the value list of ddk field by using method GET_ATTRIBUTE of interface IF_WD_CONTEXT_NODE_INFO which returns the attribute info type structure WDR_CONTEXT_ATTRIBUTE_INFO.

You can find the field VALUE_SET in the structure WDR_CONTEXT_ATTRIBUTE_INFO which contains the value list of ddk field.

------------------------------------------

Example:

I want to read the drop list of an attribute FIELD1 of node INPUT

Data: lo_node           type ref  to if_wd_context_node,

          lo_node_info      type ref to if_wd_context_node_info,

           ls_attr_info          type WDR_CONTEXT_ATTRIBUTE_INFO.

" read the node reference

lo_node = wd_context->get_child_node( name = wdctx_input ).

"Get node info ref

lo_node_info = lo_node->get_node_info( ).

" get the attribute info

ls_attr_info = lo_node_info->get_attribute(  name = 'FIELD1' ).

" here you can get the value list as below

   "ls_attr_info-value_set

------------------------------------------

Hope this helps you.

Regards,

Rama

Answers (1)

Answers (1)

Former Member
0 Kudos

Use the following code..

DATA: lt_valueset TYPE wdr_context_attr_value_list,
         ls_valueset TYPE wdr_context_attr_value.
   DATA: lo_node_info TYPE REF TO if_wd_context_node_info,
         lo_node      TYPE REF TO if_wd_context_node,
         ls_attribute_info          type WDR_CONTEXT_ATTRIBUTE_INFO.

lo_node = wd_context->get_child_node( name = 'NODE_NAME' ).
   lo_node_info = lo_node->get_node_info( ).

     

ls_valueset-text = '10'.
   ls_valueset-value = 10.
   APPEND ls_valueset TO lt_valueset.

   ls_valueset-text = '25'.
   ls_valueset-value = 25.
   APPEND ls_valueset TO lt_valueset.

   ls_valueset-text = '50'.
   ls_valueset-value = 50.
   APPEND ls_valueset TO lt_valueset.

   ls_valueset-text = '100'.
   ls_valueset-value = 100.
   APPEND ls_valueset TO lt_valueset.


   lo_node_info->set_attribute_value_set(
     EXPORTING
       name      = 'ATTRIBUTE_NAME'
       value_set = lt_valueset   ).


   REFRESH lt_valueset[].
   CLEAR ls_valueset.

ls_attribute_info = lo_node_info->get_attribute( name      = 'ATTRIBUTE_NAME' ).
  lt_valueset ls_attribute_info-value_set.

Now Lt_valueset have all values.

former_member194142
Participant
0 Kudos

Thank you

Former Member
0 Kudos

Welcome

Good day .