Do you have any question about this error?
Message type: E = Error
Message class: SABAP_DOC - ABAP Doc messages
Message number: 106
Message text: ABAP Doc comments behind statements are not allowed
The ABAP-Doc-comment is located at the wrong position in the source
code.
An ABAP-Doc-comment-block is introduced by the character combination "!.
It has to be located directly in front of a declarative statement (e.g.,
data declaration, method definition, class definition).
The system issues an error message and will not allow you to continue with this transaction until the error is resolved.
ExampleSyntax check returns a warning.
Put the ABAP-Doc comment at the right position in the source code.
If the comment is not an ABAP-Doc-comment, but a standard comment and
starts with the character combination "!, you can add a space between
the characters " and ! to declare this comment as standard comment.
Error message extract from SAP system. Copyright SAP SE.
SABAP_DOC106
- ABAP Doc comments behind statements are not allowed ?The SAP error message SABAP_DOC106 indicates that there are ABAP documentation comments (using the
*
syntax) placed directly behind ABAP statements, which is not allowed in the ABAP programming language. This error typically occurs when you try to document your code in a way that is not compliant with the ABAP syntax rules.Cause:
In ABAP, documentation comments must be placed on their own line or must be formatted correctly. The error occurs when you attempt to place a comment directly after a statement on the same line, which is not permitted for documentation comments.
Example of the Error:
DATA: lv_value TYPE i. " This is a regular comment lv_value = 10. " This is a documentation comment and will cause SABAP_DOC106
Solution:
To resolve this error, you need to ensure that your documentation comments are placed correctly. Here are the steps to fix it:
Move the Documentation Comment: Place the documentation comment on a separate line before the statement or use the correct syntax for inline comments.
Correct Example:
" This is a documentation comment DATA: lv_value TYPE i. lv_value = 10. " This is a regular comment
Use Inline Comments Appropriately: If you want to use inline comments, ensure they are not ABAP documentation comments. Use the regular comment syntax (
"
) for inline comments.Related Information:
ABAP Documentation Comments: In ABAP, documentation comments are typically used to provide detailed descriptions of classes, methods, and other program elements. They are usually formatted using the *
syntax and should be placed above the code they describe.
ABAP Syntax Rules: Familiarize yourself with the ABAP syntax rules to avoid similar errors. The SAP Help Portal and ABAP documentation provide comprehensive guidelines on how to write comments and documentation in ABAP.
ABAP Development Tools: If you are using tools like ABAP Development Tools (ADT) in Eclipse, they often provide real-time syntax checking and can help you identify such issues before you attempt to activate or run your code.
By following these guidelines, you should be able to resolve the SABAP_DOC106 error and write compliant ABAP code.
Get instant SAP help. Start your 7-day free trial now.
SABAP_DOC105
Wrong position for ABAP Doc comment in a chained statement
What causes this issue? The ABAP-Doc-comment is located at the wrong position in the source code. An ABAP-Doc-comment-block is introduced by the char...
SABAP_DOC104
ABAP Doc comments must contain documentation
Self-Explanatory Message Since SAP believes that this specific error message is 'self-explanatory,' no more information has been given.The majority of...
SABAP_DOC107
'{@' is a reserved string in ABAP Doc
Self-Explanatory Message Since SAP believes that this specific error message is 'self-explanatory,' no more information has been given.The majority of...
SABAP_DOC108
Tag '&1' is not expected, because it has not been opened
Self-Explanatory Message Since SAP believes that this specific error message is 'self-explanatory,' no more information has been given.The majority of...
Click on this link to search all SAP messages.