ABAP Doc enables you to document code elements (for example, attributes, methods, local variables) as ABAP Doc comments. Such a comment consisting of one or more comment lines, each of which is prefixed by "!.
ABAP Doc is supported if your Eclipse-based IDE is connected with SAP NetWeaver 7.4 SP03 or higher.
ABAP Doc comments consist of a single comment line or a coherent block of several comment lines. In the source code editor, they can be placed in an empty line directly in front of a declarative statement like data declarations, method definition, class definitions, and so on.
In the following example, the ABAP Doc comments are added one line before the corresponding declarative statements:
"! <p class="shorttext synchronized" lang="en">ABAP class that contains ABAP Doc</p> CLASS cl_demo_importing_description DEFINITION PUBLIC. PUBLIC SECTION. "! <p class="shorttext synchronized" lang="en">Attribute 1</p> DATA myself TYPE REF TO cl_demo_importing_description . "! <p class="shorttext synchronized" lang="en">Attribute 2</p> DATA any_string1 TYPE c . "! Method to check if two sources are identical "! "! @parameter source1 | First source "! @parameter source2 | Second source "! @parameter ignore_case | Pass abap_true to ignore case "! "! @parameter result | Returns abap_true if sources are identic "! "! @raising cx_aab_static | One of the sources is empty METHODS method_with_variable IMPORTING source1 TYPE text source2 TYPE text ignore_case TYPE abap_bool DEFAULT abap_false RETURNING VALUE(result) TYPE abap_bool RAISING cx_aab_static. ENDCLASS.
If you show the ABAP Element Info view in the ABAP perspective and select the method name in the source code editor, the corresponding ABAP Doc comment is displayed:
The source code editor verifies the position and the content structure of ABAP Doc comments when you execute the ABAP syntax check. So, if comments are added at the wrong position or contain incorrect syntax, a warning is displayed in the Problems view.
ABAP Doc comments can be displayed in the code element information popup, ABAP Element Info view, and code completion list in order to provide developers further information about the source code. In the SAP GUI, they are displayed in the ABAP editor. They contain descriptions, parameter definitions, and such like as well as describe code elements (for example, classes, attributes, methods, local variables) of a development object.
To display documentation, ABAP Development Tools for SAP NetWeaver (ADT) checks the availability of the respective content:
To predefine the formatting of ABAP doc comments, open the ABAP Docu Font entry.
preference page. From there, expand the folders and edit the