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

Adding value to Screen element Drop-down Box

Former Member
0 Likes
506

Hi Abappers,

I have prepared my Internal table.

Now I have to add the value of a particular field to the Screen Element which is drop down Box.

How to add the values in that Drop-down box.

Regards,

Rahul

2 REPLIES 2
Read only

Former Member
0 Likes
420

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.

For details -


LIST BOX in SELECTION SCREEN

List Box is created in selection screen using PARAMETERS staement

with AS LISTBOX addition other attributes like VISIBLE LENGTH (width of listbox)

can be specified with the declaration.

PARAMETERS name(n) AS LISTBOX VISIBLE LENGTH n.

Here n is an integer and name is the name of parameter.

To populate the value list we use the FM VRM_SET_VALUES and the

selection screen event AT SELECTION-SCREEN OUTPUT is used to write the code to fill it.

VRM_SET_VALUES

The function module VRM_SET_VALUES is used to fill the value list associated with a List Box .This FM uses types which are declared in type group VRM. So

we should declare TYPE-POOLS VRM before using this FM.

Some important types declared in the VRM type group are

VRM_ID

It refers to the name of the input/output field associated with list box

VRM_VALUES

It refers to the internal table consisting of two fields TEXT(80C) and KEY(40)C

that will be used to create the list values.

CALL FUNCTION 'VRM_SET_VALUES'

EXPORTING

ID = name of screen element ,it is of TYPE VRM_ID

VALUES = internal table containing values,of TYPE VRM_VALUES

Read only

0 Likes
420

Hi Minal,

By using your code, the list is showing on the Drop down but i am not able to make any selection from that.

When i select any value,

It comes blank in drop down

How to resolve it?

Regards,

Rahul