方法1:OLE
优点:可以定义复杂的格式,可以控制字体,颜色,合并单元格等Excel的操作
缺点:慢
方法2:function :SAP_CONVERT_TO_XLS_FORMAT
CALL FUNCTION 'SAP_CONVERT_TO_XLS_FORMAT'
EXPORTING
i_filename = 'C:\temp\1.XLSX'
TABLES
i_tab_sap_data = gt_temp
EXCEPTIONS
conversion_failed = 1
OTHERS = 2.
IF sy-subrc <> 0.
* Implement suitable error handling here
ENDIF.
优点:速度快
缺点:不能定义单元格格式