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: 

Drop down Box on Selection Screen

Former Member
0 Kudos
189

Hi experts,

THis is first time I am working on Dropdown boxes.

My Selection Screen has to contain 2 character dropdown box.

For example, Department

01 Finance

02 Sales

03 Production

05 Human Resource

Please suggest How Can i Achieve this?

Regards,

Helpful answers are surely rewarded

1 ACCEPTED SOLUTION

Former Member
0 Kudos
115

Hi Priyanka.

Try This,

PARAMETERS: matnr TYPE mara-matnr AS LISTBOX VISIBLE LENGTH 20.

Regards

Rasheed

10 REPLIES 10

Former Member
0 Kudos
115

use vrm_set_values fm

REPORT ZSRK_073 .

TYPE-POOLS : VRM.

PARAMETER : P_DEP(2) AS LISTBOX VISIBLE LENGTH 20.

DATA: G_NAME TYPE VRM_ID,

G_LIST TYPE VRM_VALUES,

G_VALUE LIKE LINE OF G_LIST.

INITIALIZATION.

REFRESH G_LIST.

G_NAME = 'P_DEP'.

G_VALUE-KEY = '01'.

G_VALUE-TEXT = 'Finance'.

APPEND G_VALUE TO G_LIST.

G_VALUE-KEY = '02'.

G_VALUE-TEXT = 'Sales'.

APPEND G_VALUE TO G_LIST.

G_VALUE-KEY = '03'.

G_VALUE-TEXT = 'Production'.

APPEND G_VALUE TO G_LIST.

G_VALUE-KEY = '05'.

G_VALUE-TEXT = 'Human Resource'.

APPEND G_VALUE TO G_LIST.

IF NOT G_LIST IS INITIAL.

CALL FUNCTION 'VRM_SET_VALUES'

EXPORTING

ID = G_NAME

VALUES = G_LIST.

ENDIF.

Edited by: sreekanth reddy on Nov 20, 2008 3:42 PM

Former Member
0 Kudos
116

Hi Priyanka.

Try This,

PARAMETERS: matnr TYPE mara-matnr AS LISTBOX VISIBLE LENGTH 20.

Regards

Rasheed

Former Member
0 Kudos
115

Hi Priyanka,

Use the following FM.

CALL FUNCTION 'VRM_SET_VALUES'

EXPORTING

id = 'A'

values = v

EXCEPTIONS

id_illegal_name = 1

OTHERS = 2.

Thanks

Nitesh

former_member1245113
Active Contributor
0 Kudos
115

Hi Priyanka,

After declaring the variables in Top include and corresponding fields on screan use function moduel VRM_SET_VALUES.

pass required import and export parameters.

hope this will serve your purpose.

Regards

Ramchander Rao.K

former_member1245113
Active Contributor
0 Kudos
115

Hi Priyanka,

After declaring the variables in Top include and corresponding fields on screan use function moduel VRM_SET_VALUES.

pass required import and export parameters.

hope this will serve your purpose.

Regards

Ramchander Rao.K

Former Member
0 Kudos
115

Try this logic

PROGRAM zcmtest01.

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 = 'Line 1'.

APPEND value TO list.

value-key = '2'.

value-text = 'Line 2'.

APPEND value TO list.

CALL FUNCTION 'VRM_SET_VALUES'

EXPORTING id = name

values = list.

START-OF-SELECTION.

WRITE: / 'Parameter:', ps_parm.

Former Member
0 Kudos
115

AT SELECTION-SCREEN ON VALUE-REQUEST FOR zpdx_tab.

w_vrm_id = 'Field Name'

CALL FUNCTION 'VRM_SET_VALUES'

EXPORTING

id = w_vrm_id

values = t_vrm_values " values table

EXCEPTIONS

id_illegal_name = 1

OTHERS = 2.

IF sy-subrc NE 0.

MESSAGE e000 WITH 'No value found for request'(001).

ENDIF.

Former Member
0 Kudos
115

hi priyanka,

VRM_SET_VALUES is used to display list of values for drop down field.

check this thread

it helps you.

thanks

sachin

Former Member
0 Kudos
115

hi,

Just copy paste this code and check whether ur requirement its fulfilling

Parameters : P_Area type char20.

DATA : int_list TYPE vrm_values.

DATA : int_values LIKE LINE OF int_list.

  • To fill the list to be passed to the FM

wf_vrm_id = 'P_AREA.

int_values-key = u201801u2019.

int_values-text = u2018Financeu2019.

append int_values to int_list.

clear int_values.

int_values-key = u201802u2019.

int_values-text = u2018Sales.

append int_values to int_list.

clear int_values.

int_values-key = u201803u2019.

int_values-text = u2018Production.

append int_values to int_list.

clear int_values.

int_values-key = u201804u2019.

int_values-text = u2018Human Resource.

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.

get back if u face any problem

thanks .....

Former Member
0 Kudos
115

Its resolved