on 03-08-2011 2:08 AM
Hi iam Ravi,
I am new to web dynpro bap.i want to make input field with default value with drop down list values.how to achieve that.in input fied there is no default value.pls help me
Hi Folks,
This site is very helpful who want to learn SAP.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi Ravi,
what I understood is you have a inputfield and which is having a drop down and you want the default one right.
then
create local data variable to access context information
Data: context_node type ref to if_wd_context_node.
DATA: index type i.
context_node = wd_context->get_child_node( name = 'DROPDOWN_CITY').
Set displayed value of dropdown by index UI element.
index = 3. "sets dropdown value to the third entry in the drop down table
context_node->set_lead_selection_index( index = index ).
REGARDS,
Devi
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Basing on some condition we can set the default value with lead selection index.
If your application is using many end users means we cant set default value for each user in that case you create a custom table and maintain the configurtion data basing on this z custom table we can set the lead selection and whenever user wants to change the default value index from 1 to 9 simply we can change inthe custom table data and then our application decides from this table which value should be default.
Regards,
Devi
Hi Ravi,
For initialize default value, you have to set value in WDINIT method as told by other.
now for your other requirent do one thing
Create action in dropdown on select.
now in action you do get_attribute of that field and do set_attribute
METHOD onactionquest_change .
DATA: lv_zzquest_typ TYPE wd_this->element_attribute_list-zzquest_typ,
lo_nd_attribute_list TYPE REF TO if_wd_context_node,
lo_el_attribute_list TYPE REF TO if_wd_context_element.
lo_nd_attribute_list = lo_el_comp_context->get_child_node( name = wd_this->wdctx_attribute_list ).
lo_el_attribute_list = lo_nd_attribute_list->get_element( ).
* get single attribute
lo_el_attribute_list ->get_attribute( EXPORTING name = `ZZQUEST_TYP` IMPORTING value = lv_zzquest_typ ).
* set single attribute
lo_el_attribute_list ->set_attribute( name = `ZZQUEST_TYP` value = lv_zzquest_typ ).
endmethod.
Thanks & Regards
Prashant Gupta
Create a domain in your DDIC and create your domain values there. Create a data element from this domain. In your webdynpro context , create a attribute of type the dataelement you created above.
This will work.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank for all of you.For providing valuable solutions
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
In my WD application thers is country filed.For this field we assign dictionary structure country names table.when ever we run this application for this country field we can set 'IN 'as default value and if you want to modify we can modify to any other country name
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Ravi,
In dropdown there are many values, which value you want in input field?
What is your exact requirement, please explain..
Cheers,
Kris.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Ravi,
So you want to set defalut value always IN... right.
Goto WDDOINIT METHOD.
For example.. i am taking one attribute TEXT and setting with defalut value 'IN'. u can change accordingly..
DATA lo_el_context TYPE REF TO if_wd_context_element.
DATA ls_context TYPE wd_this->Element_context.
DATA lv_text TYPE wd_this->Element_context-text.
get element via lead selection
lo_el_context = wd_context->get_element( ).
lv_text = 'IN'.
set single attribute
lo_el_context->set_attribute(
name = `TEXT`
value = lv_text ).
Cheers,
Kris.
You can create a dropdown and then fill the dropdown with all the required values.
then set the attribute to the default value.
for filling the dropdown yu can fetch the values from the databse table or create you own entries.
fill it in the valueset for dropdownbykey or fill it in node as elements for dropdownby index.
then set the default value.
thanks
sarbjeet singh
sorry...answer to the other question.
Edited by: Aditya Karanth on Mar 8, 2011 4:54 AM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
86 | |
10 | |
10 | |
10 | |
7 | |
6 | |
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.