cancel
Showing results for 
Search instead for 
Did you mean: 

Problem with web dynpro Dropdownbykey

0 Kudos

Hello everyone,

I`m trying to create a Dropdownbykey in a webdynpro screen. For that i've created a data element and a domain with a list of values.

When I bind the data element with my Dropdownbykey, just the first value appears on list and i can't switch between values.

I don't know why it's happening. I already compared with other DropDowns in my system, but i couldn't identify the problem. Someone have an idea how to solve this? 

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

Have you tried the below code?.


DATA lo_nd_<node>                      TYPE REF TO if_wd_context_node.
DATA lo_nd_<node>_info               TYPE REF TO if_wd_context_node_info.
DATA lt_value_set                           TYPE wdr_context_attr_value_list.
DATA lw_entry                                TYPE wdr_context_attr_value.
DATA lt_taba                                   TYPE STANDARD TABLE OF dd07v.
DATA lt_tabb                                  TYPE STANDARD TABLE OF dd07v.
DATA lw_tabb                                 TYPE dd07v.


lo_nd_<node>_info  = lo_nd_<node>->get_node_info(  ).

*--->GET DOMAIN VALUES
        CALL FUNCTION 'DD_DOMA_GET'
          EXPORTING
            domain_name   = <DOMAIN_NAME>
            langu         = sy-langu
            withtext      = 'X'
          TABLES
            dd07v_tab_a   = lt_taba
            dd07v_tab_n   = lt_tabb
          EXCEPTIONS
            illegal_value     = 1
            op_failure        = 2
            OTHERS        = 3.

IF SY-SUBRC IS INITIAL.
LOOP AT lt_tabb INTO lw_tabb .
          lw_entry-text   = lw_tabb-ddtext.
          lw_entry-value = lw_tabb-domvalue_l.
          APPEND lw_entry TO lt_value_set.
          CLEAR:  lw_entry,lw_tabb.
ENDLOOP.


lo_nd_<node>_info->set_attribute_value_set(
          EXPORTING
            name      = '<ATTRIBUTE_NAME'   " Web Dynpro: Name of Context Element
            value_set =   lt_value_set ).                     " All Fixed Values of an Attribute with Texts

REFRESH  lt_value_set.
ENDIF.

It might help you.

Thanks

KH

Answers (5)

Answers (5)

0 Kudos

Hi, everyone

Thank you for help. I found were was the problem. The node that was bound with DropDownByIndex element was created in Context of View instead of Controller Context.

Former Member
0 Kudos

Did you say the Read Only property is enabled ? Can you post screenshots of your screen and the context binding ?

Gowtham
Contributor
0 Kudos

Hi Hevanderson,

Kindly check the following points

  • Cardinality of the node is correct
  • Read only property of the field is enabled
  • Enable property of the field is enabled
  • Correct Attribute-Data element is binded with DDBK UI element.

- Gowtham

Former Member
0 Kudos

I suggest you to check the cardinality of the node once.

0 Kudos

Hi Katrice.

     Thank you for help. I tried to do this but I've got the same result.