简要:Xstring和String的字符串长度 可变,可以指定最大长度,而且最大长度没上限。
函数:STRING 转XSTRING
DATA: i_str TYPE STRING,
e_xstr TYPE XTRING.
CALL FUNCTION ‘SCMS_STRING_TO_XSTRING’
EXPORTING
text = i_str
IMPORTING
buffer = e_xstr.
函数:XSTRING转STRING
DATA: i_str TYPE STRING,
e_xstr TYPE XTRING.
data: lv_bin_size type i.
data: lt_bin_tab like gt_bin_tab[].
call function ‘SCMS_XSTRING_TO_BINARY’
exporting
BUFFER = i_xstr
importing
OUTPUT_LENGTH = Lv_bin_SIZE
tables
BINARY_TAB = lt_bin_tab.
- 将二进制内表转换(拼接)成一个字符串
CALL FUNCTION ‘SCMS_BINARY_TO_STRING’
EXPORTING
input_length = lv_bin_size
IMPORTING
text_buffer = e_str
TABLES
binary_tab = lt_bin_tab.