cancel
Showing results for 
Search instead for 
Did you mean: 

Drop Down by Key

nishantbansal91
Active Contributor
0 Kudos

Hi,


I have one question regarding Drop down by key.

By default when the Drop down by key is in disable mode it is displaying Domain Value not Short Description.

How we can enable to display Short description in Drop down by key.

Accepted Solutions (1)

Accepted Solutions (1)

ramakrishnappa
Active Contributor
0 Kudos

Hi Nishant,

Are you disabling the drop down by key field ?... what is your requirement. Instead , you can set it as READ ONLY, so that it works normal.

Regards,

Rama

Answers (3)

Answers (3)

former_member197475
Active Contributor
0 Kudos

Hello Nishant,

Have you tried using wdr_context_attr_value???    

You can use the  below sample code and can set the description.

  data: lr_node_info type ref to if_wd_context_node_info,

        wa_value_set type wdr_context_attr_value,

        lt_value_set type table of wdr_context_attr_value.

  lr_node = wd_context->get_child_node( name = 'NODE' ).

  lr_node_info = lr_node->get_node_info( ).

  wa_value_set-value = 'IN'.

  wa_value_set-text  = 'INDIA'.

  insert wa_value_set into table lt_value_set.

  wa_value_set-value = 'PH'.

  wa_value_set-text  = 'PHILIPPINES'.

  insert wa_value_set into table lt_value_set.

  lr_node_info->set_attribute_value_set( name      = 'TEMP'

                                         value_set = lt_value_set ).

BR,

RAM.

nishantbansal91
Active Contributor
0 Kudos

Hi Guys,

It was very simple but sometimes we forgot how to implement it, i just take a dropdown field and make read only property active,


Thanks for your valuable help..

Regards,

Nishant

Former Member
0 Kudos

Well, if I have understood your requirement correctly, when a DDK is enabled, you can get text (or key & text in drodpwn which you can select) but when it's read only or disabled for some reason (after some sleection is made and some event on page), the DDK changes to 'Key' and not 'Value'.

I guess, this is the standard behavior and could not be changed. But a workaround can be implemented easily if it's a custom application. How about using a text view adjacent to DDK and setting it's visibility in a way that whenever the DDK is disabled, the textview with selected text would be enabled. For this, you may have to write some extra code to read selected key value and display text while playing around with visibility. But this should work good.

Cheers,

VS

shadab_maldar
Active Participant
0 Kudos

Hi Nishant,

Choose List Box in attributes of drop down.

Regards,

Shadab.