on 04-16-2008 5:40 AM
HI
Can any body help me to use dropdown control in table and also setting the default value for the drop down.
DATA: lx_current_controller TYPE REF TO if_wd_controller,
lx_node TYPE REF TO if_wd_context_node_info,
lx_element TYPE REF TO if_wd_context_element,
ls_value TYPE wdy_key_value,
lt_value_set TYPE wdy_key_value_table.
DATA node2 TYPE REF TO if_wd_context_node.
lx_current_controller = wd_this->wd_get_api( ).
CLEAR ls_value.
ls_value-key = '1'.
ls_value-value = 'H'.
INSERT ls_value INTO lt_value_set[] INDEX 1.
ls_value-key = '2'.
ls_value-value = 'P'.
INSERT ls_value INTO lt_value_set[] INDEX 2.
ls_value-key = '3'.
ls_value-value = 'S'.
INSERT ls_value INTO lt_value_set[] INDEX 3.
This is the code which I am using right now and here I am not using any aditional node,
If I converted the dropdown type in to DropDownByIndex then the additonal node is required, I have given it one node inside another, the parent node is assigned as datasource for Table
But the selected value cannot be taken back
The code used is
node_tb = wd_context->get_child_node( name = wd_this->wdctx_tb ).
node_nn = node_tb->get_child_node( name = wd_this->wdctx_nn ).
The first statement is working fine but the second statement gives an error,
node nn is inside node tb
Pls help
If there is a context named 'AUTHORISATIONS'with attribute'AUTHORISATIONS'
then write the following code in wddoinit().
Data Declarations for dropdown...................................................
DATA: lo_nd_authorizations_info TYPE REF TO if_wd_context_node_info,
lt_dbtag_set TYPE wdy_key_value_table,
dbtag_key_item TYPE wdy_key_value,
lo_nd_authorizations TYPE REF TO if_wd_context_node.
***********************************************************************************
Step1 - Initialize the values for the dropdown menus in authorization column.
***********************************************************************************
lo_nd_authorizations = wd_context->get_child_node( name = wd_this->wdctx_authorizations ).
dbtag_key_item-key = /plmu/if_ugrp_c=>gc_act_adm.
dbtag_key_item-value = /plmu/if_ugrp_c=>gc_drpdn_adm.
INSERT dbtag_key_item INTO TABLE lt_dbtag_set.
dbtag_key_item-key = /plmu/if_ugrp_c=>gc_act_upd.
dbtag_key_item-value = /plmu/if_ugrp_c=>gc_drpdn_upd.
INSERT dbtag_key_item INTO TABLE lt_dbtag_set.
dbtag_key_item-key = /plmu/if_ugrp_c=>gc_act_rea.
dbtag_key_item-value = /plmu/if_ugrp_c=>gc_drpdn_rea.
INSERT dbtag_key_item INTO TABLE lt_dbtag_set.
dbtag_key_item-key = /plmu/if_ugrp_c=>gc_act_non.
dbtag_key_item-value = /plmu/if_ugrp_c=>gc_drpdn_non.
INSERT dbtag_key_item INTO TABLE lt_dbtag_set.
lo_nd_authorizations_info = lo_nd_authorizations->get_node_info( ).
lo_nd_authorizations_info->set_attribute_value_set( name = 'AUTHORISATIONS' value_set = lt_dbtag_set )
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
So now you have one subnode for drop down. using supply function or Bind_table method pass the required data to that sub node.
Then Bind the Drop down box with the particular attribute from your Sub node.
If the sub node has the data means surely it will displayed in the Drop down list box.
Thanks.
Hi,
So you filled your drop down with Data's. Now the problem is You need the seleced data from the list box. Is it so?
Then you have to write the coding at OnSelect Event. In that event handler, Using code wizard read the Attribute which supplies the data's to your drop down.
For Example, You have One subnode and its structure is Sflight. Now you binded your dropdown with CARRID attribute menas, The selected value is now stored in the same CARRID.
Thanks.
Hi,
Did you used Supply function for your nodes?
For Dropdown with in a table best advice is Use a separate node with supply function.
Thanks.
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 | |
10 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.