The character “!” can be written directly before a name in order to distinguish it from an ABAP word of the same name in a statement. With the exception of the first word, each word of a statement that is preceded by the escape character is interpreted as an operand, and not as an ABAP word, in program generation. The escape character itself is not part of a name and is ignored when the statement is executed.
Note:
The escape character may be required on rare occasions in which the compiler cannot tell the difference between an operand and a reserved word of the same name. Otherwise, it can be used for the documentation of operands in the source code.
Example:
Without the escape character “!” before CHANGING after USING, the following program would be syntactically incorrect, because a formal parameter must be entered after USING. Although the second escape character is not necessary, it serves to document USING after CHANGING as a formal parameter.
We can’t activate this piece of code:
1 | *&---------------------------------------------------------------------* |
But if we change the code to:
1 | *&---------------------------------------------------------------------* |
This doesn't give any syntactical error, as shown below.
No comments:
Post a Comment