Field Help 

There are three ways of displaying field help for screen elements:

Data Element Documentation

If you place a field on the screen in the Screen Painter by copying a ABAP Dictionary field, the corresponding data element documentation from the ABAP Dictionary is automatically displayed when the user chooses field help (as long as the help has not been overridden in the screen flow logic).

For further information about creating data element documentation, refer to data elements.

Data Element Supplement Documentation

If the data element documentation is insufficient, you can expand it by writing a data element supplement

Data element supplement documentation contains the heading Definition, as well as the following others:

To create data element supplement documentation for a screen, choose Goto ® Documentation ® DE supplement doc. from the element list of the screen. A dialog box appears in which the system proposes a number as the identified for the data element supplement. You can then enter help texts for the above headings using the SAPscript editor.

Data element supplement documentation created in this way is program- and screen-specific. Any data element supplement documentation created in the ABAP Dictionary with the same number is overridden by the screen-specific documentation. You can link existing data element supplement documentation created in the ABAP Dictionary with a screen field by using the table THLPF. To do this, crate a new row in THLPF containing the following data: Program name, screen name, field name, and number of the data element supplement documentation.

To display data element supplement documentation, you must code the following screen flow logic in the POH event:

PROCESS ON HELP-REQUEST.
...
  FIELD <f> [MODULE <mod>] WITH <num>.
...

After PROCESS ON HELP-REQUEST, you can only use FIELD statements. If there is no PROCESS ON HELP-REQUEST keyword in the flow logic of the screen, the data element documentation for the current field, or no help at all is displayed when the user chooses F1. Otherwise, the next FIELD statement containing the current field <f> is executed.

If there is screen-specific data element supplement documentation for the field <f>, you can display it by specifying its number <num>. The number <num> can be a literal or a variable. The variable must be declared and filled in the corresponding ABAP program.

You can fill the variables, for example, by calling the module <mod> before the help is displayed. However, the FIELD statement does not transport the contents of the screen field <f> to the ABAP program in the PROCESS ON HELP-REQUEST event.

For further information about data element supplement documentation, refer to Data Element Supplements.

Calling Help Texts from Dialog Modules

If data element supplement documentation is insufficient for your requirements, or you want to display help for program fields that you have not copied from the ABAP Dictionary, you can call dialog modules in the POH event:

PROCESS ON HELP-REQUEST.
...
  FIELD <f> MODULE <mod>.
...

After the PROCESS ON HELP-REQUEST statement, you can only use the MODULE statement together with the FIELD statement. When the user chooses F1 for a field <f>, the system calls the module <mod> belonging to the FIELD <f> statement. If there is more than one FIELD statement for the same field <f>, only the first is executed. However, the contents of the screen field <f> are not available in the module <mod>, since it is not transported by the FIELD statement during the PROCESS ON HELP-REQUEST event. The field help should not be dependent on the user input.

The module <mod> is defined in the ABAP program like a normal PAI module. The processing logic of the module must ensure that adequate help is displayed for the field in question. Instead of calling an extra screen with text fields, you should use one of the following function modules to display a suitable SAPscript document:

This function module displays the data element documentation for components of any structure or database table from the ABAP Dictionary. You pass the name of the component and structure or table to the import parameters FIELD and TABLE.

Use this function module to display any SAPscript document. You must pass the document class (for example, TX for general texts, DE for data element documentation) and the name of the document to the import parameters DOKCLASS and DOKNAME. For technical reasons, you must also pass an empty internal table with the line type TLINE to the tables parameter of the function module.

For further information about how to create SAPscript documents, refer to the Documentation of System Objects documentation.

Field help on screens.

REPORT DEMO_DYNPRO_F1_HELP.

DATA:  TEXT(30),
       VAR(4),
       INT TYPE I,
       LINKS TYPE TABLE OF TLINE,
       FIELD3, FIELD4.

TABLES DEMOF1HELP.

TEXT = TEXT-001.

CALL SCREEN 100.

MODULE CANCEL INPUT.
  LEAVE PROGRAM.
ENDMODULE.

MODULE F1_HELP_FIELD2 INPUT.
  INT = INT + 1.
  CASE INT.
    WHEN 1.
    VAR = '0100'.
    WHEN 2.
    VAR = '0200'.
    INT = 0.
  ENDCASE.
ENDMODULE.

MODULE F1_HELP_FIELD3 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_FIELD4 INPUT.
  CALL FUNCTION 'HELP_OBJECT_SHOW'
       EXPORTING
            DOKCLASS                      = 'TX'
            DOKLANGU                      = SY-LANGU
            DOKNAME                       = 'DEMO_FOR_F1_HELP'
            DOKTITLE                      = TEXT-003
       TABLES
            LINKS                         = LINKS.
ENDMODULE.

The next screen (statically defined) for screen 100 is 100. It has the following layout:

The screen fields DEMOf1HELP-FIELD1 and DEMOF1HELP-FIELD2 from the ABAP Dictionary and the program fields FIELD3 and FIELD4 are assigned to the input fields. The pushbutton has the function code CANCEL with 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-FIELD2 MODULE F1_HELP_FIELD2 WITH VAR.
  FIELD FIELD3 MODULE F1_HELP_FIELD3.
  FIELD FIELD4 MODULE F1_HELP_FIELD4.

The components FIELD1 and FIELD2 of structure DEMOF1HELP both refer to the data element DEMOF1TYPE. This data element is documented, and also has two supplements with numbers 0100 and 0200.

The following field help is displayed: