Sample code :
PARAMETERS : p_field TYPE ztype AS LISTBOX VISIBLE LENGTH 25.
* If the ZTYPE has a domain with values, values will be autmatically
* displayed.
If your type has no values in domain or if you want to change the dropdown list values use FM VRM_SET_VALUES in initialization:
FORM initialization .
DATA: lt_dropdown_list TYPE vrm_values.
lt_dropdown_list = VALUE #( ( key = '1' text = 'Value 1' )
( key = '2' text = 'Value 2' )
( key = '3' text = 'Value 3' ) ).
CALL FUNCTION 'VRM_SET_VALUES'
EXPORTING
id = 'P_FIELD'
values = lt_dropdown_list
EXCEPTIONS
id_illegal_name = 1
OTHERS = 2.
ENDFORM.
About the author