1. 使用SCMS_STRING_TO_XSTRING函数模块 SCMS_STRING_TO_XSTRING是一个标准的SAP函数模块,可以将STRING或CHAR类型的文本转换为XSTRING类型。 abap DATA: lv_string TYPE string VALUE 'Hello, ABAP!', lv_xstring TYPE xstring. CALL FUNCTION 'SCMS_STRING_TO_XSTRING' EXPORTING text = lv_string IMPORTING...
1. SCMS_STRING_TO_XSTRING CALLFUNCTION'SCMS_STRING_TO_XSTRING' EXPORTING text= lv_string * MIMETYPE = ' ' * ENCODING = IMPORTING buffer= lv_xstring EXCEPTIONS failed=1 OTHERS=2. IF sy-subrc <>0. * Implement suitable error handling here ENDIF. 2.cl_abap_codepage=>convert_to() lv_x...
最近有⽹友问及String到XString XString to String转换,下⾯代码供⼤家参考 代码如下 report zrich_0001.data: s type string,h(1) type x,c(1) type c,byte(2) type c,length type i,l_bindata type xstring,l_cntbin TYPE sdokcntbins.FIELD-SYMBOLS: <DUMMY>.s = 'This Is A String...
write:/ 'Use Function to Convert String to XSTRING'. ULINE /1(80). write:/ l_bindata. endif. * ** 1. Convert input-table to XSTRING *CALL FUNCTION 'SCMS_BINARY_TO_XSTRING' * EXPORTING: input_length = length * IMPORTING: buffer = l_bindata * TABLES: binary_tab = l_cntbin *...
* 2. Convert XSTRING to STRING clear length. CALL FUNCTION 'SCMS_XSTRING_TO_BINARY' EXPORTING: buffer = l_bindata IMPORTING: output_length = length TABLES: binary_tab = l_cntbin. if sy-subrc = 0. CALL FUNCTION 'SCMS_BINARY_TO_STRING' ...
将字符串转换回XSTRING格式调用函数'SCMS_STRING_TO_XSTRING'导出TEXT为LV_STRING,导入BUFFER为LV_XML。用新数据替换主体部分并保存调用LR_MAIN的FEED_DATA方法,传入IV_DATA为LV_XML。获取Word文档的新内容调用LR_DOCX的GET_PACKAGE_DATA方法。将新Word文档保存到本地调用XSTRLEN函数获取LV_DOCX的长度,并保存为LV...
CHARSET TYPE STRING DEFAULT 'utf-8', REPLACE )TYPE ABAP_BOOL.(可选) 出参: BASE64STR TYPE STRING. 1METHODstr2base64.2DATA:mimetype(128)TYPEc,3xstrTYPExstring.4mimetype = `"text/html;charset=` && charset && `"`.56CALLFUNCTION'SCMS_STRING_TO_XSTRING'7EXPORTING8text =str9mimetype =mim...
callfunction'SCMS_STRING_TO_XSTRING' exporting text=s *MIMETYPE='' importing buffer=l_bindata exceptions failed=1 others=2 . ifsy-subrc=0. ULINE/1(80). write:/'UseFunctiontoConvertStringtoXSTRING'. ULINE/1(80). write:/l_bindata. ...
failed=1*OTHERS=2.*IFsy-subrc0.*ENDIF.*2.ConvertXSTRINGtoSTRINGclearlength.CALLFUNCTION'SCMS_XSTRING_TO_BINARY'EXPORTING:buffer=l_bindataIMPORTING:output_length=lengthTABLES:binary_tab=l_cntbin.ifsy-subrc=0.CALLFUNCTION'SCMS_BINARY_TO_STRING'EXPORTINGINPUT_LENGTH=lengthIMPORTINGTEXT_BUFFER=SOUTPUT_...
1、SCMS_STRING_TO_XSTRING String 转 Xstring (按照指定字符编码) 2、SCMS_BASE64_ENCODE_STR Base64 编码 3、SCMS_BASE64_DECODE_STR Base64 解码 4、SCP_CODEPAGE_BY_EXTERNAL_NAME 获得Codepage 5、cl_abap_conv_in_ce Xstring转String (按照指定字符编码) ...