In standard program screen, for some fields there is a button beside which you can click and search allowed values.
Example (program DEMO_DYNPRO_F4_HELP_DICTIONARY):


Can I do the same with ABAP, is it an additional feature of select-options or others?
This little button at the right of the screen field tells you that there's a F4 help. Either you click this button or you place your cursor in the field and press F4 (hence the name), and the list of possible values is displayed and you may select one value.
There are many ways to determine what the F4 help should display. The list below shows how the ABAP runtime decides what to do when the F4 help is invoked, and that should be sufficient for you to get further information on the Web (source: SAP Library "Hierarchy of the Search Help Call").
The SAP Library used to provide the following diagram (also available here) what the system calls when the user displays the list of values of a given field, that I detail below :

Note that it concerns all types of screens of the Dynpro technology, and Selection Screens are part of it but there's an additional layer to understand.
So I first give a general explanation of the F4 help for all types of screens of the Dynpro technology, followed by a chapter dedicated to the Selection Screens.
What happens when the F4 help is invoked:
PROCESS ON VALUE-REQUEST), this code is called.
PROCESS ON VALUE-REQUEST of the Screen Flow Logic, use FIELD <screenfieldname> MODULE <modulename>.MODULE <modulename> and ENDMODULE statements.F4IF_INT_TABLE_VALUE_REQUEST.SFLIGHT-CARRID corresponds to the column CARRID of the DDIC table SFLIGHT) and at the same time the screen field attribute "DD field" is checked:
DATS (date field), the Calendar Help is shown.TIMS (time field), the Clock Help is shown.(*) A Search Help is a repository object which simplifies the development for handling the classic F4 helps. It refers to a database table or view, indicates what are the possible input and returned columns, the additional selection criteria, the displayed columns, etc. It's maintained via the transaction code SE11.
Please look at those demo programs in your ABAP system :
The Selection screens are general screens whose layout and flow logic are described via ABAP statements and a corresponding general screen is generated at compile time, while the general screens are designed graphically via the Screen Painter.
There are the following ABAP statements for handling the F4 help in a selection screen (but the ABAP runtime behaves the same as above when the F4 help is invoked):
AT SELECTION-SCREEN ON VALUE-REQUEST FOR <screen field name> must be used.MATCHCODE OBJECT <searchhelpname> to the ABAP statements PARAMETERS and SELECT-OPTIONS.Note that a selection screen should not be changed manually because it's re-generated every time the program is activated, and that the screen fields have always the "DD Field" attribute deactivated so the ABAP runtime won't access the search helps defined in the DDIC.
Example:
The following selection screen statements:
PARAMETERS p_file TYPE string.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.
MESSAGE 'instead, display your F4 dialog' TYPE 'I'.
generate both a selection screen (layout and flow logic):
PROCESS ON VALUE-REQUEST.
FIELD P_FILE MODULE %_P_FILE_VAL.
and some ABAP code inside the program which is hidden to the developer:
MODULE %_P_FILE_VAL INPUT.
MESSAGE 'instead, display your F4 dialog' TYPE 'I'.
ENDMODULE.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With