用F1查看的时候,这里是这样说的:
The types RAWSTRING and STRING have a variable length. A maximum length for these types can be specified, but has no upper limit.
The type SSTRING is available as of release 6.10 and it has a variable length. Its maximum length must be specified and is limited to 255. The advantage of this type compared with CHAR, is that it is assigned to the ABAP type string.
效果如下:
用几个例子说明一下
例子1:
DATA str TYPE sSTRING.
DATA str1 TYPE string.
DATA str2 TYPE xstring."这个就是rawstring类型
DATA STR3 TYPE STRING.
str = '好好学习'.
str1 = str.
str2 = str.
WRITE :/ 'str1:',str1.
ULINE.
WRITE :/ 'str2:',str2.
ULINE.
STR3 = STR2.
WRITE :/ 'str3:',STR3.
ULINE.
结果:

文章通过示例展示了ABAP中的不同字符串类型,如RAWSTRING,STRING和SSTRING的特性。SSTRING最大长度限定为255,而RAWSTRING无长度限制但不支持中文等特定字符。XSTRING在遇到不支持的字符时会停止并可能填充0,这使得它在某些情况下适合作为加密协议使用。
最低0.47元/天 解锁文章
1572

被折叠的 条评论
为什么被折叠?



