12.5    List Box

List boxes are special I/O fields that display possible entries in a dropdown list. These fields are useful if you want the user to select only from available options. The user can’t enter a value in the list box directly. If a function code is assigned to the list box, it will trigger PAI the moment a value is selected from the list box.

A list box consists of two columns: key and value. You can define the list box to show both key and value or just the value. When the user selects a value in the list box, the corresponding program data object will be passed the key of the value. This is useful when you want to show the external format of the data to the user but use the internal format internally.

To set the I/O field as a list box, double-click the screen element and select Listbox or Listbox with Key in the Dropdown field in the field attributes, as shown in Figure 12.27. You can populate the values in the list box either from ABAP Data Dictionary (from the search help or value range) or from the flow logic using the POV event. This is the recommended method, though you can also populate the list box by setting the From Program attribute for the value list (see Figure 12.27). In such cases, the list box is populated by passing an internal table to the VRM_SET_VALUES function module called in a PBO module.

Element Attributes

Each screen element can be set with additional attributes by double-clicking it. The following URL provides comprehensive documentation for various attributes that can be set for different screen elements:

https://help.sap.com/saphelp_nw74/helpdata/en/d1/801c2d454211d189710000e8322d00/content.htm.

List Box

Figure 12.27    List Box