cancel
Showing results for 
Search instead for 
Did you mean: 

Is is poosible to have drop down list displaying Key and Text at same time

Former Member
0 Kudos

In my web dynpro component I have created a drop down value list for a particular field based on a check table in the data dictionary. Is there a way to have the key value and description both displayed in the drop down list at the same time?

For example, the field has valid values of

AA American Airlines

AB Air Berlin

AC Air Canada

etc....

But when I click on the drop list I only see

American Airlines

Air Berlin

Air Canada

etc...

The business users have asked to see the list display both values, not just the decription.

Is this possible? If so, how?

Thanks,

Accepted Solutions (1)

Accepted Solutions (1)

former_member186750
Contributor
0 Kudos

Brad,

Unfortunately you have to build this yourself. So when you are populating the drop down list you'll need to concatenate the Key and Description into the description field.

Cheers,

Neil.

ChrisPaine
Active Contributor
0 Kudos

Unfortunately you have to build this yourself. So when you are populating the drop down list you'll need to concatenate the Key and Description into the description field.

which means either populating the value list held against the attribute info (if you are using a dropdown by key) or building a node to store the list (if using dropdown by list).

Chris

Answers (2)

Answers (2)

Former Member
0 Kudos

Thanks for the feedback.

vishesh_malik
Participant
0 Kudos

Hi,

May be this will help you. U can also use an internal table to fetch the values from respective table then use loop to populate the list from internal table

DATA lo_nd_abcdTYPE REF TO if_wd_context_node.

DATA NODE_abcd TYPE REF TO if_wd_context_node_info.

DATA ls_abcd TYPE wd_this->element_bkpf.

DATA wd_node_info TYPE REF TO if_wd_context_node_info.

DATA value_set TYPE wdr_context_attr_value_list.

DATA wa_value_set TYPE wdr_context_attr_value.

DATA lv_text TYPE String.

lo_nd_abcd= wd_Context->get_child_node( Name = IG_COMPONENTCONTROLLER=>wdctx_abcd ).

NODE_abcd = lo_nd_abcd->get_node_info( ).

*LOOP AT itab INTO wa_tab.

  • CONCATENATE wa_tab-element ' your text' INTO lv_text.

  • wa_value_set-value = wa_tab-element.

  • wa_value_set-text = lv_text.

*insert wa_value_set into table value_set.

*endloop.

wa_value_set-value = '1234'.

CONCATENATE wa_value_set-value 'your text ' INTO lv_text.

wa_value_set-text = lv_text

insert wa_value_set into table value_set.

wa_value_set-value = '12'.

CONCATENATE wa_value_set-value 'your text ' INTO lv_text.

wa_value_set-text = lv_text.

insert wa_value_set into table value_set.

wa_value_set-value = '34'.

CONCATENATE wa_value_set-value 'your text ' INTO lv_text.

wa_value_set-text = lv_text.

insert wa_value_set into table value_set.

NODE_abcd->set_attribute_value_set( name = ELEMENT value_set = value_set ).

Vishesh