Skip to content

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

Dynpros, Field Help

This example demonstrates how a field help is implemented on dynpros.

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 dynpro number of dynpro 100 is 100. The input fields are assigned the fields DEMOF1HELP-FIELD1, DEMOF1HELP-FIELD2, DEMOF1HELP-FIELD3, and DEMOF1HELP-FIELD4 from ABAP Dictionary and the fields field5 and 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 through FIELD4 of the structure DEMOF1HELP refer to the data element DEMOF1TYPE. This data element is documented, and also has two supplements with numbers 0100 and 0200. The user sees the following field help:

  • If the user chooses F1 on 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 repeatedly for the input fields DEMOF1HELP-FIELD2 and DEMOF1HELP-FIELD3, the data element documentation is displayed, along with the supplement documentation for either 0100 or 0200. The necessary assignments are stored statically in the database table THLPF.
  • If the user chooses F1 repeatedly for the input field DEMOF1HELP-FIELD4, the data element documentation is displayed, along with the supplement documentation for either 0100 or 0200. The variable docu_num is filled accordingly in the dialog module f1_help_field2.
  • If the user chooses F1 on 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 on 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.