1 Question.
How to dowloand EXCEL module in the sap ?
2. Create Excel module.
We can use SMW0 for creating it .
3.Code
tables: ztfi083b,bkpf,ztfi085 ,sscrfields.
selection-screen: function key 1.
at selection-screen .
case sscrfields-ucomm.
when 'FC01'.
call method cl_gui_frontend_services=>file_exist
exporting
file = l_file
receiving
result = l_result
exceptions
cntl_error = 1
error_no_gui = 2
wrong_parameter = 3
not_supported_by_gui = 4
others = 5.
if l_result = 'X'.
message '模板C:\TEMP\ZFI_E_085E.XLS已存在!' type 'S'.
stop.
else.
wwwdata_new-relid = 'MI'.
wwwdata_new-objid = 'ZFI_E_085E'. "SMW0定义的对象名称
call function 'DOWNLOAD_WEB_OBJECT'
exporting
key = wwwdata_new
destination = 'C:\TEMP\ZFI_E_085E.XLS'.
if sy-subrc <> 0.
message '下载模板失败!' type 'E'.
else.
message '成功下载模板,请重新调整以适应本机!默认下载目录:C:\TEMP\ZFI_E_085E.XLS。' type 'S'.
endif.
endif.
4 Summary
smw0 :you upload module with it .