Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

listbox

Former Member
0 Likes
1,003

hi,

what is the syntax for creating the listbox with search-help in selection-screen.

thanks

8 REPLIES 8
Read only

Former Member
0 Likes
974

Hi priya,

Check out this link

[http://sap.niraj.tripod.com/id38.html]

Regards,

Sravanthi

Read only

Former Member
0 Likes
974

Hi priya patil,

Go through the following link.

Link: [;

by

prasad G.V.K

Read only

Former Member
0 Likes
974

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

.

Read only

Former Member
0 Likes
974

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.

Read only

Former Member
0 Likes
974

Hi,

Check this Thread;

creating the listbox in selection-screen.

Regards

Adil

Read only

Former Member
0 Likes
974

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

Read only

Former Member
0 Likes
974

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 ....

Read only

Former Member
0 Likes
974

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.