F Custom F4 Help program in SAP ABAP | CodeTheta

Custom F4 Help program in SAP ABAP

September 11, 2019

Code :
REPORT ZVP_F4_HELP.

PARAMETERSP_NAME TYPE CHAR10.

AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_NAME.
  PERFORM GET_HELP.

AT SELECTION-SCREEN.
  IF P_NAME 'HELLO'.
    MESSAGE 'SUCCESS' TYPE 'S'.
  ENDIF.

FORM GET_HELP.

  TYPESBEGIN OF TY_HELP,
           NAME TYPE CHAR15,
         END OF TY_HELP.

  DATAIT_HELP   TYPE STANDARD TABLE OF TY_HELP,
        WA_HELP   TYPE TY_HELP,

        IT_RETURN TYPE TABLE OF DDSHRETVAL,
        WA_RETURN TYPE DDSHRETVAL.

  WA_HELP-NAME 'HELLO'.
  APPEND WA_HELP TO IT_HELP.
  CLEAR WA_HELP.

  WA_HELP-NAME 'WORLD'.
  APPEND WA_HELP TO IT_HELP.
  CLEAR WA_HELP.

  CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
    EXPORTING
      RETFIELD   'NAME'
      VALUE_ORG  'S'
    TABLES
      VALUE_TAB  IT_HELP
      RETURN_TAB IT_RETURN.

*read and transfer the selected value to field / parameter.
  READ TABLE IT_RETURN INTO WA_RETURN INDEX 1.
  P_NAME WA_RETURN-FIELDVAL.

ENDFORM.


Output :

IDE Used To Test This Code : SAP Login 730.

Try this code in your computer for better understanding. Enjoy the code. If you have any Question you can contact us or mail us.We will reply you as soon as possible.

Post a Comment