SAP DYNPRO DROP1 ABEXA

Get Example source ABAP code based on a different SAP table
  


ARTICLE

Screens, List Box with Value List from Input Help
The example shows the recommended way to enable a dropdown list box.

ABAP_SOURCE_CODE
ABAP_EXEC

ABAP_DESCRIPTION
The static screen number of screen 100 is 100. The screen contains a single input field, the component SDYN_CONN-CARRID. Its attribute dropdown is 'Listbox', the output length is 20, the attribute value list is empty, and it has been assigned function code SELECTED. The functions BACK, EXIT, and CANCEL are defined in the GUI status with the function type E. The screen flow logic is as follows: PROCESS BEFORE OUTPUT.
MODULE status_0100.
PROCESS AFTER INPUT.
MODULE cancel AT EXIT-COMMAND.
MODULE user_command_0100.
PROCESS ON VALUE-REQUEST.
FIELD sdyn_conn-carrid MODULE create_dropdown_box.
The user is not allowed to enter values in the screen field. If the user chooses the input field on screen 100, a list box is displayed. Since the attribute value list is empty, the input help mechanism is started. In this case, the event block PROCESS ON VALUE-REQUEST has been defined in the screen flow logic which overrides all other mechanisms. The system fills a two-column internal table in the corresponding dialog module and passes it to the input help using the function module F4IF_INT_TABLE_VALUE_REQUEST. The system then reads the second column of this table into the list box.
If the user chooses a row from the list box, the event PAI is triggered with the function code SELECTED, and the value in the first column of the internal table is copied to the input field.