‎2008 Jul 23 12:47 PM
hi,
what is the syntax for creating the listbox with search-help in selection-screen.
thanks
‎2008 Jul 23 12:54 PM
Hi priya,
Check out this link
[http://sap.niraj.tripod.com/id38.html]
Regards,
Sravanthi
‎2008 Jul 23 12:55 PM
‎2008 Jul 23 1:04 PM
Just paste this code: u will get idea..
TYPE-POOLS vrm.
**"Table declarations...................................................
*TABLES sscrfields.
*"Table declarations...................................................
PARAMETERS:
p_connid(11) AS LISTBOX
VISIBLE LENGTH 20 default ' '.
p_value TYPE i MODIF ID QWR.
*" Data declarations...................................................
"----
Work variables *
"----
DATA:
w_char(20) TYPE c,
w_flag TYPE i.
"----
INITIALIZATION. EVENT *
"----
INITIALIZATION.
"----
Internal table to hold delivery header data *
"----
DATA:
t_table TYPE
STANDARD TABLE
OF vrm_value,
vrm_values1 LIKE LINE OF t_table.
vrm_values1-key = 'a'.
vrm_values1-text = 'sap'.
APPEND vrm_values1 TO t_table.
vrm_values1-key = '2'.
vrm_values1-text = 'testing'.
APPEND vrm_values1 TO t_table.
vrm_values1-key = '2'.
vrm_values1-text = 'java'.
APPEND vrm_values1 TO t_table.
vrm_values1-key = '4'.
vrm_values1-text = '.net'.
APPEND vrm_values1 TO t_table.
vrm_values1-key = '5'.
vrm_values1-text = 'vc++'.
APPEND vrm_values1 TO t_table.
vrm_values1-key = 'che'.
vrm_values1-text = 'chetta-ram'.
APPEND vrm_values1 TO t_table.
CALL FUNCTION 'VRM_SET_VALUES'
EXPORTING
id = 'p_connid'
values = t_table
EXCEPTIONS
ID_ILLEGAL_NAME = 1
OTHERS = 2
.
‎2008 Jul 23 1:31 PM
Use FM VRM_SET_VALUES .......
REPORT ZDEM .
TYPE-POOLS : VRM.
DATA: VALUES TYPE VRM_VALUES,
VALUE LIKE LINE OF VALUES.
SELECTION-SCREEN : BEGIN OF BLOCK B.
PARAMETERS : P_LIST(10) AS LISTBOX VISIBLE LENGTH 10.
SELECTION-SCREEN : END OF BLOCK B.
AT SELECTION-SCREEN OUTPUT.
VALUE-KEY = '1'.
VALUE-TEXT = 'ONE'.
APPEND VALUE TO VALUES.
VALUE-KEY = '2'.
VALUE-TEXT = 'TWO'.
APPEND VALUE TO VALUES.
CALL FUNCTION 'VRM_SET_VALUES'
EXPORTING
ID = 'P_LIST'
VALUES = VALUES.
‎2008 Jul 23 1:58 PM
‎2008 Jul 24 6:20 AM
hey priya,
All the above said ways are correct
there is another simpler way in which you can create but this is useful only when you are using your own Z field with a Z data element and domain.
just maintain the values in the value range tab of the domain.
In your module pool program go to the screen and double click on the field for which you want to create the list box.
when you double click you get another screen ( screen painter : attributes ) , in that there is a field called dropdown . Just select listbox.
All the values maintained at the domain level would be shown on execution as a drop down.
Please remember that this is useful only when you have your own domain and the values in the drop down box remain constant.
Hope this helps,
Reward if useful,
Regards,
RK
‎2008 Jul 24 7:14 AM
hello,
u can copy paste this code and try out
TYPE-POOLS : vrm.
DATA : int_list TYPE vrm_values.
DATA : int_values LIKE LINE OF int_list.
DATA : wf_vrm_id TYPE vrm_id.
PARAMETER : p_dtype(13) TYPE c AS LISTBOX VISIBLE LENGTH 15.
AT SELECTION-SCREEN OUTPUT.
To fill the list to be passed to the FM
wf_vrm_id = 'P_DTYPE'.
int_values-key = ' 1 '.
int_values-text = ' Value 1'.
append int_values to int_list.
clear int_values.
int_values-key = ' 2' .
int_values-text = 'Value 2'.
append int_values to int_list.
clear int_values.
FM to populate the drop down box.
call function 'VRM_SET_VALUES'
exporting
id = wf_vrm_id
values = int_list.
Mark the post answered once ur problem is solved ....
‎2008 Jul 24 2:04 PM
Hi Priya,
Check this syntax.
PARAMETERS p_carrid TYPE spfli-carrid
AS LISTBOX VISIBLE LENGTH 20
USER-COMMAND onli
DEFAULT 'LH'.
AT SELECTION-SCREEN.
...
START-OF-SELECTION.
Reward Points if useful
Regards,
Muneesh Gitta.