//open dataset
DATA: dsna(80),
linct TYPE i.
form export_file TABLES outab.
dsna = 'D:\test.txt'
DESCRIBE TABLE outab LINES linct.
OPEN DATASET dsna FOR OUTPUT IN TEXT MODE ENCODING "open file and write data
NON-UNICODE IGNORING CONVERSION ERRORS.
LOOP AT outab. "internal table
TRANSFER outab TO dsna.
ENDLOOP.
CLOSE DATASET dsna. "close file
IF sy-subrc = 0.
WRITE: / dsna, 60 '传输', linct, '条记录'.
ELSE.
WRITE: / dsna, 60 '返回值为', sy-subrc, '传输不成功'.
ENDIF.
endform. "export_file
//CALL METHOD CL_GUI_FRONTEND_SERVICES=>GUI_DOWNLOAD
PARAMETERS:DSN LIKE RLGRAP-FILENAME.
form export_filebak.
DATA: CODEPAGE TYPE ABAP_ENCOD VALUE '8400'.
DATA: O_FILE TYPE STRING.
O_FILE = DSN.
CALL METHOD CL_GUI_FRONTEND_SERVICES=>GUI_DOWNLOAD
EXPORTING
FILENAME = O_FILE
FILETYPE = 'DAT'
CODEPAGE = CODEPAGE
CHANGING
DATA_TAB = IOUT[] "internal table with data for downloading
EXCEPTIONS
FILE_WRITE_ERROR = 1
NO_BATCH = 2
GUI_REFUSE_FILETRANSFER = 3
INVALID_TYPE = 4
NO_AUTHORITY = 5
UNKNOWN_ERROR = 6
HEADER_NOT_ALLOWED = 7
SEPARATOR_NOT_ALLOWED = 8
FILESIZE_NOT_ALLOWED = 9
HEADER_TOO_LONG = 10
DP_ERROR_CREATE = 11
DP_ERROR_SEND = 12
DP_ERROR_WRITE = 13
UNKNOWN_DP_ERROR = 14
ACCESS_DENIED = 15
DP_OUT_OF_MEMORY = 16
DISK_FULL = 17
DP_TIMEOUT = 18
FILE_NOT_FOUND = 19
DATAPROVIDER_EXCEPTION = 20
CONTROL_FLUSH_ERROR = 21
NOT_SUPPORTED_BY_GUI = 22
ERROR_NO_GUI = 23
OTHERS = 24.
endform. "export_file
//download excel file to local computer
call function 'WS_DOWNLOAD'
exporting
codepage = 'TIBM'
filename = f_path "f_pah 为destination path
filetype = 'DAT'
tables
data_tab = itab
exceptions
file_open_error = 1
file_write_error = 2
invalid_filesize = 3
invalid_table_width = 4
invalid_type = 5
no_batch = 6
unknown_error = 7
others = 8.
endform.

分享到:
相关推荐
标题"two kinds of vortex beam.rar_vortex_光束_涡旋 光束_涡旋光束_涡旋强度"暗示了这个压缩包文件包含关于两种不同类型的涡旋光束的详细信息,可能涉及到它们的线性强度特性、强度密度分布以及三维立体图的展示。...
环管内两类分数阶粘弹性流体轴向流动的精确解,王少伟,徐明瑜,在文中,我们研究了两种不同的分数阶粘弹性流体在环管内的轴向非定常Couette流动。借助于积分变换的工具和Mittag-Leffler函数,我们得到
Chapter 9: Best Practices for Function-Based Views Chapter 10: Best Practices for Class-Based Views Chapter 11: Form Fundamentals Chapter 12: Common Patterns for Forms Chapter 13: Templates: Best ...
Two Scoops Press Two Scoops of Django 1.11版本 适用于较新的Django1.11 知识详细,内容丰富,涉及广泛,是不可多得好书!
The conversion efficiency on the sixth harmonic of 1064 nm in KBe2BO3F2 (KBBF) at different gas pressures in two kinds of gases, helium and nitrogen, is measured and compared. In the both gases, ...
two kinds of segmentation are complementary : when they are combined, they outperform the systems in isolation. The system based on grapheme segmentation yields lower recognition rate but is very fast...
Daniel-Roy-Greenfeld-Audrey-Roy-Greenfeld-Two-Scoops-of-Django_-Best-Practices-for-Django-1.8-Two-Scoops-Press-2015.pdf 高清无水印版
Dynamics of the system are studied with special attention to Hopf bifurcations of period motions in two kinds of strong resonance cases. The PoincareH map of the vibro-impact system with proportional ...
《Django最佳实践》(Two Scoops of Django 1.11)是一本专注于最新发布的Django框架1.11版本的最佳实践指南。这本书之所以成为Django开发者必须读的资料,是因为它不仅深入剖析了Django的内部机制,而且还提供了...
1)The template should be used for all kinds of data type, such as: integer, real, double, etc. in the program; 2)Programs should be made by Object-Oriented Programming (OOP) method; 3)The results ...
Two Scoops of Django: Best Practices For Django 1.6 (2014版)pdf
Design of Experiments for Engineers and Scientists Second Edition Design of Experiments (DOE) is a powerful technique used for both exploring new processes and gaining increased knowledge of existing ...
The IP provides two kinds of simplified interface connected to EMIF bus and AHB bus for communication with 8051 core and ARM core.The two kinds of interface are full-duplex serial communication ...
卤素吸附在融石英表面的第一性原理研究,张仓胜,芦鹏飞,在融石英材料的制备过程中会不可避免地引入的卤素杂质粒子,这将影响由熔石英材料制造的光学元器件的损伤阈值和光学性质,而杂质
Two Scoops of Django_ Best Practices for Django 1.5 [Greenfeld & Roy 2013-04-16] 高清无水印 英文版