Show TOC

Adding Documentation of Parameters and Exceptions in ABAP Doc CommentsLocate this document in the navigation structure

You can document parameters and exceptions for methods, events, functions modules, and subroutines.

Context

This function supports you in listing all undocumented parameters and exceptions that relate to the selected element.

Note

If you have already added parameters in an ABAP Doc comment and made changes in the meantime, you can also add the new parameters with this function. Thus, only the new parameters will be added. Parameters and exceptions that are already documented will not be changed.

In the ABAP Language Help (through F1 in the source editor), you will find further information about using the syntax of ABAP Doc comments.

Procedure

  1. In the source code editor, navigate to the definition part of the element of the relevant code line.
  2. [Optional]: If no ABAP Doc comment exists, enter "! to start the comment line.
    Example

    Example of an empty ABAP Doc comment:

    "!
    METHODS method_with_variable.
    Note Choose Enter to add a new row for further comments. The editor will automatically start the new row with "!
  3. Place the cursor on the position where you want to add the missing parameters or exception.
  4. In the context menu, choose Quick Fix (Ctrl 1), and select Add missing parameters to documentation to add the syntax of the missing parameters and exceptions.
    The name of the missing parameters are added and introduced by a @. You can describe each parameter or exception with the corresponding documentation after the |.
    Note

    Every parameter or exception should occupy a separate line in order to keep the source code readable.

    Example

    Example of a type definition added as an ABAP Doc comment:

    "! @parameter p1 |
    METHODS method_with_variable.
  5. Save the changes.

Results

The documentation is saved and displayed in the source code editor of the ADT and the SAP GUI.