F4 search help manually called from report selection screen

Example code for for calling an SAP F4 search manually from a ABAP report selection screen.


**************************************************************
*Call search help.
DATA: return_tab type STANDARD TABLE OF DDSHRETVAL.
PARAMETERS p_test(10) type c.
************************************************
*AT SELECTION-SCREEN
AT SELECTION-SCREEN on VALUE-REQUEST FOR p_test.
  CALL FUNCTION 'F4IF_FIELD_VALUE_REQUEST'
    EXPORTING
      TABNAME           = 'T161'    "mandatory - dictionary table type
      FIELDNAME         = 'BSART'   "mandatory - dictionary field type
      SEARCHHELP        = 'H_T161'  "shelp
      SHLPPARAM         = 'BSART'   "field value to return from shelp
    TABLES
      RETURN_TAB        = return_tab
    EXCEPTIONS
      FIELD_NOT_FOUND   = 1
      NO_HELP_FOR_FIELD = 2
      INCONSISTENT_HELP = 3
      NO_VALUES_FOUND   = 4
      OTHERS            = 5.

Related Articles

Adding buttons to an ABAP report selection screen within SAP
Add buttons to Application toolbar of selection screen
Add buttons with icon to selection screen
Add buttons to dynamically change the selection screen entry fields
ABAP parameter as checkbox plus initiate 'AT selection-screen' EVENT to unselect other checkboxes
Initiate the 'AT selection-screen' EVENT from a checkbox
Dynamically alter a selection screen based on user
SAP dropdown list box for an ABAP report selection screen
Initiate the 'AT selection-screen' EVENT from a LISTBOX within an ABAP report sel screen
ABAP Radiobutton to Initiate the 'AT selection-screen' EVENT on SAP report
ABAP Begin of Block to group selection-screen fields plus add title and frame
Report Selection Screen - Example code and information on various sel screen processing techniques
Selection screen push buttons
Modify Selection Screen(LOOP AT SCREEN)
Restrict select-options to only allow specific restrictions
Radiobutton (inc desc) and entry field on same line of SAP selection screen
Add blank line to SAP report selection screen
Add Tab strip to Selection Screen