SAP Function F4IF_FIELD_VALUE_REQUEST - F4 help for fields that are only known at runtime

Parameter Reference Type Length Default Optional Text
CALLBACK_FORM SYST-XFORM C 30 SPACE X Form for callback before F4 start (-> long docu)
CALLBACK_METHOD REF TO IF_F4CALLBACK_VALUE_REQ 0 X Interface for Callback Routines
CALLBACK_PROGRAM SYST-REPID C 40 SPACE X Program for callback before F4 start
DISPLAY DDBOOL_D C 1 SPACE X Override readiness for input
DYNPNR SYST-DYNNR C 4 SPACE X Screen number
DYNPPROG SYST-REPID C 40 SPACE X Current program
DYNPROFIELD HELP_INFO-DYNPROFLD C 132 SPACE X Name of screen field for value return
FIELDNAME DFIES-FIELDNAME C 30 Field name from Dictionary
MULTIPLE_CHOICE DDBOOL_D C 1 SPACE X Switch on multiple selection
SEARCHHELP SHLPNAME C 30 SPACE X Search help as screen field attribute
SELECTION_SCREEN DDBOOL_D C 1 SPACE X Behavior as in Selection Screen (->Long Docu)
SHLPPARAM SHLPFIELD C 30 SPACE X Search help parameter in screen field
STEPL SYST-STEPL I 4 0 X Steploop line of screen field
SUPPRESS_RECORDLIST DDSHF4CTRL-HIDE_LIST C 1 SPACE X Skip display of the hit list
TABNAME DFIES-TABNAME C 30 Table/structure name from Dictionary
VALUE HELP_INFO-FLDVALUE C 255 SPACE X Field contents for F4 call

Parameter Reference Type Length Text
USER_RESET C C 0 Single-Character Flag

Parameter Reference Length Optional Text
RETURN_TAB DDSHRETVAL 328 X Return the selected value

Exception Text
FIELD_NOT_FOUND Field does not exist in the Dictionary
INCONSISTENT_HELP F4 help for the field is inconsistent
NO_HELP_FOR_FIELD No F4 help is defined for the field
NO_VALUES_FOUND No values found

Functionality
This module permits the implementation of the standard help for ascreen field whose reference to the ABAP Dictionary is only known atruntime.
If the module is called at the time PROCESS ON VALUE REQUEST, itbehaves just like the standard help.
The reference to the ABAP Dictionary is needed in the form of the tableand field names as input.
The module then determines the search help defined directly orindirectly in the Dictionary (e.g. also domain fixed values). Ifseveral parameters of the search help are linked with the Dictionarytable or structure, the additional fields are searched for on thescreen, as for the standard help, and the parameters are given theircontents. The standard F4 process is then started. Depending on theuser settings, this can also be implemented with the input helpControl.
In addition to specifying the table and field names, you have thefollowing alternatives:

  • Parameter TABNAME is assigned a data element (type). FIELDNAME is
  • empty.
    • The search help (SEARCHHELP) is specified directly. In this case you
    • should also pass the search help parameter (SHLPPARAM), which is usedas return parameter. (For reasons of compatibility, you can also defineonly SEARCHHELP. In this case the first parameter of the search help isused as default for SHLPPARAM.)
      If the screen information DYNPPROG, DYNPNR, DYNPROFIELD and possiblySTEPL is also specified, the selected value is automatically stored inthe screen field. Further export parameters are also stored there ifthey are found as input fields on the screen.
      If the user activated the ActiveX help, the help is started amodallyunder the following conditions:
      1. The screen information DYNPROG, DYNPNR and DYNPROFIELD must bedefined.
      2. When the function module is called, the RETURN_TAB may not bespecified. (If the call is amodal, the function module returns beforethe user has specified a value.)
      Normally values are only returned in input fields. This behavior can beinfluenced with the parameter DISPLAY (see parameter documentation).
      (At the moment it is not possible to determine if it is ready forinput. Development or correction of the screen area is necessary).

      Notes

      The input help key should only be activated in a screen field if thereis actually an input help available. To find out if there is an inputhelp for the Dictionary field, you can read the field information withmodule DDIF_NAMETAB_GET. Field F4AVAILABL instructure DFIES tells you if there is an input help available.
      Previously you had to assign DYNPPROG and DYNNR the contents ofSY-REPID and SY-DYNNR. However, for subscreens this information is notsufficient to uniquely define the screen. For reasons of compatibilitythe current screen is now determined internally as soon as DYNPPROG,DYNNR and DYNPROFIELD are passed and are not equal to SPACE. The actualcontents are no longer important, but you are nevertheless advised topass meaningful values to ensure the readability of the programs.
      The value for STEPL is outside a step loop 0. The current row can bestored within a step loop at time POV with the function moduleDYNP_GET_STEPL.
      If you do not want to return the selected value automatically, youshould not define parameters DYNPROG and DYNNR. At the moment valuesare not returned if MULTIPLE_SELECTION is selected either, but thiscould change in the future.

      Further information
      Note that documentation about some of the parameters is also available.

      Description
      Parameter is returned with 'X' if the user has chosen "deselect" on thehitlist with multiple selection, or if he or she has deselected theselected values by deselecting them individually.
      INCLUDE DDDOC_F4IF_CALLBACK_FORM OBJECT DOKU ID TX.

      Description
      With this parameter, you can pass a method that is called in a callbackcase alternatively to CALLBACK_FORM. For more information, refer to theparameter CALLBACK_FORM.
      This method must exist in the program CALLBACK_PROGRAM, analogous toCALLBACK_FORM.

      Description
      This parameter defines whether the F4 help should behave like an inputfield or like a pure display field.
      The F4 help for a field that is not an input field does not permit youto select values from the hit list.

      Value range
      SPACE: You can see in the screen field whether it is an input field. Ifthe screen information is missing, the default value is input field.
      'X': F4 help is called in display mode. It is not possible to select avalue from the hit list.
      'F' (Force Input): The module also displays the selected value on thescreen if the screen field is not an input field.

      Important note
      At the moment the module cannot itself recognize if it is an inputfield. (Development in the screen area is necessary). The default valueis therefore always "input field".

      Description
      Parameter SEARCHHELP permits the explicit definition of a search help.
      The F4 help then behaves as if the attribute "search help" were definedwith this name for the field in the screen. The values of TABNAME andFIELDNAME are of no importance.
      INCLUDE DDDOC_F4IF_SELECTION_SCREEN OBJECT DOKU ID TX

      Description
      The parameter is only meaningful if a value is defined in SEARCHHELP.
      It defines the search help parameter to be attached to the screenfield.
      If no value is defined (value SPACE), the first search help parameteris attached to the screen field. This corresponds to the behavior whena search help is directly attached to a field for the field attributesof the screen painter.

      Suppressing the hit list
      If this parameter is set, the hit list is selected but not displayed.The hits are placed in table RETURN_TAB.
      If this parameter has the value 'X':
      The hit list is not displayed.
      The maximum number of hits for the selection is not limited.(CALLCONTROL-MAXRECORDS = 0)
      Personal help values are not used. (CALLCONTROL-PVALUES = 'D'.)
      These settings should reflect the most common application. If you needother settings, you can overwrite CALLCONTROL in a CALLBACK form.
      Setting the parameter does not automatically suppress all dialogs.Depending on the search help, the dialoges for restricting and forselecting an elementary search help can still appear.

      Description
      Contents of the field for the F4 call. The contents are only passed ifthey contain a wildcard character. This corresponds to the standard F4behavior.
      If the parameter has been assigned the default value SPACE and thescreen information (DYNPPROG, DYNPNR, STEPL) is available, the moduleitself obtains the current contents.

      Description
      The selected value is returned in table RETURN_TAB if it was not copiedto screen fields in the module itself.
      Caution: Even though it is called with RETURN_TAB, up to Release 4.6Bthe help is started amodally as soon as the screen informationDYNPPROG, DYNPNR and DYNPROFIELD is passed and the user has activatedthe ActiveX help. In this case you cannot be sure that RETURN_TABcontains the selected lines of the hit list. In an amodal call, thefunction module ends before the user has made his choice.
      In most cases table RETURN_TAB has exactly one line containing thecontents of the return column from the selected line of the hit list infield FIELDVAL. (FIELDVAL contains the same display of data as the hitlist. For example, for date fields the separators are included from theuser settings)
      If RETURN_TAB does not contain a single line, the user terminated theselection or no value was selected.
      If there are multiple return columns or if multiple selection wasallowed, the table can contain more than one line.
      If there are multiple return columns, SHLPNAME and FIELDNAME are thenames of the search help parameters to which the value in FIELDVALbelongs. If the search help is unknown, the information in RETFIELD(see below) is usually more informative.
      In a multiiple selection (several lines of the hit list are selected)field RECORDPOS is used for numbering the lines, i.e. if three lineswere selected, all the columns of the first selected line are numberedwith RECORDPOS = 1 and all columns of the second line with RECORDPOS =2, etc.
      Field RETFIELD specifies the screen field belonging to the column if itis known. If there is only one return column, RETFIELD contains thefield name passed in DYNPROFIELD.