03-14-2007 10:44 AM
Hi experts ,
i want to create a drop down list by key, i don't know how to assign values to it ( i.e. add list entries ) . Please help me on this ..
With regards ,
James..
Valuable answers will be rewarded ....
03-14-2007 10:48 AM
Hello,
MODULE INIT_LISTBOX OUTPUT.
TYPE-POOLS VRM.
DATA: NAME TYPE VRM_ID,
LIST TYPE VRM_VALUES,
VALUE LIKE LINE OF LIST.
CLEAR: VALUE,LIST.
REFRESH: LIST.
NAME = 'IT_TC01-NOTE'.
VALUE-KEY = '1'.
VALUE-TEXT = 'sehr gut'.
APPEND VALUE TO LIST.
VALUE-KEY = '2'.
VALUE-TEXT = 'gut'.
APPEND VALUE TO LIST.
VALUE-KEY = '3'.
VALUE-TEXT = 'befriedigend'.
APPEND VALUE TO LIST.
VALUE-KEY = '4'.
VALUE-TEXT = 'ausreichend'.
APPEND VALUE TO LIST.
VALUE-KEY = '5'.
VALUE-TEXT = 'mangelhaft'.
APPEND VALUE TO LIST.
CALL FUNCTION 'VRM_SET_VALUES'
EXPORTING
ID = NAME
VALUES = LIST.
Regards,
Vasanth
03-14-2007 10:48 AM
Hi,
If you are talking about getting F4 Values,
then move all the possible values to a table along with that field, and create an elementary search help for that field and use that search help for that field.
Regards,
Anji
03-15-2007 9:58 AM
Hi,
To fix values to the drop down key at runtime in the webdynpro application you can use the following code:
DATA:
lr_node_flightinfo TYPE REF TO if_wd_context_node,
lr_nodeinfo_flightinfo TYPE REF TO if_wd_context_node_info,
l_scarr type scarr,
lt_value_set TYPE TABLE OF wdr_context_attr_value,
lw_value_set like line of lt_value_set.
get nodeinfo of node flightinfo
lr_node_flightinfo = wd_context->get_child_node( name = 'FLIGHTINFO' ).
lr_nodeinfo_flightinfo = lr_node_flightinfo->get_node_info( ).
get value set (VALUE = CARRID , TEXT = CARRNAME)
select carrid carrname from scarr into table lt_value_set.
clear lw_value_set.
lw_value_set-value = 'AI'.
lw_value_set-text = 'Air India'.
append lw_value_set to lt_value_set.
sort the value set by the describing TEXT
SORT lt_value_set BY text.
set value to context attribute
lr_nodeinfo_flightinfo->set_attribute_value_set(
name = 'CARRID' value_set = lt_value_set ).
Here CARRID is a drop down by key field on the screen.
in The context it is an attribute in the node FLIGHTINFO.
Please give Reward Points if this piece of code helps
Regards,
Manish