text-assembly.md
September 23, 2022 ยท View on GitHub
code pal for ABAP > Documentation > Text Assembly
Text Assembly
What is the Intent of the Check?
This check searches for locations where text is assembled from different fragments and string templates (marked by |) are not used.
How to solve the issue?
Use string templates to assemble text from smaller pieces.
What to do in case of exception?
In exceptional cases, you can suppress this finding by using the pseudo comment "#EC TEXT_ASSEMBLY which has to be placed after the statement:
DATA(first) = 'A'.
DATA(second) = 'B'.
DATA(third) = 'C'.
WRITE first && ': ' && second && ' - ' && third. "#EC TEXT_ASSEMBLY
Example
Before the check:
DATA(first) = 'A'.
DATA(second) = 'B'.
DATA(third) = 'C'.
WRITE first && ': ' && second && ' - ' && third.
After the check:
DATA(first) = 'A'.
DATA(second) = 'B'.
DATA(third) = 'C'.
WRITE |{ first }: { second } - { third }|.