on 01-04-2011 10:12 AM
Hi at all,
I can create a drop down based on a key field in a context node.
How can I create a drop down field based on a key field and additional the text corresponding to the key?
I have a context node with cardinality 0...n containing the key field and a describing text field.
The key fields are shown at activating the drop down button, but not the describing text.
Thx for all answers.
Dirk
Hi,
you can use Drop Down by Index in your case to get the text in the list box.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
thanks for your very quick answer.
I can bind the property "Texts" to the context field containing the description but this shows only the description in the list and the selected value.
I want to see the key and description in table form in the list and only the key should be displayed as selected value.
Thanks for answers.
Dirk
>
> Hi,
>
> thanks for your very quick answer.
>
> I can bind the property "Texts" to the context field containing the description but this shows only the description in the list and the selected value.
>
> I want to see the key and description in table form in the list and only the key should be displayed as selected value.
>
> Thanks for answers.
>
>
> Dirk
Hi,
i think then the possible solution would be value help. I am afraid that you cannot have the two columns in your DDBK or DDBI.
Nearly perfect Sarbjeet,
I implemented the coding like this:
DATA: lo_nd_dropdown_fakiv TYPE REF TO if_wd_context_node,
lo_el_dropdown_fakiv TYPE REF TO if_wd_context_element,
lt_dropdown_fakiv TYPE TABLE OF wd_this->element_dropdown_fakiv,
ls_dropdown_fakiv LIKE LINE OF lt_dropdown_fakiv.
DATA: lo_nd_dealer TYPE REF TO if_wd_context_node,
lt_valueset TYPE TABLE OF wdr_context_attr_value,
ls_valueset TYPE wdr_context_attr_value,
lr_node_info TYPE REF TO if_wd_context_node_info.
lo_nd_dropdown_fakiv = wd_context->get_child_node( name = wd_this->wdctx_dropdown_fakiv ).
SELECT domvalue_l ddtext
FROM dd07t
INTO TABLE lt_dropdown_fakiv
WHERE domname = '/GICOM/FAKIV'
AND ddlanguage = sy-langu.
IF sy-subrc = 0.
lo_nd_dropdown_fakiv->bind_table(
EXPORTING
new_items = lt_dropdown_fakiv
).
ENDIF.
lo_nd_dealer = wd_context->get_child_node( name = wd_this->wdctx_dropdown_fakiv ).
lr_node_info = lo_nd_dealer->get_node_info( ).
LOOP AT lt_dropdown_fakiv INTO ls_dropdown_fakiv.
ls_valueset-value = ls_dropdown_fakiv-domvalue_l.
CONCATENATE ls_dropdown_fakiv-domvalue_l ls_dropdown_fakiv-ddtext INTO ls_valueset-text SEPARATED BY space.
APPEND ls_valueset TO lt_valueset.
ENDLOOP.
lr_node_info->set_attribute_value_set(
EXPORTING
name = 'DOMVALUE_L'
value_set = lt_valueset
).
When I start the application the list of the drop down shows "key + value" but when I choose an entry "key + value" is selected. Is it possible to display only the key as the choosen entry?
I am not getting the requirement here,
Are you saying you will select something in the dropdown and dynamically at the runtime that entry should change its
displayed form to key only..
means we have dropwon as A alpha
B Beta
C gamma
Now if you select B beta in the dropdown then it should change to B menas then dropdown will be like
A Alpha
B <<<<------ Selected
C Gamma
is it this what you are asking.
It is quite a task to achieve ........
for this i think you have to use dropdown by index.
there do one thing
your node will have text and value attribute separte ..
then iterate throught the elements of the node and change the values of text to text + value
and then change the value of text attribute to text = value for the current element on the onselect action event handler of the
dropdown by index.
Thanks
Sarbjeet
in that case you can use value set..
loop at the context node for all the element of the desired node and create a valueset for one attribute which you can use in
dropdown by key for the property selected key.
there in teh key wirte the simple key and for text write key + text.
DATA lo_nd_dealer TYPE REF TO if_wd_context_node.
lo_nd_dealer = wd_context->get_child_node( name = wd_this->wdctx_dealer ).
Data : lt_valueset type table of wdr_context_attr_value,
ls_valueset type wdr_context_attr_value,
lr_node_info type ref to if_wd_context_node_info,
wa_dealr type zdealer.
lr_node_info = lo_nd_dealer->get_node_info( ).
Do 5 times. "here you can itereate for fetching all the elemets of the node
ls_valueset-value = sy-index. " and set the value of key and text
ls_valueset-text = sy-index.
append ls_valueset to lt_valueset.
enddo.
lr_node_info->set_attribute_value_set(
name = 'NAME'
value_set = lt_valueset ).
Thanks
Sarbjeet
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
82 | |
10 | |
10 | |
9 | |
6 | |
6 | |
5 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.