cancel
Showing results for 
Search instead for 
Did you mean: 

Drop down in table

Former Member
0 Kudos

Hi all,

I have a drop-down in a table.......

The values to be filled in it are fetched from a Z-table consisting of two fields.

viz. Id (P.K) and its corresponding description.

I dont want to put a search help since the number of values to be inserted are less,so havepreferred having drop down instead.

My requirements are :-

1.) In drop-down i should see only the description.

2.)Whenever i select any particular value its id should be displayed in my table layout.

(since the description are too lengthy.......i dont want ot display them)

My first requirement is completed wherein i need help on second.

The code i have used to fill in the drop-down programatically is as follows :

  • Data declaration

DATA i_tab TYPE TABLE OF Z_table.

DATA wa_tab TYPE Z_table.

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.

  • Filling values in drop-down

SELECT * FROM Z_table INTO TABLE i_tab.

LOOP AT i_tab INTO wa_tab.

MOVE wa_tab-catid TO wa_value_set-text.

MOVE wa_tab_catdesc TO wa_value_set-value.

APPEND wa_value_set TO value_set.

CLEAR wa_value_set.

ENDLOOP.

  • Setting value in context attribute.

wd_node_info = wd_context->get_node_info( ).

wd_node_info->set_attribute_value_set(

exporting

name = 'DROP_DOWN'

value_set = value_set ).

Any help would be highly appreciated and rewarded.

Thanks in Advance,

Sheetal.

Accepted Solutions (0)

Answers (1)

Answers (1)

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

I'm not sure I understand your requirement. You want a DropDown, but you don't want the description to display once selected? That isn't really the way DropDowns work. They are always going to display the description. Perhaps a better fit would be to use an input field with a value help.

Former Member
0 Kudos

Hi,

Thanks for your reply.

Input field with value help was the first option i had opted for.

but juz wanted to explore if any other way can suffice the requirement.

Newayz,presently have implemented the input field wid value help.