ABAP Add SearchHelp on Parameter: a step-by-step tutorial how to add a custom Search Help / Value Request for a Parameter in Selection screen in ABAP Code.
Table of Contents
In order to add a Search Help or Value Request for a parameter on Selection Screen, you have two alternative
The main action/ event to catch if you want to add the Search help is AT SELECTION-SCREEN ON VALUE-REQUEST FOR PARAMETER.
In this event, you can fill the list with value which will displayed in SAP Popup as table and the user can selection one of them. Use the SAP Standard Function F4IF_INT_TABLE_VALUE_REQUEST to handle the display and the selection.
The steps to be followed in ABAP code :
This sample ABAP snippet will help you add a custom Value Request or a Search Help for parameter in Selection option screen.
The parameter P_TABLE in this case is a SAP DDIC Table Name.
Note that the reference SAP Table for Tables is DD02L and DD02T for Text (SAP Table Description).
NB: Caution about the number of Table entries to be retrieved. (in the example, only SAP custom tables are considered)
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_table. " Structure of SAP Value Request PopUp Table value TYPES: BEGIN OF ty_tab, tabname LIKE dd02t-tabname, ddtext LIKE dd02t-ddtext, END OF ty_tab. " Table for Value Request Data Selection DATA: lt_entries TYPE TABLE OF ty_tab . " Selected line from the Value Request SAP PopUp DATA: lt_return TYPE TABLE OF ddshretval. FIELD-SYMBOLS: <fs_return> LIKE LINE OF lt_return. REFRESH lt_entries[]. "-------------------------------------------------------------" " Retrieve list of value " "-------------------------------------------------------------" " DD02L : SAP DDIC Table for Tables " DD02T : SAP DDIC Tables Description (Text) SELECT tabname ddtext FROM dd02t INTO TABLE lt_entries WHERE tabname Like 'Z%' " Only SAP Custom Table AND ddlanguage = sy-langu. " Only for SAP connected Language "-------------------------------------------------------------" " Build Table PopUp for Value Request " "-------------------------------------------------------------" CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST' EXPORTING ddic_structure = ' ' retfield = 'P_TABLE' pvalkey = ' ' dynpprog = ' ' dynpnr = ' ' dynprofield = ' ' stepl = 0 window_title = 'Select the DDIC Table' value = ' ' value_org = 'S' multiple_choice = ' ' display = ' ' callback_program = ' ' callback_form = ' ' TABLES value_tab = lt_entries return_tab = lt_return EXCEPTIONS parameter_error = 1 no_values_found = 2 OTHERS = 3 . IF sy-subrc <> 0. MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4. ENDIF. "-------------------------------------------------------------" " Read the Selected line for SAP Parameter Custom Search Help " "-------------------------------------------------------------" READ TABLE lt_return ASSIGNING <fs_return> INDEX 1. IF sy-subrc = 0. p_table = <fs_return>-fieldval. ENDIF.
For more detail about SAP search help, check Search Helps
SAP ISU Tables for Technical master data, for Billing Master Data, Billing and invoicing Tables?…
SAP Fiori 3 UX and Design of SAP Fiori Apps for SAP S/4HANA, SAP TechEd…
Dunning is the business practice of informing a customer of past due payment. Dunning letters…
SAP AP Tcodes & SAP AR Tcodes: House Banks Tcodes, Advance Payments or Down Payments,…
What are the main SAP Payment Terms Tables ? What are the related Tables in…
Work center consists of master data related to routing of products. It contains data related…