Skip to content

ABAP Keyword Documentation →  ABAP - Reference →  User Dialogs →  Screens →  Statements in the Screen Flow Logic →  FIELD →  Field and Input Help →  Field and Input Helps - Examples 

Screens, Field Help

The example shows how to implement field help on screens.

Other versions: 7.31 | 7.40 | 7.54

Source Code

REPORT demo_dynpro_f1_help.

DATA:  text     TYPE c LENGTH 30,
       docu_num TYPE c LENGTH 4,
       int      TYPE i,
       links    TYPE TABLE OF tline,
       field5   TYPE c LENGTH 10,
       field6   TYPE c LENGTH 10.

TABLES demof1help.

text = text-001.

CALL SCREEN 100.

MODULE cancel INPUT.
  LEAVE PROGRAM.
ENDMODULE.

MODULE f1_help_field4 INPUT.
  int = int + 1.
  CASE int.
    WHEN 1.
      docu_num = '0100'.
    WHEN 2.
      docu_num = '0200'.
      int = 0.
  ENDCASE.
ENDMODULE.

MODULE f1_help_field5 INPUT.
  CALL FUNCTION 'HELP_OBJECT_SHOW_FOR_FIELD'
       EXPORTING
            doklangu         = sy-langu
            doktitle         = text-002
            called_for_tab   = 'DEMOF1HELP'
            called_for_field = 'FIELD1'.
ENDMODULE.

MODULE f1_help_field6 INPUT.
  CALL FUNCTION 'HELP_OBJECT_SHOW'
       EXPORTING
            dokclass = 'TX'
            doklangu = sy-langu
            dokname  = 'DEMO_FOR_F1_HELP'
            doktitle = text-003
       TABLES
            links    = links.
ENDMODULE.

Description

The static next screen number of screen 100 is 100. The input fields have been assigned the screen fields DEMOF1HELP-FIELD1, DEMOF1HELP-FIELD2, DEMOF1HELP-FIELD3, and DEMOF1HELP-FIELD4 from the ABAP Dictionary and the fields field5 und field6 from the ABAP program. The function code of the pushbutton is CANCEL with the function type E. The screen flow logic is as follows:

PROCESS BEFORE OUTPUT.
PROCESS AFTER INPUT.
  MODULE cancel AT EXIT-COMMAND.
PROCESS ON HELP-REQUEST.
  FIELD demof1help-field4 MODULE f1_help_field4 WITH docu_num.
  FIELD field5 MODULE f1_help_field5.
  FIELD field6 MODULE f1_help_field6.

The components FIELD1 to FIELD4 of the structure DEMOF1HELP refer to the data element DEMOF1TYPE. For this data element, the data element documentation as well as two additional data element documentation items with the numbers 0100 and 0200 are created. The following field help is displayed to the user:

  • If the user chooses F1 in the input field for DEMOF1HELP-FIELD1, the system displays the data element documentation of DEMOF1TYPE since the field is not listed after PROCESS ON HELP-REQUEST.
  • If the user chooses F1 in the input fields for DEMOF1HELP-FIELD2 and DEMOF1HELP-FIELD3, the system displays the additional data element documentation items 0100 and 0200 respectively in addition to the data element documentation. The corresponding assignments are created statically in database table THLPF.
  • If the user chooses F1 several times in the input field for DEMOF1HELP-FIELD4, the additional data element documentation items 0100 and 0200 are displayed alternately in addition to the data element documentation. The variable docu_num is maintained accordingly in dialog module f1_help_field2.
  • If the user chooses F1 in the input field for field5, the system displays the data element documentation of DEMOF1TYPE since this is called in the dialog module f1_help_field5 by the function module HELP_OBJECT_SHOW_FOR_FIELD.
  • If the user chooses F1 in the input field for field6, the system displays the SAPscript document DEMO_FOR_F1_HELP since this is called in the dialog module f1_help_field6 by the function module HELP_OBJECT.