4.6C的帮助:
For the highlighted argument positions of the following ABAP statements, blank characters at the end of strings are not taken into account. This may change in the next release.
-----
7.0的帮助:
In contrast to text fields, trailing blanks are always taken into account in text strings. There is a specific string literal for text strings.
----
Changes in Release 6.10:
Modification 6
Introduction of string literals
String literals are enclosed by grave accents (`)of the form str = `ABC`. String literals are of data type STRING and trailing spaces are taken into account, as opposed to text literals.
data: STR1 type string value 'ABC ',
STR2 type string value `ABC `,
CNT1 type i,
CNT2 type i.
CNT1 = strlen( STR1 ).
CNT2 = strlen( STR2 ).
write: / CNT1, CNT2.
The length for the string STR1 will be CNT1 = 3 and for the string STR2 it will be CNT2 = 5.
![](https://img2024.cnblogs.com/blog/35695/202407/35695-20240713070336838-1837943664.jpg)