F4 HELP CODE SAP ABAP | SEARCH HELP ABAP PROGRAM EXAMPLE| F4IF_INT_TABLE_VALUE_REQUEST| DDSHRETVAL
Hello all in this article we will se an example program of custom search help, Sometime we have requirement to create a search help from z table into a program so here we will create a custom search help in program.

SEARCH HELP ABAP PROGRAM EXAMPLE
This program demonstrate how to create “Help Value Request”. It will appear when user pressing F4 (help) on an input field to request list of available value. The available value from z table.
- Build an internal table for the dynamic help of field on the selection screen based on the value read from the any Z table.
- (IT_ZMM_PRD_TYP TYPE TABLE OF ZMM_PRD_TYP)
- To handle the value after return from program create internal table type table of DDSHRETVAL .
- (IT_DDSHRETVAL TYPE TABLE OF DDSHRETVAL)
- Display the F4 help using function module F4IF_INT_TABLE_VALUE_REQUEST.
- Declare the PARAMETER or SELECT OPTION field for search value request.
- (PARAMETER: P_PRDCAT TYPE ZMM_PRD_TYP-PRDCAT)
- Call the Event AT SELECTION-SCREEN ON VALUE-REQUEST for Fieldname.
- (AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_PRDCAT).
- Call function module F4IF_INT_TABLE_VALUE_REQUEST and export the required value.
F4 HELP CODE SAP ABAP
F4 HELP CODE SAP ABAP
DATA: IT_ZMM_PRD_TYP TYPE TABLE OF ZMM_PRD_TYP.
DATA: IT_DDSHRETVAL TYPE TABLE OF DDSHRETVAL,
WA_DDSHRETVAL TYPE DDSHRETVAL.
PARAMETERS: RD_UPAPP RADIOBUTTON GROUP RD1 DEFAULT 'X'.
PARAMETER : P_FILE TYPE RLGRAP-FILENAME OBLIGATORY ."DEFAULT " Input File
PARAMETER: UPD_FILE(20) TYPE C.
PARAMETERS: RD_LOCAL RADIOBUTTON GROUP RD1,
RD_APP RADIOBUTTON GROUP RD1.
PARAMETER : P_EXT AS CHECKBOX.
PARAMETER: P_PRDCAT TYPE ZMM_PRD_TYP-PRDCAT ."OBLIGATORY.
SELECT-OPTIONS: S_WERKS FOR ZMM_MAT_PLANT-WERKS NO INTERVALS ."OBLIGATORY.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_prdcat.
PERFORM f4_help_prdcat.
FORM f4_help_prdcat.
CLEAR: IT_DDSHRETVAL,
WA_DDSHRETVAL.
CLEAR: IT_ZMM_PRD_TYP.
SELECT * FROM ZMM_PRD_TYP INTO TABLE IT_ZMM_PRD_TYP.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
* DDIC_STRUCTURE = ' '
RETFIELD = 'PRDCAT'
* PVALKEY = ' '
* DYNPPROG = ' '
* DYNPNR = ' '
* DYNPROFIELD = ' '
* STEPL = 0
* WINDOW_TITLE =
* VALUE = ' '
VALUE_ORG = 'S'
* MULTIPLE_CHOICE = ' '
* DISPLAY = ' '
* CALLBACK_PROGRAM = ' '
* CALLBACK_FORM = ' '
* CALLBACK_METHOD =
* MARK_TAB =
* IMPORTING
* USER_RESET =
TABLES
VALUE_TAB = IT_ZMM_PRD_TYP
* FIELD_TAB =
RETURN_TAB = IT_DDSHRETVAL
* DYNPFLD_MAPPING =
EXCEPTIONS
PARAMETER_ERROR = 1
NO_VALUES_FOUND = 2
OTHERS = 3.
IF SY-SUBRC EQ 0.
READ TABLE IT_DDSHRETVAL INTO WA_DDSHRETVAL INDEX 1.
P_PRDCAT = WA_DDSHRETVAL-FIELDVAL.
ENDIF.
ENDFORM.

Interface Structure Search Help <-> Help System — DDSHRETVAL
DDSHRETVAL is an SAP Structure which is not store data like a database table instead of that it can be used to process “Interface Structure Search Help <-> Help System” Information within SAP ABAP programs. This is done by declaring abap internal tables, work areas based on this DDSHRETVAL Structure. These internal table and work area can be used to store and process the required data appropriately.

Field | Description | Data element | Datatype | Length | Decimals |
SHLPNAME | Name of a search help | DDSHLPNAME | CHAR | 30 | 0 |
FIELDNAME | Field Name | FIELDNAME | CHAR | 30 | 0 |
RECORDPOS | Record position in the matchcode F4 output table | RECORDPOS | NUMC | 4 | 0 |
FIELDVAL | Field contents, min./max. value | SHVALUE_D | CHAR | 132 | 0 |
RETFIELD | Field name | DYNFNAM | CHAR | 132 | 0 |
F4IF_INT_TABLE_VALUE_REQUEST
F4IF_INT_TABLE_VALUE_REQUEST is a standard SAP function module in SAP systems . Below we discussed the pattern details for this Function Module showing its interface including any import and export parameters or tables.
F4IF_INT_TABLE_VALUE_REQUEST function mandatory fields or tables are:
RETFIELD TYPE DFIES-FIELDNAME (Name of return field in FIELD_TAB).
VALUE_TAB (Table of values: entries cell by cell).

OUTPUT


FAQ F4IF_INT_TABLE_VALUE_REQUEST
What is the function module for custom search help?
Function module used for custom search help is “F4IF_INT_TABLE_VALUE_REQUEST”.
Name the interface structure used to store value.
Interface Structure Search Help <-> Help System — DDSHRETVAL.
What event we use for value search request?
Event we call for value request is “AT SELECTION-SCREEN ON VALUE-REQUEST FOR Field_Name”.
How to access F4 key in any parameter or select option field?
To create F4 key access to any parameter or select option field we will call the event “AT SELECTION-SCREEN ON VALUE-REQUEST FOR” with parameter or select option field.
You May Also Like:
- What is Search Help in SAP ABAP
- How to create elementary search help in sap abap ?
- How to create Collective search help in SAP ABAP ?
- Cell Color in ABAP ALV Grid Report | Cell Color in ALV Grid Display
- BAPI_PO_CREATE1
For the next blog please connect with us and follow us on twitter.com/einfonett