on 11-26-2009 4:47 AM
Hi experts,
I need to get the default value in my drop down. i am using drop down by key. I am using the below code to populate the drop down.
DATA : node_info TYPE REF TO if_wd_context_node_info.
DATA : value TYPE wdr_context_attr_value,
value_set TYPE TABLE OF wdr_context_attr_value.
node_info = wd_context->get_node_info( ).
node_info = node_info->get_child_node( 'VE_MASTER_DATA' ).
value-value = 'IN'.
value-text = 'India'.
INSERT value INTO TABLE value_set.
value-value = 'US'.
value-text = 'USA'.
INSERT value INTO TABLE value_set.
value-value = 'O'.
value-text = 'Others'.
INSERT value INTO TABLE value_set.
node_info->set_attribute_value_set(
name = `COUNTRY`
value_set = value_set ).
I am requirement here is i want to make India as the default value in the drop down when the page is loaded.
Regards,
Vinod
hi,
You can directly set the attribute using Code wizard.
Code for your reference :
DATA lo_nd_cn_sflight TYPE REF TO if_wd_context_node.
DATA lo_el_cn_sflight TYPE REF TO if_wd_context_element.
DATA ls_cn_sflight TYPE wd_this->element_cn_sflight.
DATA lv_carrid LIKE ls_cn_sflight-carrid.
* navigate from <CONTEXT> to <CN_SFLIGHT> via lead selection
lo_nd_cn_sflight = wd_context->get_child_node( name = wd_this->wdctx_cn_sflight ).
* get element via lead selection
lo_el_cn_sflight = lo_nd_cn_sflight->get_element( ).
* get single attribute
lo_el_cn_sflight->set_attribute(
name = `ATTribute name.`
value = 'IN' ).
Set the attribute with the key .
It should work
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
This message was moderated.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
90 | |
10 | |
10 | |
10 | |
7 | |
7 | |
6 | |
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.