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

how to write code for getting drop list in the selection screen

Former Member
0 Likes
807

Hi,

can u plz help me in how to write a code to get a drop list in the selection screen

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
785

Hi,

chk the below link

Regards,

Priyanka.

Hi,

can u plz help me in how to write a code to get a drop list in the selection screen

5 REPLIES 5
Read only

Former Member
0 Likes
786

Hi,

chk the below link

Regards,

Priyanka.

Read only

Former Member
0 Likes
785

Hi Ram,

Check this link.

Reward if useful.

Thanks

Aneesh.

Read only

Former Member
0 Likes
785

HI,

see this code.

TYPE-POOLS : vrm.

tables: bkpf.

DATA : values TYPE vrm_values.

DATA : wa LIKE LINE OF values.

PARAMETERS : list_box(10) TYPE c AS LISTBOX VISIBLE LENGTH 10.

PARAMETERS: dd type bkpf-BSTAT user-command abc.

select-options: a for bkpf-bukrs MODIF ID buk.

select-options: b for bkpf-belnr MODIF ID SEL.

at selection-screen output.

If list_box = 2.

loop at screen.

if screen-group1 = 'SEL'.

screen-input = 0.

modify screen.

endif.

endloop.

endif.

INITIALIZATION.

wa-key = '1'.

wa-text = 'Orange'.

APPEND wa TO values.

wa-key = '2'.

wa-text = 'Red'.

APPEND wa TO values.

wa-key = '3'.

wa-text = 'Blue'.

APPEND wa TO values.

wa-key = '4'.

wa-text = 'Gray'.

APPEND wa TO values.

CALL FUNCTION 'VRM_SET_VALUES'

EXPORTING

id = 'LIST_BOX'

values = values

EXCEPTIONS

id_illegal_name = 1

OTHERS = 2.

rgds,

bharat.

Read only

Former Member
0 Likes
785

Hi ram,

Let me share my points with you.

ZTEST.

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 = 'JAI'.

APPEND VALUE TO LIST.

VALUE-KEY = '2'.

VALUE-TEXT = 'SRI'.

APPEND VALUE TO LIST.

NAME = 'PS_PARM'.

VALUE-KEY = '3'.

VALUE-TEXT = 'SAI'.

APPEND VALUE TO LIST.

NAME = 'PS_PARM'.

VALUE-KEY = '4'.

VALUE-TEXT = 'RAM'.

APPEND VALUE TO LIST.

CALL FUNCTION 'VRM_SET_VALUES'

EXPORTING

ID = NAME

VALUES = LIST.

START-OF-SELECTION.

WRITE: / 'Parameter:', PS_PARM.

Already i have tested this code. it is workingfine. Just copy and paste in u r editor and check once.

Hope this helps you. Reply for queries, shall post the updates.

Regards.

Kumar

Read only

kesavadas_thekkillath
Active Contributor
0 Likes
785

below is a simple code for filling plants into a list box...

type-pools: vrm.

data: name type vrm_id,

list type vrm_values,

value like line of list.

ranges: r_werks for t001w-werks.

r_werks-option = 'EQ'.

r_werks-sign = 'I'.

selection-screen begin of block b1 with frame title text-001.

parameters: PLANT like r_werks as listbox visible length 10.

selection-screen end of block b1.

at selection-screen output.

perform fetch_plant.

form fetch_plant .

refresh list.

select distinct werks from t001w into r_werks-low

where kunnr eq 'TSL' or kunnr eq '0000050001'.

append r_werks.

endselect.

sort r_werks ascending.

delete adjacent duplicates from r_werks.

perform assign_listbox_values.

endform.

form assign_listbox_values .

loop at r_werks.

name = 'PLANT'.

value-key = r_werks-low.

value-text = r_werks-low.

append value to list.

endloop.

call function 'VRM_SET_VALUES'

exporting

id = name

values = list.

reward if useful.....