Skip to content

F4IF_INT_TABLE_VALUE_REQUEST

Show a custom F4 popup from any internal table — the standard way to implement dynamic value help in ABAP selection screens and dynpros.

Purpose

F4IF_INT_TABLE_VALUE_REQUEST displays an internal table as an F4 search-help dialog. The user sees a list of values (optionally with multiple columns), makes a selection, and the chosen value is returned to the calling field. Use it in AT SELECTION-SCREEN ON VALUE-REQUEST FOR events or from any dynpro POV.

Signature (key parameters)

Parameter Direction Type Description
RETFIELD Importing HELP_INFO-SHLPFIELD Field name in VALUE_TAB whose value is returned
DYNPPROG Importing HELP_INFO-DYNPPROG Calling program name (usually sy-repid)
DYNPNR Importing HELP_INFO-DYNPNR Dynpro number (usually sy-dynnr)
DYNPROFIELD Importing HELP_INFO-DYNPROFIELD Screen field to fill with selected value
STEPL Importing SY-STEPL Table control line (only needed in table controls)
WINDOW_TITLE Importing STRING Popup title
VALUE_ORG Importing CHAR1 'S' = structure-based, 'C' = column-based
VALUE_TAB Tables STANDARD TABLE The data to display
FIELD_TAB Tables DFIES Column definitions (field name + label)

Example — custom F4 on a selection screen parameter

REPORT z_custom_f4.

SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME.
  PARAMETERS p_plant TYPE werks_d.
SELECTION-SCREEN END OF BLOCK b1.

AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_plant.

  TYPES: BEGIN OF ty_plant,
           werks TYPE werks_d,
           name1 TYPE t001w-name1,
         END OF ty_plant.

  DATA lt_plants TYPE STANDARD TABLE OF ty_plant.

  " Build the value list from database
  SELECT werks, name1
    FROM t001w
    INTO TABLE @lt_plants
    ORDER BY werks.

  " Define columns shown in the popup
  " tabname must be a DDIC table/structure name — not a local type
  DATA lt_fields TYPE STANDARD TABLE OF dfies.
  APPEND VALUE #( tabname = 'T001W' fieldname = 'WERKS' keyflag = 'X' ) TO lt_fields.
  APPEND VALUE #( tabname = 'T001W' fieldname = 'NAME1' ) TO lt_fields.

  CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
    EXPORTING
      retfield        = 'WERKS'
      dynpprog        = sy-repid
      dynpnr          = sy-dynnr
      dynprofield     = 'P_PLANT'
      window_title    = 'Select Plant'
      value_org       = 'S'
    TABLES
      value_tab       = lt_plants
      field_tab       = lt_fields
    EXCEPTIONS
      parameter_error = 1
      no_values_found = 2
      OTHERS          = 3.

Example — F4 in a dynpro module pool

" In a PAI module called for a PROCESS ON VALUE-REQUEST event:
MODULE f4_material INPUT.

  DATA lt_mats TYPE STANDARD TABLE OF mara.

  SELECT matnr
    FROM mara
    WHERE mtart = 'FERT'
    INTO TABLE @lt_mats
    UP TO 200 ROWS.

  CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
    EXPORTING
      retfield    = 'MATNR'
      dynpprog    = sy-repid
      dynpnr      = sy-dynnr
      dynprofield = 'WA_SCREEN-MATNR'
      value_org   = 'S'
    TABLES
      value_tab   = lt_mats
    EXCEPTIONS
      OTHERS      = 1.

ENDMODULE.

Common pitfalls

DYNPROFIELD must match the screen field name exactly

The field name is case-sensitive and must match the screen field name as defined in Screen Painter (SE51), not the ABAP variable name. A mismatch causes no error — the selected value is simply not transferred.

VALUE_ORG = 'S' requires a flat structure

With VALUE_ORG = 'S', VALUE_TAB must be a table of a flat structure. Nested structures or references are not supported.

  • FIELD_TAB is optional: If omitted, all fields in the structure are shown as columns with technical names as headers. Providing FIELD_TAB lets you choose which columns appear and set user-friendly labels.
  • FIELD_TAB tabname must be a DDIC name: The tabname in each DFIES row must be a Data Dictionary table or structure name (e.g. 'T001W'), not a local ABAP type. Using a local type causes the popup to appear empty because the FM cannot resolve field metadata.
  • SELECTFLAG: Set SELECTFLAG = 'X' on the field whose value is returned on selection. Without it, the user can select a row but nothing is transferred.
  • Multiple return values: Use F4IF_FIELD_VALUE_REQUEST instead if the search help is attached to a Data Dictionary field — it handles multi-value returns automatically.

See also

  • Custom F4 help tutorial — step-by-step guide with selection screen and dynpro examples
  • Transaction SE11 — attach a search help to a table field to avoid custom F4 code
  • Transaction SE51 — Screen Painter, where dynpro field names are defined

Comments