CALL FUNCTION 'GUI_DOWNLOAD' EXPORTING BIN_FILESIZE = filename = w_file FILETYPE = 'ASC' APPEND = ' ' WRITE_FIELD_SEPARATOR = ' ' HEADER = '00' TRUNC_TRAILING_BLANKS = ' ' WRITE_LF = 'X' COL_SELECT = ' ' COL_SELECT_MASK = ' ' DAT_MODE = ' ' CONFIRM_OVERWRITE = ' ' NO...
file_content_ascii=file_content_ascii file_content_binary=cont_binEXCEPTIONSnot_existing=1not_authorized=2no_content=3bad_storage_type=4.CALLFUNCTION'GUI_DOWNLOAD'EXPORTINGfilename=p_filestr filetype='BIN'TABLESdata_tab=cont_binEXCEPTIONSfile_write_error=1no_batch=2gui_refuse_filetransfer=3invalid_...
29fieldnames = t_fieldnames. 这个函数虽然比较简单,但当FILETYPE为DAT和ASC时,生成的文件用EXCEL打开时会弹出如下的对话框: 原因:以DAT和ASC格式存的表格其实是TXT格式,与EXCEL格式不一致,将扩展名改为TXT,会很容易看出这一点。 2. 函数:SAP_CONVERT_TO_XLS_FORMAT 这个FM功能与GUI_DOWNLOAD类似,支持xlsx格式:...
FIELDNAMES参数表头(此格式表头是列格式) CALL FUNCTION ‘GUI_DOWNLOAD’ EXPORTING filename = t_down filetype = ‘DBF’ codepage = ‘8300’ TABLES data_tab = itab2 fieldnames = itab1_text EXCEPTIONS file_write_error = 1 no_batch = 2 gui_refuse_filetransfer = 3 invalid_type = 4 no_auth...
CALL FUNCTION 'GUI_DOWNLOAD' EXPORTING bin_filesize = fsize filename = 'c:\test.pdf' filetype = 'BIN' TABLES data_tab = tblob EXCEPTIONS OTHERS = 9. 说明: (1)OPEN DATASET时设置IN BINARY MODE,GUI_DOWNLOAD时也是以'BIN'模式,从而实现二进制的直接传送。
若要下载文件,请使用方法CL_GUI_FRONTEND_SERVICES⇒GUI_DOWNLOAD: CALLMETHODCL_GUI_FRONTEND_SERVICES=>GUI_DOWNLOADEXPORTINGFILENAME=FULLPATHFILETYPE='DAT'CHANGINGDATA_TAB=itab 您还可以使用功能模块GUI_DOWNLOAD: CALLFUNCTION'GUI_DOWNLOAD'EXPORTINGbin_filesize=l_filesize ...
CALL FUNCTION 'GUI_DOWNLOAD' EXPORTING filename = filename_frontend_fullpath write_field_separator = 'X' filetype = 'DAT' codepage = l_codepage dat_mode = 'X' TABLES data_tab = <dyn_table> "<fs_result> "<fs_table> fieldnames = lt_fieldname "gt_fieldcat EXCEPTIONS OTHERS = 22. ...
GUI_DOWNLOAD/WS_DOWNLOAD:下载文档 GUI_UPLOAD和GUI_DOWNLOAD是类CL_GUI_FRONTEND_SERVICES的静态方法.SAP在静态方法中直接使用了FUNCTION---GUI_UPLOAD和GUI_DOWNLOAD。 WS_UPLOAD和WS_DOWNLOAD属于被淘汰的FUNCTION,不建议使用。 上传下载TXT文档:GUI_UPLOAD/GUI_DOWNLOAD ...
CALL FUNCTION'GUI_DOWNLOAD' EXPORTING BIN_FILESIZE = W_BIN_FILESIZE FILENAME = FILE_NAME"fname1 FILETYPE ='BIN' IMPORTING FILELENGTH = W_FILESIZE TABLES DATA_TAB = T_PDF_TAB EXCEPTIONS FILE_WRITE_ERROR =1 NO_BATCH =2 GUI_REFUSE_FILETRANSFER =3 INVALID_TYPE =4 NO_AUTHORITY =5 UNKNOWN...
CALL FUNCTION 'GUI_DOWNLOAD'EXPORTING FILENAME = 'C:\temp\test.txt'FILETYPE = 'ASC'TABLES DATA_TAB = it_data EXCEPTIONS FILE_WRITE_ERROR = 1 NO_BATCH = 2 GUI_REFUSE_FILETRANSFER = 3 INVALID_TYPE = 4 NO_AUTHORITY = 5 UNKNOWN_ERROR ...