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

drop down box in a modulepool

Former Member
0 Likes
432

Hi,

I am creating a modulepool with a drop down box in one of the dynpros. I have managed to fill it with values using the 'VRM_SET_VALUES' function module.

The problem comes when running the modulepoool. The field displays the drop down box with the correct values, but it does not take the values I select. The first opcion is the defualt, and even though I choose a different one it does not take the change.

Is there something missing?

Thanks in advance,

Nerea.

2 REPLIES 2
Read only

Former Member
0 Likes
401

YOu can use the program:

DEMO_DYNPRO_DROPDOWN_LISTBOX as an example.

Regards,

Ravi

Read only

Former Member
0 Likes
401

Hi Nerea,

Check with this code

TYPE-POOLS: VRM.

TABLES SPFLI.

TABLES SSCRFIELDS.

DATA flag.

DATA: NAME TYPE VRM_ID,

LIST TYPE VRM_VALUES,

VALUE LIKE LINE OF LIST.

PARAMETERS PS_PARM LIKE SPFLI-CARRID AS LISTBOX VISIBLE LENGTH 10

USER-COMMAND

fcodex.

data: i_spfli type spfli occurs 0 with header line.

PARAMETERS PQ_PARAM LIKE SPFLI-connid AS LISTBOX VISIBLE LENGTH 15

USER-COMMAND

fcodey.

INITIALIZATION.

NAME = 'PS_PARM'.

DATA T TYPE I VALUE 0.

SELECT DISTINCT carrid into corresponding fields of table i_spfli FROM

SPFLI.

loop at i_spfli.

VALUE-KEY = i_spfli-CARRID.

VALUE-TEXT = i_spfli-CARRID.

APPEND VALUE TO LIST.

endloop.

CALL FUNCTION 'VRM_SET_VALUES'

EXPORTING

ID = NAME

VALUES = LIST.

AT SELECTION-SCREEN.

if sy-ucomm eq 'FCODEX'.

REFRESH LIST.

CLEAR LIST.

PQ_PARAM = ' '.

NAME = 'PQ_PARAM'.

SELECT * FROM SPFLI WHERE CARRID = PS_PARM.

VALUE-KEY = SPFLI-connid.

VALUE-TEXT = SPFLI-connid.

APPEND VALUE TO LIST.

ENDSELECT.

endif.

AT SELECTION-SCREEN OUTPUT.

LOOP AT SCREEN.

IF SY-UCOMM NE 'FCODEX' OR SY-UCOMM NE 'FCODEY'.

CALL FUNCTION 'VRM_SET_VALUES'

EXPORTING

ID = NAME

VALUES = LIST.

MODIFY SCREEN.

ENDIF.

ENDLOOP.

START-OF-SELECTION.

clear i_spfli.

refresh i_spfli.

select * into table i_spfli from spfli where carrid = ps_parm and connid

= pq_param.

loop at i_spfli.

WRITE: / 'CITY FROM:', I_SPFLI-CITYFROM, 'CITY TO :',I_SPFLI-CITYTO,

'DEPARTURE TIME :', I_SPFLI-DEPTIME.

ENDLOOP.

Reward with point if it is helpful

Regards

Alfred