Ignored blanks in character field literals
character_field_literal_blanks
Description
Reports character field literals ('...') whose blanks are ignored where the code relies on them
Extended Information
A character field literal '...' (called text field literal in the ABAP
documentation) has type c, and trailing blanks of type c operands are ignored in many positions.
A text string literal `...` has type string and keeps them.
Option searchPattern: a FIND or REPLACE search pattern (SUBSTRING, character mode) that is a character field
literal containing only blanks, '' or space. The pattern is empty: FIND/REPLACE ALL OCCURRENCES raises
CX_SY_FIND_INFINITE_LOOP/CX_SY_REPLACE_INFINITE_LOOP, the first occurrence is found before the first character.
https://help.sap.com/doc/abapdocu_latest_index_htm/latest/en-US/abapfind_pattern.htm
Option concatenation: a character field literal ending with a blank as an operand of &&, as an operand of
CONCATENATE without RESPECTING BLANKS, or as the whole embedded expression of a string template without
formatting options. The trailing blanks are dropped, 'Hello ' && name gives "HelloJohn". space is reported
the same way.
https://help.sap.com/doc/abapdocu_latest_index_htm/latest/en-US/abenstring_operators.htm
The quick fix replaces the literal with a text string literal with the same content.
Not reported: text string literals, CONCATENATE ... RESPECTING BLANKS, the separator of SEPARATED BY
(its trailing blanks are kept), the literal operator &, literals with a text symbol, PCRE and REGEX
patterns, byte mode, comparisons and parameters.