cancel
Showing results for 
Search instead for 
Did you mean: 

Need help for displaying key and description in Dropdown (ABAP WEBDYNPRO)

Former Member
0 Kudos

Hi Experts,

I am using dropdown as a table field. For this dropdown I want to display the value as well as description.

In ALV table when we create a dropdown dynamically in table field, there is a method SET_KEY_VISIBLE in class CL_SALV_WD_UIE_DROPDOWN_BY_KEY.

But I think we cannot use similar method for normal dropdown field in table.

Is there any way we can display both value and description in dropdown value set ?

Please help.

Regards,

Anand

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

I think there is no such option. You need to consider one variable type string and while populating the

valueset fill this variable by concatenating the value and description and assign it the key and value

pair of the valueset.

DATA:
  lt_value_set_ctry      type table of wdr_context_attr_value, " Country/Service Location
  lv_str type string.


    loop at lit_country into ls_country.

      concatenate ls_country-value ls_country-text into lv_str separated by space.

      ls_value_set-value = lv_str.
      ls_value_set-text  = lv_str.
      append  ls_value_set to lt_value_set_ctry.
      clear ls_value_set.
    endloop.
      lr_node_info->set_attribute_value_set( name = 'COUNTRY'
                 value_set = lt_value_set_ctry ).

Consider this lit_country is a text table for countries.

Regards,

Lekha.

Answers (0)