ABAP Keyword Documentation →  ABAP − Reference →  Processing Internal Data →  Character String and Byte String Processing →  Character and Byte String Processing - Overview → 

Trailing Blanks in Character String Processing

Statements for character string processing generally preserve leading blanks for operands of data types with fixed lengths (c, d, n, and t or character-like structures) and cut off trailing blanks. Exceptions to this rule are explained in the affected statements. All blanks are generally preserved for operands of the data type string.

If the result of a statement for character string processing is assigned to an operand, the operand is generally padded on the right with blanks if the result is shorter than the length of the operand. String assignments generally adapt the string length to the length of the result. Exceptions to this rule are explained in the affected statements.

Programming Guideline

Do not use trailing blanks in text field literals

Notes

Example

The result of the following concatenation is a string with exactly one blank. The blank characters in space and ' ' are ignored. At operand positions after SEPARATED BY however, the blank character which is contained explicitly in '' is not ignored. If the addition RESPECTING BLANKS is used, the result is a string with three blanks.

DATA text TYPE string.

CONCATENATE space ' ' INTO text SEPARATED BY ''.