ABAP Keyword Documentation → ABAP − Reference → SAP GUI User Dialogs → General Dynpros → Field Help, Input Help, and Dropdown List Boxes → Field Helps, Input Helps, and Dropdown List Boxes - Examples
Dynpros, Input Help in Dialog Modules
This example demonstrates how input helps can be implemented in dialog modules.
Other versions: 7.31 | 7.40 | 7.54
Source Code
REPORT demo_dynpro_f4_help_module .
TYPES: BEGIN OF values,
carrid TYPE spfli-carrid,
connid TYPE spfli-connid,
END OF values.
DATA: carrier(3) TYPE c,
connection(4) TYPE c.
DATA: progname TYPE sy-repid,
dynnum TYPE sy-dynnr,
dynpro_values TYPE TABLE OF dynpread,
field_value LIKE LINE OF dynpro_values,
values_tab TYPE TABLE OF values.
CALL SCREEN 100.
MODULE init OUTPUT.
progname = sy-repid.
dynnum = sy-dynnr.
CLEAR: field_value, dynpro_values.
field_value-fieldname = 'CARRIER'.
APPEND field_value TO dynpro_values.
ENDMODULE.
MODULE cancel INPUT.
LEAVE PROGRAM.
ENDMODULE.
MODULE value_carrier INPUT.
CALL FUNCTION 'F4IF_FIELD_VALUE_REQUEST'
EXPORTING
tabname = 'DEMOF4HELP'
fieldname = 'CARRIER1'
dynpprog = progname
dynpnr = dynnum
dynprofield = 'CARRIER'.
ENDMODULE.
MODULE value_connection INPUT.
CALL FUNCTION 'DYNP_VALUES_READ'
EXPORTING
dyname = progname
dynumb = dynnum
translate_to_upper = 'X'
TABLES
dynpfields = dynpro_values.
field_value = dynpro_values[ 1 ].
SELECT carrid, connid
FROM spfli
WHERE carrid = @field_value-fieldvalue
INTO CORRESPONDING FIELDS OF TABLE @values_tab.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
retfield = 'CONNID'
dynpprog = progname
dynpnr = dynnum
dynprofield = 'CONNECTION'
value_org = 'S'
TABLES
value_tab = values_tab.
ENDMODULE.
Description
The static next dynpro number of dynpro 100 is 100. The input fields are taken from the program fields
carrier
and connection
. The function code of the pushbutton is CANCEL with the function type E. The screen flow logic is as follows:
MODULE init.
PROCESS AFTER INPUT.
MODULE cancel AT EXIT-COMMAND.
PROCESS ON VALUE-REQUEST.
FIELD carrier MODULE value_carrier.
FIELD connection MODULE value_connection.
When selecting the F4 help for the individual fields, the user is shown the following types of input help:
- For the airline, the module
value_carrier
is called at POV. There, the function module F4IF_FIELD_VALUE_REQUEST displays the input help of the component CARRIER1 of the structure DEMOF4HELP from ABAP Dictionary, namely the search help DEMOF4DE. The item selected by the user is passed to the dynpro fieldcarrier
.
- For the connection, the module
value_connection
is called at POV. There, the function module DYNP_VALUE_READ passes the value of the dynpro fieldcarrier
to the program.SELECT
then extracts the matching values from the database table SPFLI into the internal tablevalues_tab
and passes them to the function module F4IF_INT_TABLE_VALUE_REQUEST. The function module displays these values as an input help and passes the item selected by the user to the dynpro fieldconnection
.