‎2008 Feb 11 2:13 PM
Hi,
Can any one tell me
How to Create a Parameter as List Box on Selection Screen???
Thx,
Shashi
‎2008 Feb 11 2:59 PM
hi ,
try this
PARAMETERS:
listbox(1) AS LISTBOX VISIBLE LENGTH 10 DEFAULT 'N'.
AT SELECTION-SCREEN OUTPUT.
DATA:
name TYPE vrm_id,
list TYPE vrm_values,
value TYPE vrm_value.
name = 'LISTBOX'. " Name should be in UPPER CASE
value-key = '1'.
value-text = 'Text 1'.
APPEND value TO list.
value-key = '2'.
value-text = 'Text 2'.
APPEND value TO list.
CALL FUNCTION 'VRM_SET_VALUES'
EXPORTING
id = name
values = list
EXCEPTIONS
id_illegal_name = 0
OTHERS = 0.
<REMOVED BY MODERATOR>
Gaurav J.
Edited by: Alvaro Tejada Galindo on Aug 15, 2008 3:34 PM
‎2008 Feb 11 2:24 PM
Hi,
Check the following code:
REPORT ZLIST.
TYPE-POOLS: VRM.
DATA: NAME TYPE VRM_ID,
LIST TYPE VRM_VALUES,
VALUE LIKE LINE OF LIST.
PARAMETERS: PS_PARM(10) AS LISTBOX VISIBLE LENGTH 10.
AT SELECTION-SCREEN OUTPUT.
NAME = 'PS_PARM'.
VALUE-KEY = '1'.
VALUE-TEXT = 'LINE 1'.
APPEND VALUE TO LIST. VALUE-KEY = '2'.
VALUE-TEXT = 'LINE 2'.
APPEND VALUE TO LIST.
CALL FUNCTION 'VRM_SET_VALUES' EXPORTING ID = NAME VALUES = LIST.
START-OF-SELECTION.
WRITE: / 'PARAMETER:', PS_PARM.
Regards,
Bhaskar
‎2008 Feb 11 2:27 PM
PARAMETERS:
listbox(1) AS LISTBOX VISIBLE LENGTH 10 DEFAULT 'N'.
AT SELECTION-SCREEN OUTPUT.
DATA:
name TYPE vrm_id,
list TYPE vrm_values,
value TYPE vrm_value.
name = 'LISTBOX'. " Name should be in UPPER CASE
value-key = '1'.
value-text = 'Text 1'.
APPEND value TO list.
value-key = '2'.
value-text = 'Text 2'.
APPEND value TO list.
CALL FUNCTION 'VRM_SET_VALUES'
EXPORTING
id = name
values = list
EXCEPTIONS
id_illegal_name = 0
OTHERS = 0.
‎2008 Feb 11 2:59 PM
hi ,
try this
PARAMETERS:
listbox(1) AS LISTBOX VISIBLE LENGTH 10 DEFAULT 'N'.
AT SELECTION-SCREEN OUTPUT.
DATA:
name TYPE vrm_id,
list TYPE vrm_values,
value TYPE vrm_value.
name = 'LISTBOX'. " Name should be in UPPER CASE
value-key = '1'.
value-text = 'Text 1'.
APPEND value TO list.
value-key = '2'.
value-text = 'Text 2'.
APPEND value TO list.
CALL FUNCTION 'VRM_SET_VALUES'
EXPORTING
id = name
values = list
EXCEPTIONS
id_illegal_name = 0
OTHERS = 0.
<REMOVED BY MODERATOR>
Gaurav J.
Edited by: Alvaro Tejada Galindo on Aug 15, 2008 3:34 PM
‎2008 Feb 11 3:04 PM
Hi,
PARAMETERS p TYPE spfli-carrid AS LISTBOX VISIBLE LENGTH 20.
Please look at the documentation below from ABAPDOCU.
... AS LISTBOX
Effect
Generates a dropdown list box for the parameter p input field on the selection screen. If the parameter is created with a data type from the ABAP Dictionary and the data type is linked with an input help from the ABAP Dictionary, the system displays the first input help column in the list box.
Note
You must always specify the VISIBLE LENGTH addition with the AS LISTBOX addition, to define a suitable list box width for the input help.
Example
PARAMETERS p TYPE spfli-carrid AS LISTBOX VISIBLE LENGTH 20.
Addition 23
... USER-COMMAND ucom
Effect
This addition is only supported for parameters that are defined as checkboxes or radio buttons. In this case, clicking the parameter triggers the user command ucom, similarly to SELECTION-SCREEN PUSHBUTTON.
Notes
Since all parameters of a radio button group have the same user command, you can only use this addition with the first parameter in the group. The user command is then triggered when you click any button in the group.
If the parameter does not have the RADIOBUTTON GROUP or AS CHECKBOX addition, it must have type Character and length 1. It is then displayed as a checkbox.
‎2008 Feb 11 3:15 PM
Hi,
Use the belwo code
TYPE-POOLS : vrm. "Value Request Manager
PARAMETERS: p_test AS LISTBOX VISIBLE LENGTH 12 OBLIGATORY.
INITIALIZATION.
PERFORM f4_value_request.
START-OF-SELECTION.
WRITE P_TEST.
&----
*& Form f4_value_request
&----
text
----
FORM f4_value_request.
DATA: l_name TYPE vrm_id,
li_list TYPE vrm_values,
l_value LIKE LINE OF li_list.
l_value-key = '1'.
l_value-text = 'January'.
APPEND l_value TO li_list.
CLEAR l_value.
l_value-key = '2'.
l_value-text = 'February'.
APPEND l_value TO li_list.
CLEAR l_value.
l_value-key = '3'.
l_value-text = 'March'.
APPEND l_value TO li_list.
CLEAR l_value.
l_value-key = '4'.
l_value-text = 'April'.
APPEND l_value TO li_list.
CLEAR l_value.
l_value-key = '5'.
l_value-text = 'May'.
APPEND l_value TO li_list.
CLEAR l_value.
l_value-key = '6'.
l_value-text = 'June'.
APPEND l_value TO li_list.
CLEAR l_value.
l_value-key = '7'.
l_value-text = 'July'.
APPEND l_value TO li_list.
CLEAR l_value.
l_value-key = '8'.
l_value-text = 'August'.
APPEND l_value TO li_list.
CLEAR l_value.
l_value-key = '9'.
l_value-text = 'September'.
APPEND l_value TO li_list.
CLEAR l_value.
l_value-key = '10'.
l_value-text = 'October'.
APPEND l_value TO li_list.
CLEAR l_value.
l_value-key = '11'.
l_value-text = 'November'.
APPEND l_value TO li_list.
CLEAR l_value.
l_value-key = '12'.
l_value-text = 'December'.
APPEND l_value TO li_list.
CLEAR l_value.
l_name = 'P_TEST'.
p_test = '1'. "this is to set the default value of the list box.
CALL FUNCTION 'VRM_SET_VALUES'
EXPORTING
id = l_name
values = li_list
EXCEPTIONS
id_illegal_name = 1
OTHERS = 2.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
ENDFORM. " f4_value_request
‎2008 Aug 15 5:57 PM