组合HTML字符串的方法来导出WORD文件
DATA: BEGIN OF wa_html, zhtml(255), END OF wa_html, gt_html LIKE TABLE OF wa_html. DATA: v_str TYPE string. DEFINE appd_html. wa_html-zhtml = &1. append wa_html to gt_html. clear wa_html. END-OF-DEFINITION. appd_html: '<table style="width:100%;border:1px black solid;font-size:10px; border-collapse:collapse;font-family:Arial Unicode MS;">', '<tr>', '<td align="center" style="border:1px black solid;">1111111111</td>', '<td align="center" style="border:1px black solid;">2222222222</td>', '</tr>', '<tr>', '<td align="center" style="border:1px black solid;">1111111111</td>', '<td align="center" style="border:1px black solid;">2222222222</td>', '</tr>', '<tr>', '<td align="center" style="border:1px black solid;">1111111111</td>', '<td align="center" style="border:1px black solid;">2222222222</td>', '</tr>', '</table>'. CALL METHOD cl_gui_frontend_services=>gui_download EXPORTING filename = 'd:/aa.doc' CHANGING data_tab = gt_html. IF sy-subrc EQ 0. . ELSE. . ENDIF.
调用本地程序打开文件
CALL FUNCTION 'CALL_INTERNET_ADRESS' EXPORTING PI_ADRESS = 'd:/aa.doc' * PI_TECHKEY = '' EXCEPTIONS NO_INPUT_DATA = 1 OTHERS = 2.
原创文章,作者:Maggie-Hunter,如若转载,请注明出处:https://blog.ytso.com/tech/pnotes/18039.html