Application Development 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: 

Declaring constant data in a list box - Dialog programming

Former Member
0 Kudos

i need to declarare some constant data 1...4 in list box in dialog programming i have done some coding its not working here is the code, can you plz tell me whats wrong in the code non of the values are displaying in drop downbox.

type-pools vrm.

DATA: name TYPE vrm_id,

list TYPE vrm_values,

value LIKE LINE OF list.

clear list.

REFRESH LIST.

value-key = '1'.

value-text = 'Sales & Distribution'.

append value to list.

value-key = '2'.

value-text = 'Material Management'.

append value to list.

value-key = '3'.

value-text = 'Finance & Controlling'.

append value to list.

CALL FUNCTION 'VRM_SET_VALUES'

EXPORTING

id = 'LISTBOX1'

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

3 REPLIES 3

Former Member
0 Kudos

Hi,

Pls refer the program,

demo_dynpro_dropdown_listbox

Regards,

Renjith Michael.

Former Member
0 Kudos

You declared the the internal table ' value' using like line of

when u pass multiple values it gives an error.

So,

declare value using "standard table of" .

bye.

Former Member
0 Kudos

I think your code is correct onlybut the problem may be where

you are passing the internal table to the FM 'VRM_SET_VALUES' ...

Try to use the following code..

CALL FUNCTION 'VRM_SET_VALUES'

EXPORTING

id = 'LISTBOX1'

values = list[]