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...
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 *...
最近有⽹友问及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 ...
* 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' ...
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. ...
在ABAP开发中经常会碰到用webservice调用其他系统接口的情况,但有时候生成代理类总报错,无法解决,可以尝试使用类似于SOAPUI的方式调用webservice,具体例子如下: 1.定义变量... 'SCMS_STRING_TO_XSTRING' EXPORTING text = lv_post IMPORTING buffer = lv_xstring 后续处理见图片 这样就可以通过xml直接调用SEND...
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_...
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...