Registration

Dear SAP Community Member,
In order to fully benefit from what the SAP Community has to offer, please register at:
http://scn.sap.com
Thank you,
The SAP Community team.
Skip to end of metadata
Go to start of metadata

This example shows how to program the ON VALUE-REQUEST event on selection screens to allow the F4 key / search help button on a field, instead of letting the default system behavior (none, search help, value table, etc.) In this example, a popup dialog is displayed to show a list of values and it allows the user to select and return a value into the selection screen field.

Error rendering macro 'code': Invalid value specified for parameter 'lang'
*&---------------------------------------------------------------------*
*& Report  YKC_SEARCH_HELP
*&
*&---------------------------------------------------------------------*
*&Making Search Help
*&Name: Krishna Chauhan (Sparta)  Date: 19 Dec 08
*&---------------------------------------------------------------------*
REPORT  YKC_SEARCH_HELP.
*internal table made to populate the value of werks when pressing f4
DATA: BEGIN OF IT_FINAL OCCURS 0,
      WERKS TYPE MARC-WERKS,
      END OF IT_FINAL.
DATA: IT_RETURN LIKE DDSHRETVAL OCCURS 0 WITH HEADER LINE.
PARAMETERS: P_WERKS(10) TYPE C.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_WERKS.
  SELECT  WERKS FROM MARC
  INTO TABLE IT_FINAL.
  CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
    EXPORTING
*   DDIC_STRUCTURE         = ' '
      RETFIELD               = 'WERKS'   "field of internal table
     VALUE_ORG              = 'S'
    TABLES
      VALUE_TAB              = IT_FINAL
*   FIELD_TAB              =
     RETURN_TAB             = IT_RETURN
            .
  WRITE IT_RETURN-FIELDVAL TO P_WERKS.
  REFRESH IT_FINAL.