FUNCTION ztest_func1.
*"----------------------------------------------------------------------
*"*"局部接口:
*" IMPORTING
*" VALUE(IV_FILENAME) TYPE STRING DEFAULT '模板'
*" VALUE(IV_EXTENSION) TYPE STRING DEFAULT 'XLS'
*" VALUE(IV_OBJID) TYPE W3OBJID DEFAULT 'ZSDBI021'
*"----------------------------------------------------------------------
DATA:
lv_destination TYPE rlgrap-filename,
ls_key TYPE wwwdatatab.
DATA: lv_path TYPE string VALUE'' ,
lv_fullpath TYPE string VALUE'' .
CALL METHOD cl_gui_frontend_services=>file_save_dialog "调用保存对话框
EXPORTING
default_extension = iv_extension
default_file_name = iv_filename
CHANGING
filename = iv_filename
path = lv_path
fullpath = lv_fullpath
EXCEPTIONS
cntl_error = 1
error_no_gui = 2
not_supported_by_gui = 3
OTHERS = 4.
IF sy-subrc EQ 0.
ELSE.
ENDIF.
IF lv_fullpath = ''.
MESSAGE '下载模板失败' TYPE 'E'.
ENDIF.
lv_destination = lv_fullpath.
ls_key-relid = 'MI'.
ls_key-objid = iv_objid.
CALL FUNCTION 'DOWNLOAD_WEB_OBJECT'
EXPORTING
key = ls_key
destination = lv_destination.
ENDFUNCTION.
阅读(1789) | 评论(0) | 转发(0) |