2、ATA:g_excel TYPE ole2_object, g_applica TYPE ole2_object, g_sheet TYPE ole2_object, g_cell TYPE ole2_object, g_workbook TYPE ole2_object.DATA:p_filepath TYPE string.CONSTANTS:c_yes TYPE c VALUE 'X', c_path TYPE char128 VALUE 'C:TMP价格信息批量导入.xl
4、-------------------------------------------------------** text*----------------------------------------------------------------------*FORM frm_check_input . DATA l_ret TYPE abap_bool. IF sscrfields-ucomm = 'ATTCH'.* 下载模版 PERFORM frm_download_template. ELSE.
5、 IF p_filepath IS INITIAL. MESSAGE s004(zmess) DISPLAY LIKE 'E'. STOP. ENDIF.* 将路径全部转换为大写 TRANSLATE p_filepath TO UPPER CASE.* 检查文件是否存在 CALL METHOD cl_gui_frontend_services=>file_exist EXPORTING file = p_filepath R
6、ECEIVING result = l_ret EXCEPTIONS cntl_error = 1 error_no_gui = 2 wrong_parameter = 3 not_supported_by_gui = 4 OTHERS = 5. IF sy-subrc <> 0. MESSAGE ID sy-msgid T
7、YPE sy-msgty NUMBER sy-msgno WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4. ENDIF. IF l_ret NE c_yes. MESSAGE e004(zmess) WITH '文件不存在'. ENDIF. ENDIF.ENDFORM. "frm_check_input*&------------------------------------------------
8、---------------------**& Form frm_download_template*&----------------------------------------------------------