cancel
Showing results for 
Search instead for 
Did you mean: 

populating drop down with search help

Former Member
0 Kudos

I have drop down to populated in WD,but i dont want it to be populated with the field values from ddic,instead iwant the the search help values for this field in the ddic.Say for example i have the Carrid field with values AA,BB and so on in the ddic table and in the search help d description is there like for AA->american airlines and so on .so i dont want to populate my drop down with aa,instead i want american airlines.Please advice.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Abhishek.

When you use DropDownByIndex just create a context node like:

carrid -carrid

desciption -> string

In the supply method or any action handler just fill this context node with

elements you select from a table and bind the description field to the DropDown UI Element attribute Texts.

If the user selects an entry the lead selection is set accordingly and you can

retrives the carrid.

Cheers,

Sascha

Message was edited by:

Sascha Dingeldey

Former Member
0 Kudos

i am using drodownbykey and i am trying to populate the drop down with DDIC search help (dats my Q and problem) and not any coloumn of table.

Former Member
0 Kudos

hi,

what you could do is :

select description

into table des_table

from flight.

then

key = '00'.

loop at des_table into des_line.

ls_value_set-key = key.

ls_value_set-value = des_line-description.

INSERT ls_value_set INTO TABLE lt_value_set.

ADD 1 TO key.

ENDLOOP.

lr_node_info->set_attribute_value_set(

name = 'DESCRIPTION'

value_set = lt_value_set ).

I hope this helps.

Regards

Former Member
0 Kudos

I guess people are not getting the Q correct.I have already populated my drop down,but i want to do it with seach help associated with a column or field of the ddic table .Say i have arrangement_id as my field name in table Pricing in ddic and i wanna populate the DropDown with searh help associated with this filed namely discription.

Former Member
0 Kudos

Hi,

Try to set the property Input help Mode of the UI element (drop-down?) to AUTOMATIC or DICTIONARY SEARCH HELP

regards,

Joris

Former Member
0 Kudos

i have already tried that,it ll not work.It will work only in case of text fields

Former Member
0 Kudos

ok, there is a way to dynamically assign the values when keybinding.

1. get META data object of node

2. build a table whcih holds values to select from

3. yank this tabl ein metadata object of node

In code (expample found elsewhere):

DATA:

ir_node_filghtinfo TYPE REF TO if_wd_context_node,

lr_nodeinfo_flightinfo TYPE REF TO if_wd_context_node_info,

it_value_Bet TYPE TABLE OF wdr_context_attr_value.

  • get nodeinfo of node flightinfo

lr_node_flightinfo = wd_context->get_child_node( name = ‘FLIGHTINFO’ ). lr_nodeinfo_flightinfo = lr_node_fiightinfo-z.get_node_info( ).

get value set (VALUE = CARRID , TEXT = CARRNAME)

CALL METHOD cl_net310_flightmodel=>read_carriers_vs

IMPORTING

e_carrier_vs = lt_value_set.

  • sort the value set by the describing TEXT

SORT it_value_set BY text.

*set value to context attribute

lr_nodeinfo_flightinfo-set_attribute_value_set( name = ‘CARRID’ value_set = it_value_set ).

good luck

Joris

Former Member
0 Kudos

I am too having the same problem. From your reply i still don't get it how r we populating the drop down from a search help. Can you please explain it in some more detail.

Thanks in advance.

Former Member
0 Kudos

you can try this ,

1.after creating the attribute which you wanna populate in the context of your node .

2.Go to do inint method of your view and try using the code below with node and attributes which you need.

method wddoinit .

data: rootnode_info type ref to if_wd_context_node_info,

rootnode_info1 type ref to if_wd_context_node_info,

it_value_bet type table of wdr_context_attr_value.

" node_arrid type ref to if_wd_context_node_info.

rootnode_info = wd_context->get_node_info( ).

" ADD A CHILD NODE TO THE ROOT.

call method rootnode_info->get_child_node

exporting

name = 'ARRANGEMENT_ID'

receiving

child_node = rootnode_info1.

data: lt_valueset type wdr_context_attr_value_list ,

l_value type wdr_context_attr_value.

" fill up internal table from table***********************

data : itab_pa_id type standard table of /sappssrm/pa_idt,

wa_sappssrm_pa_id like line of itab_pa_id.

select * from /sappssrm/pa_idt into table itab_pa_id.

loop at itab_pa_id into wa_sappssrm_pa_id.

l_value-value = wa_sappssrm_pa_id-arrangement_id.

l_value-text = wa_sappssrm_pa_id-description.

insert l_value into table lt_valueset.

endloop.

"*********************************

I guess this should help .

Regards,

Abhishek

Answers (1)

Answers (1)

Former Member
0 Kudos

i got a field in of the tables which i used to populate the DD