cancel
Showing results for 
Search instead for 
Did you mean: 

Dropdown/value help with several values

0 Kudos

Hi, I have tried to read/get information about value help and dropdown lists for the input field element but I havent found information about following:

As I have understood, it´s possible to have several fields in the list using value help whether you can only have one field in the dropdown list?

I would like to have a dropdown list for a field A with both a key field  (will fill input field A) and a text field. Is that possible, where could I find how to do that?

Thank you,

Accepted Solutions (1)

Accepted Solutions (1)

chengalarayulu
Active Contributor
0 Kudos

Hi Lena,

You can do the same what you expect. Follow the below steps.

1. First fill your drop down values.

2. Create an action for DropDown UI element onSelect"ONSELECT"

3. Compare your business query with selected DropDown value, and get the value which you need to set to InputField.

4. Set the InputField value

Hope this would resolve your issue.

0 Kudos

Hi again, I have created a dropdown by index element in my layout.  In the context I have created a sel_typ node (0..n) with the field typ and text. I have bound the dropdown by index element to the sel_typ.typ of the context sel_typ. Then in Do_init I do the following, I fill dropdown list with one row which has two columns (type and text). I bind the table to the context node sel_typ. But the only field I get in my dropdown list is the column type (value =  TEST).  Could you see where I got the error? I would like to show the user both column in the dropdown list.

  Data: lt_typ type STANDARD TABLE OF if_z_avst_form=>element_SEL_TYP,
        ls_typ like line of lt_typ.

* just added a row for test
   ls_typ-typ = 'Typ'.
   ls_typ-text = 'Text'.
   APPEND ls_typ to lt_typ.


  lo_context_node = wd_context->get_child_node( name = 'SEL_TYP').
  lo_context_node->BIND_TABLE( lt_typ ).

Thank you a lot! Regards Lena

chengalarayulu
Active Contributor
0 Kudos

Hi Lena,

There is no such option available in DropDownByIndex/Key.... If you wanna display it..there are two ways..

1. Display columns in a Table and ask the user to select from there..

2. Loop the Internal Table lt_typ and concatenate typ & text into single column awith any Seperator and maintain binding with resultant field.

I hope it would resolve.

Former Member
0 Kudos

Hi Lena

I see what you mean . Unfortunately a dropDown does not show the key and the value, but only

one item. To show both the key and the value you need to use a pop up window to which you

can add a table with two columns - key and value. When the user selects a row, you can

do what ever you wish with both the key and the value. But going  this way is a bit longer.

Anyway you can have a look here.

regards

yuval

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Lena

Let me explain:

DropDownUi is actually a TableMap in disguise: each item contains a key

and a value. What we ususally show the user is the value. The key is used

behind the scene as this is what is later transferred to R3.

So when the user selects an item (value), we intercept the value,

through onSelect action, lookup this value in our TableMap and then

extract the key for this value .

Here is a tutorial that shows you how to do it. 

This method uses nodeInfo to fill up the values in your dropDown.

Hope this helps.

regards

yuval peery