on 05-24-2011 10:32 AM
Hi ,
I need to create a Dropdown list with two seprate values. The first value would be number and second value will be string. For example:
Values in Drop down: 00 Right Part object
01 Left part object
88 Ring structure.....
And so one, I have atleast 30 values. The issue is, what customer wants is, when user select some epecific row, only the number should be displayed not the string. So If use selects the last value in this example, only 88 should be visible.
But I am not sure, whether its possible in WDA drop down fucntionality?
Regards
PG
Hi PG ,
To set value in dropdown you can follow the below code:-
DATA: LT_SECTIONS TYPE STANDARD TABLE OF WDR_CONTEXT_ATTR_VALUE,
LS_SECTIONS TYPE WDR_CONTEXT_ATTR_VALUE.
DATA: LR_NODE_INFO TYPE REF TO IF_WD_CONTEXT_NODE_INFO,
LR_NODE TYPE REF TO IF_WD_CONTEXT_NODE.
LOOP AT IT_TABLE_NAME INTO WA_TABLE_NAME. " the table from which you are get the values to be set
LS_SECTIONS-VALUE = WA_TABLE_NAME-VALUE.
LS_SECTIONS-TEXT = 'Text to display'.
APPEND LS_VALUE TO LT_VALUE.
ENDLOOP.
LR_NODE = WD_CONTEXT->GET_CHILD_NODE( ' name of context node ').
LR_NODE_INFO = LR_NODE->GET_NODE_INFO( ).
LR_NODE_INFO->SET_ATTRIBUTE_VALUE_SET(
EXPORTING
NAME = 'ATTRIBUTE_NAME' "attribute name
VALUE_SET = LT_SECTIONS ).
Now in you can set values in LT_VALUE out side of the loop also. So if you are aware of the values to be display for user just set the text as per user choice . Whatever text you will set that will be displayed for the user where as the value can be different for in your program.
Regards,
Monishankar C
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Have you considered ItemListBox UI element ?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi PG,
You can concatenate value and text. And then you can access value from the context. Here is some example code:
data: node_params type ref to if_wd_context_node_info,
lt_valueset type table of wdr_context_attr_value,
ls_valueset type wdr_context_attr_value.
node_params = wd_context->get_node_info( ).
node_params = node_params->get_child_node( 'PARAMS' ).
loop at lt_detail into ls_detil.
ls_valueset-value = ls_detail-dhkod.
ls_valueset-text = ls_detail-dhktx.
append ls_valueset to lt_valueset.
endloop.
node_params->set_attribute_value_set( name = 'DETAIL' value_set = lt_valueset ).
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 | |
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.