Show TOC

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

Context

For methods, events, functions modules, and subroutines, you can document parameters and exceptions. This function supports you in listing all undocumented parameters and exceptions that relate to the selected element.

The name of an existing parameter or an exception must be specified using the following syntax:

Parameters and Exceptions Syntax
Parameters @parameter <parameter name> | <parameter documentation>
Class-based exceptions @raising <exception name> | <exception documentation>
Classic exceptions @exception <exception name> | <exception documentation>
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.

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 of an empty ABAP Doc comment:

    "!
    METHODS method_with_variable.
    Note Press 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. 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.

    Example

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

    "! @parameter p1 |
    METHODS method_with_variable.

    Example

    In the source code, you 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.
  4. Save the changes.

Results

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