日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

CM: word template merge 工具

發布時間:2023/12/19 编程问答 37 豆豆
生活随笔 收集整理的這篇文章主要介紹了 CM: word template merge 工具 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

Created by Jerry Wang, last modified on Oct 22, 2014

該工具可以用于模擬在webclient UI上點擊了With Template button后選擇一個支持web service的web template和web service response merge的操作.

按照consulting node 2047259 - Trouble shooting guide about word document merge with web service 的描述,將word template和web service response download至本地:

然后執行report,即可trigger word template與web service的merge操作.

REPORT tool_document_merge. PARAMETERS: file1 TYPE string OBLIGATORY DEFAULT 'C:\Users\i042416\Desktop\Note2047259.docx',file2 TYPE string OBLIGATORY DEFAULT 'C:\Users\i042416\Desktop\LV_XPAYLOAD.xml'.FORM upload_file USING iv_file_path CHANGING cv_file TYPE xstring.DATA: l_filename TYPE string,l_rawtab TYPE STANDARD TABLE OF raw255,l_len TYPE i.l_filename = iv_file_path.CLEAR: l_rawtab, l_len.CALL METHOD cl_gui_frontend_services=>gui_uploadEXPORTINGfilename = l_filenamefiletype = 'BIN'IMPORTINGfilelength = l_lenCHANGINGdata_tab = l_rawtabEXCEPTIONSfile_open_error = 1file_read_error = 2no_batch = 3gui_refuse_filetransfer = 4invalid_type = 5no_authority = 6unknown_error = 7bad_data_format = 8header_not_allowed = 9separator_not_allowed = 10header_too_long = 11unknown_dp_error = 12access_denied = 13dp_out_of_memory = 14disk_full = 15dp_timeout = 16not_supported_by_gui = 17error_no_gui = 18OTHERS = 19.IF sy-subrc IS NOT INITIAL.WRITE:/ 'Error Occurred when Uploading file!' COLOR COL_NEGATIVE INTENSIFIED ON.RETURN.ENDIF.CALL FUNCTION 'SCMS_BINARY_TO_XSTRING'EXPORTINGinput_length = l_lenIMPORTINGbuffer = cv_fileTABLESbinary_tab = l_rawtabEXCEPTIONSfailed = 1OTHERS = 2.ASSERT sy-subrc = 0. ENDFORM.START-OF-SELECTION.DATA: lv_template TYPE xstring,lv_response TYPE xstring,lv_wsdl_url TYPE string,lv_ws_name TYPE websname,lv_response_ns TYPE xstring,lv_wsdl_operation TYPE string,lv_namespace TYPE anyuri,lv_xdata TYPE xstring,lo_docx TYPE REF TO CL_DOCX_DOCUMENT,lo_main TYPE REF TO CL_DOCX_MAINDOCUMENTPART,lv_template_xdata TYPE xstring,lv_xpayload TYPE xstring,lv_data TYPE xstring.PERFORM upload_file USING file1 CHANGING lv_template.PERFORM upload_file USING file2 CHANGING lv_response.CALL METHOD cl_crm_oi_util=>get_ws_url_from_templateEXPORTINGiv_data = lv_templateIMPORTINGev_wsdl_url = lv_wsdl_urlev_wsdl_operation = lv_wsdl_operation.ASSERT cl_crm_oi_docx_helper=>has_word_addin_format( lv_template ) = abap_true.ASSERT cl_crm_oi_docx_helper=>has_content_control_format( lv_template ) = abap_true.cl_crm_oi_docx_helper=>replace_vars_uuid_with_path(CHANGINGcv_docx_doc = lv_template ).lo_docx = cl_docx_document=>load_document( lv_template ).lo_main = lo_docx->get_maindocumentpart( ).lv_template_xdata = lo_main->get_data( ).cl_crm_oi_docx_helper=>get_ws_info_from_template( EXPORTING iv_xdata = lv_templateIMPORTING ev_ws_name = lv_ws_name ).IF ( lv_ws_name IS NOT INITIAL OR lv_wsdl_url IS NOT INITIAL ) AND lv_response IS NOT INITIAL.CALL TRANSFORMATION crm_office_int_rt_add_nsSOURCE XML lv_responseRESULT XML lv_response_ns.lv_xpayload = lv_response_ns.ENDIF.ASSERT lv_xpayload IS NOT INITIAL.TRY.CALL METHOD cl_crm_oi_docx_transform_rt=>transformEXPORTINGiv_xml_xstring = lv_response_nsiv_wordml_xstring = lv_template_xdataiv_uri = 'urn:sap-com:document:sap:soap:functions:mc-style'iv_contentcontrol_format = 'X'iv_cc_customxml = cl_crm_oi_docx_helper=>m_doc_customxmlIMPORTINGev_wordml_xstring = lv_xdata.CATCH cx_oi_fault.WRITE: / 'merge error!'.RETURN.ENDTRY.lo_main->feed_data( lv_xdata ).lv_xdata = lo_docx->get_package_data( ).WRITE: / 'document merged successfully!'.

總結

以上是生活随笔為你收集整理的CM: word template merge 工具的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。