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 Help

Former Member
0 Likes
435

hi..

I want to add data from table to list-box.means when we enter the transaction code in the textbox after entering 2-3 transaction codes it lists it. how can i do that??

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
412

Hi!

Check out this code-

<b>type-pools: vrm.

parameters: p_bname type usr01-bname as listbox visible length 20.

initialization.

perform build_user_drop_down_list.

start-of-selection.

write:/ p_bname.

  • build user_drop_down_list

form build_user_drop_down_list.

data: name type vrm_id,

list type vrm_values,

value like line of list.

data: iusr01 type usr01 occurs 0 with header line.

clear list. refresh list.

name = 'P_BNAME'.

select * into corresponding fields of table iusr01

from usr01.

sort iusr01 ascending by bname.

loop at iusr01.

clear value.

value-key = iusr01-bname.

value-text = iusr01-bname.

append value to list.

endloop.

  • Set the values

call function 'VRM_SET_VALUES'

exporting

id = name

values = list.

endform.</b>

Reward if it helps.

regards,

Neha Bansal.

3 REPLIES 3
Read only

Former Member
0 Likes
412

Hi,

You can try following codes:

DATA: NAME TYPE VRM_ID,

LIST TYPE VRM_VALUES,

VALUE LIKE LINE OF LIST.

REFRESH LIST.

NAME = 'ADR2-TEL_NUMBER'.

MOVE: '0123456789' TO VALUE-KEY,

'0123456789' TO VALUE-TEXT.

APPEND VALUE TO LIST.

MOVE: '9876543210' TO VALUE-KEY,

'987654321' TO VALUE-TEXT.

APPEND VALUE TO LIST.

CALL FUNCTION 'VRM_SET_VALUES'

EXPORTING

ID = NAME

VALUES = LIST.

Hope this will help you.

Jogdand M B

Read only

anversha_s
Active Contributor
0 Likes
412

hi,

Check the link to know how to populate values as a LIST(drop down list)

here is the sample piece of code,

PROGRAM zlist.
TYPE-POOLS : VRM.
DATA: param TYPE vrm_id, 
       values     TYPE vrm_values, 
       value LIKE LINE OF values. 
 
PARAMETERS: p_name(10) AS LISTBOX VISIBLE LENGTH 10.
AT SELECTION-SCREEN OUTPUT. 
  param = 'P_NAME'. 
  value-key = '1'.
  value-text = 'NAME1'.
  APPEND value TO values.
  value-key = '2'. 
  value-text = 'NAME2'.
  APPEND value TO values. 
*--and so onnn
  CALL FUNCTION 'VRM_SET_VALUES' 
    EXPORTING id     = param 
              values = values.

Rgds

Anversha

Read only

Former Member
0 Likes
413

Hi!

Check out this code-

<b>type-pools: vrm.

parameters: p_bname type usr01-bname as listbox visible length 20.

initialization.

perform build_user_drop_down_list.

start-of-selection.

write:/ p_bname.

  • build user_drop_down_list

form build_user_drop_down_list.

data: name type vrm_id,

list type vrm_values,

value like line of list.

data: iusr01 type usr01 occurs 0 with header line.

clear list. refresh list.

name = 'P_BNAME'.

select * into corresponding fields of table iusr01

from usr01.

sort iusr01 ascending by bname.

loop at iusr01.

clear value.

value-key = iusr01-bname.

value-text = iusr01-bname.

append value to list.

endloop.

  • Set the values

call function 'VRM_SET_VALUES'

exporting

id = name

values = list.

endform.</b>

Reward if it helps.

regards,

Neha Bansal.