I have defined a list box in my selection screen, as follows:
SELECTION-SCREEN BEGIN OF BLOCK B2 WITH FRAME TITLE ALTITLE1.
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT (30) ALCONT4 FOR FIELD L1.
PARAMETERS: L1 AS LISTBOX VISIBLE LENGTH 20 MODIF ID AOD.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN END OF BLOCK B2.
Now I need to propose possible values for that list box, how can I do it ?
During the PBO of your screen (for selection screens, the PBO code is defined inside the event block
AT SELECTION-SCREEN OUTPUT
), you must call the function moduleVRM_SET_VALUES
, passing the name of the field and a list of values.Execution:
For information, you can achieve the same result from the database table of countries
T005T
, by transferring the entries to an intermediate internal table:You may find more information in the SAP Library (the explanations are valid for all kind of screens, the examples are only for classic screens but they may be adapted easily to selection screens): http://help.sap.com/saphelp_470/helpdata/en/9f/dbabe435c111d1829f0000e829fbfe/frameset.htm