on 08-21-2008 10:51 AM
hi,
i am working with dropdowns embbeded in a table.what i want to do is to display the data ,which is selected by user ( from this dropdown) into a text element. i have only one row of tabel and i have tried by reading the context and lead selection and setting the attribue of the that text element using value i got from attribute of my drop down but i am getting run time error and final objective is to save data selected by user into a database tabe, please guide me step by step in this regard.
thanks in advance.
basically i am working with drop down by key and i want to show the value selected by user, using
another ui element( i.e text view) through action of a button, please tell me some sample code which is simple. i have values in drop don i just want to show the selected one.
thank you
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hiu2026
Here INDEX have the value what you have selected. You have to write this code at on action select event method of the dropdown.
DATA index TYPE string.
index = wdevent->get_string( 'INDEX' ).
Here index will contain the index which selected by user. Now find the value for the corresponding index. Now bind this value to the context of your textview. You ll automatically get it displayed to the textview.
Thanks
Satra
"i have values in drop don i just want to show the selected one."
it depends on how you created the dropdown.
is it created with an internal table as value list, or with a childnode as value list.
internal table:
simply add a textView element and bind it to the same attribute as the dropdown.
it might be necessary to create an action on the select of the dropdown element to trigger the update (don't know by heart if it's required though, just test)
childnode as value list:
create an action on the select event of the dropdown element
in the handler, get_lead_selection of your child context node.
get the value of this selected element.
put it in the attribute of the parent element (your actual table node)
show that attribute somewhere with an extra ui element.
I think, you are already getting the dropdown, so the problem is in time of selection you get an runtime error. I am putting some pic of code to help you out. Just follow the code and try to implement in your component..
Please let me know if you need any help.
METHOD onactionfilter_vendor .
DATA index TYPE string.
DATA lo_nd_source_of_supply TYPE REF TO if_wd_context_node.
DATA lt_sos TYPE wd_this->elements_source_of_supply.
DATA ls_sos TYPE wd_this->element_source_of_supply.
DATA lv_all TYPE flag.
DATA lv_gesbu TYPE gesbu.
index = wdevent->get_string( 'INDEX' ).
MOVE index TO wd_comp_controller->my_filter_index.
CLEAR lv_all.
CASE index.
WHEN cl_mmpur_ui_cppr=>c_index_1.
lv_all = abap_true.
WHEN cl_mmpur_ui_cppr=>c_index_2.
lv_gesbu = cl_mmpur_ui_cppr=>c_eval_score_40.
WHEN cl_mmpur_ui_cppr=>c_index_3.
lv_gesbu = cl_mmpur_ui_cppr=>c_eval_score_50.
WHEN cl_mmpur_ui_cppr=>c_index_4.
lv_gesbu = cl_mmpur_ui_cppr=>c_eval_score_60.
WHEN cl_mmpur_ui_cppr=>c_index_5.
lv_gesbu = cl_mmpur_ui_cppr=>c_eval_score_70.
WHEN cl_mmpur_ui_cppr=>c_index_6.
lv_gesbu = cl_mmpur_ui_cppr=>c_eval_score_80.
WHEN cl_mmpur_ui_cppr=>c_index_7.
lv_gesbu = cl_mmpur_ui_cppr=>c_eval_score_90.
ENDCASE.
IF lv_all IS INITIAL.
LOOP AT wd_comp_controller->myt_sos INTO ls_sos WHERE gesbu > lv_gesbu.
APPEND ls_sos TO lt_sos.
ENDLOOP.
ELSE.
lt_sos = wd_comp_controller->myt_sos.
ENDIF.
lo_nd_source_of_supply = wd_context->get_child_node( name = wd_this->wdctx_source_of_supply ).
lo_nd_source_of_supply->bind_table( lt_sos ).
ENDMETHOD.
Reards
Satrajit.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
go to ST22 and paste the runtime error also paste your code
Abhi
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
10 | |
10 | |
9 | |
7 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.