cancel
Showing results for 
Search instead for 
Did you mean: 

doubt about the dropdownkey element

Former Member
0 Kudos

hi,

i am using the dropdown key element in my view to create one no. and the dropdown key element will consist of only two values either 'this' or 'that'.

my code is like this

TYPES: BEGIN OF T_aenst ,

aenst type zaenr-aenst,

END OF T_aenst.

DATA: WA_aenst TYPE T_aenst,

I_aenst TYPE STANDARD TABLE OF T_aenst.

data: lr_node type ref to if_wd_context_node,

lr_nodeinfo type ref to if_wd_context_node_info,

lt_valueset type wdr_context_attr_value_list,

ls_valueset type wdr_context_attr_value.

lr_node = wd_context->get_child_node( 'SECOND' ).

lr_nodeinfo = lr_node->get_node_info( ).

WA_AENST-AENST = '01'.

append wa_aenst TO i_aenst.

WA_AENST-AENST = '02'.

append wa_aenst TO i_aenst.

LOOP AT I_AENST INTO WA_AENST.

ls_valueset-value = 'key1'.

ls_valueset-text = WA_AENST.

append ls_valueset to lt_valueset.

ENDLOOP.

lr_nodeinfo->set_attribute_value_set(

exporting

name = 'AENST'

value_set = lt_valueset

).

i am unable to store the second value of the dropdown key element even though i am selecting that the first value only getting updated. so please say me the solution to work with this.

and the other thing is i am using the same dropdown key element in the change of the no. transaction also.

regards

ibrahim

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi Ibrahim,

See your code here:

LOOP AT I_AENST INTO WA_AENST.

ls_valueset-value = 'key1'.

ls_valueset-text = WA_AENST.

append ls_valueset to lt_valueset.

ENDLOOP.

In the loop, for both elements, you are setting the 'value' as key1 only. So no matter which one is selected, you will get only 'key1' as the selected value. Instead use a counter or something and populate the value set.

Regards

Nithya

Former Member
0 Kudos

it is working with my knowledge