SAP NetWeaver AS ABAP Release 740, ©Copyright 2014 SAP AG. All rights reserved.
ABAP Keyword Documentation → ABAP − Reference → ABAP Syntax → Program Directives →ABAP Doc
ABAP Doc allows declarations in ABAP programs to be documented, based on special ABAP Doc comments. ABAP development environments that support ABAP Doc, such as ABAP Development Tools, analyze the content of ABAP Doc comments, convert it to HTML and display it appropriately.
Programming Guidelines
The following guidelines for general comments also specifically apply to ABAP-DOC comments.
ABAP Doc Comments
A comment for ABAP Doc is introduced using the string "!. This is a special form of a normal line end comment that is introduced using ". The following rules must be applied if an ABAP Doc comment is to be read correctly:
If this rule is broken, a syntax check warning is produced.
Example
Basic use of ABAP Doc - comments as single lines, blocks and chained statements.
Parameter Interface of Procedures
The parameter interface for procedures and for events in classes can be documented in the corresponding ABAP Doc commentary with a special syntax:
Documentation for | Syntax |
Interface Parameters | @parameter name|documentation |
Class-based exception | @raising name|documentation |
Classical exceptions | @exception name|documentation |
The name (name) of an existing parameter or an exception must be specified after @parameter, @raising, @exception. This must be followed by the documentation (separated by |). This documentation is completed by the next @parameter, @raising, @exception or by the end of the ABAP-Doc comment. In other words, no further documentation or interface documentation can be placed behind the interface documentation. Every interface parameter or every exception can only be listed once.
Note
The sequence of the documentation for procedure parameters is not dependent on the line sequence in an ABAP Doc block. However, every parameter or exception should occupy a separate line, to make the documentation easier to read. This is also the reason why the sequence of parameters and exceptions in the ABAP Doc comment should be the same as the sequence of declarations.
Example
Use of ABAP Doc comments for the parameter interface of a method.
Formatting
The following tags are used in documentation texts for ABAP Doc comments, to format the documentation display in a development environment.
Formatting | Tag |
Header, level1 | <h1>...</h1> |
Header, level2 | <h2>...</h2> |
Header, level3 | <h3>...</h3> |
Paragraph | <p>...</p> |
Italic text | <em>...</em> |
Bold text | <strong>...</strong> |
Unnumbered list | <ul><li>...</li>...<li>...</li></ul> |
Numbered list | <ol><li>...</li>...<li>...</li></ol> |
Line break | <br/> or <br></br> |
An open tag must be closed before a new section of the ABAP Doc comment is started. A new section is introduced using @parameter, @raising or @exception.
The tags are a subset of HTML tags that must be specified in an XHTML notation.
Example
Use of formatting in an ABAP Doc comment for a class. The ABAP Development Tools display the documentation with the appropriate formatting.