cancel
Showing results for 
Search instead for 
Did you mean: 

drop down list

Anindya
Explorer
0 Kudos

Hi All,

How do i implement a drop down list wth select options in the selection screen.

Thanks in advance.

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

hi ,

these are some of the ways to declared a drop down

hope it ll help your cause.

Report Z_STD.

  • 1st way

TYPE-POOLS : vrm.

DATA : v TYPE vrm_values.

DATA : vw LIKE LINE OF v.

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

INITIALIZATION.

vw-key = '1'.

vw-text = 'Jan'.

APPEND vw TO v.

vw-key = '2'.

vw-text = 'Feb'.

APPEND vw TO v.

vw-key = '3'.

vw-text = 'Mar'.

APPEND vw TO v.

CALL FUNCTION 'VRM_SET_VALUES'

EXPORTING

id = 'A'

values = v

EXCEPTIONS

id_illegal_name = 1

OTHERS = 2.

*2nd way

PARAMETERS : p_a TYPE pernr DEFAULT '01'

AS LISTBOX VISIBLE LENGTH 20.

*3rd way

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.

reward if helpful

regrads

anuj.

karuna_gangireddy
Contributor
0 Kudos

Hi,

Whatever way you opt (case1 or case2) you have to define search help at the table level. You cannot define the values for the drop down in the selection screens.

Case1. If you are using the standard SAP fields for definition (Ex: Zmatnr FOR MARA-MATNR) then the drop down will show up as the MATNR field had the search help defined in MARA table.

Case2. If you are using any fields from Z-table then you have to define the check table for the field in Z-table and use the same field in your select options.

I hope this helps. Please let me know if you have any furture questions.

Thanks,

Karuna.