SAP UTF-8 文件输出方式 及 GUI_DOWNLOAD 参数说明
来源:互联网 发布:xbox体感游戏知乎 编辑:程序博客网 时间:2024/06/11 02:29
注: 如需要导出 UTF-8 的文件,可使用以下格式即可。 call function 'GUI_DOWNLOAD' 如是使用open dataset 方式输出 UTF-8,则可用认下方式。 open dataset gv_file for output in text mode encoding UTF-8 WITH BYTE-ORDER MARK WITH SMART LINEFEED 'ASC' : ASCII format. The table is transferred as text. Conversion exits are performed. The output format additionally depends on the parameters CODEPAGE, TRUNC_TRAILING_BLANKS, and TRUNC_TRAILING_BLANKS_EOL. 'IBM' : ASCII format with IBM codepage conversion (DOS). This format corresponds to the 'ASC' format when using target codepage 1103. This codepage is frequently used for data exchange via floppy disk. 'DAT' : Column-by-column transfer. With this format, the data is transferred as text as with ASC. However, no conversion exits are performed and the columns are separated by tab characters. This format generates files than can be uploaded again using gui_upload or ws_upload. 'DBF' : Data is downloaded in dBase format. Since in this format the data types of the individual columns are stored as well, you can often avoid import problems, for example, into Microsoft Excel, especially when interpreting numeric values. 'WK1' : Data is downloaded in Lotus 1-2-3 format. 'BIN' : Binary format. Data is transferred binarily. There is no formatting and no codepage conversion. The data is interpreted row by row; it is not formatted by columns. Specify the data length in parameter BIN_FILESIZE. The table should consist of a column of type X, because especially in Unicode systems, the conversion of structured into binary data causes errors. 'ASC' By default, existing local files are overwritten by new versions. By setting APPEND to 'X', the downloaded data is appended to an existing file. If the file does not yet exist, it is created. 'X' = Data is appended. SPACE = Data is overwritten if the file already exists. SPACE In the downloaded file, the columns are separated by tab characters (cl_abap_char_utilities=>horizontal_tab). You should use this setting if you want to upload the data from the file at a later time, because this is the only way of identifying individual columns. The parameter makes sense only for the FILETYPE values ASC, DAT and IBM; for DAT it is set implicitly. 'X' : Write separator. SPACE : Do not write separator. SPACE If this parameter is set, at the end of each row a row separator is inserted by CL_ABAP_CHAR_UTILITIES=>CR_LF. This parameter makes sense only for FILETYPE 'ASC', 'DAT' and 'IBM'. If this parameter is not set, blanks at the end of a row are not removed. 'X': Row separator is inserted. SPACE: Row separator is not inserted. 'X' If parameter DAT_MODE is set, the file is stored in 'DAT' format. No conversion exits are performed. Number and date fields are stored in a standard format which makes it possible, to later import the file using gui_upload. 'X': DAT_MODE is switched on. SPACE: DAT_MODE is not switched on. SPACE Use parameter CODEPAGE to specify the desired target codepage. If this parameter is not set, the codepage of the SAP GUI is used as the target codepage. 4-digit number of the SAP codepage. The function module SCP_CODEPAGE_BY_EXTERNAL_NAME returns the SAP codepage number for an external character set name, for example, "iso-8859-1". The function module NLS_GET_FRONTEND_CP returns the appropriate non-Unicode frontend codepage for a language. You can determine the desired codepage interactively, if the parameter with_encoding of method file_save_dialog is set by cl_gui_frontend_services. SPACE: Codepage of the SAP GUI SPACE Specifies the replacement character to be used when during a character set conversion a character cannot be converted. An individual character. '#' If the data is written in a Unicode codepage, at the beginning of the file the respective byte order mark (BOM) is inserted. Unicode - Little Endian Codepage 4103, binary values 'FFFE' Unicode - Big Endian Codepage 4102, binary values 'FEFF' UTF-8 Codepage 4110, binary values 'EFBBBF' Note: Microsoft Excel only supports Unicode data if they have been written in the format Unicode - Little Endian. 'X': Write BOM. SPACE: Do not write BOM. SPACE Optional table with column names for the individual columns.Function Module: GUI_DOWNLOAD
exporting
filename = p_file
FILETYPE = 'DAT'
CODEPAGE = '4110'
WRITE_BOM = 'X'
call function 'GUI_DOWNLOAD'
exporting
* BIN_FILESIZE =
* filename = p_file
* FILETYPE = 'DAT'
* APPEND = ' '
* write_field_separator = 'X'
* HEADER = '00'
* TRUNC_TRAILING_BLANKS = ' '
* WRITE_LF = 'X'
* COL_SELECT = ' '
* COL_SELECT_MASK = ' '
* DAT_MODE = ' '
* CONFIRM_OVERWRITE = ' '
* NO_AUTH_CHECK = ' '
* CODEPAGE = '4103'
* IGNORE_CERR = ABAP_TRUE
* REPLACEMENT = '#'
* WRITE_BOM = 'X'
* TRUNC_TRAILING_BLANKS_EOL = 'X'
* WK1_N_FORMAT = ' '
* WK1_N_SIZE = ' '
* WK1_T_FORMAT = ' '
* WK1_T_SIZE = ' '
* WRITE_LF_AFTER_LAST_LINE = ABAP_TRUE
* SHOW_TRANSFER_STATUS = ABAP_TRUE
* IMPORTING
* FILELENGTH =
* tables
* data_tab = it_kna1
* fieldnames = it_filedname[]
* 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
* OTHERS = 22.
1. FILETYPE: GUI_DOWNLOAD FILETYPEDefault
2. APPEND
GUI_DOWNLOAD APPENDValue range
Default
3. WRITE_FIELD_SEPARATOR
GUI_DOWNLOAD WRITE_FIELD_SEPARATORValue range
Default
4. WRITE_LF
GUI_DOWNLOAD WRITE_LFValue range
Default
5. DAT_MODE
GUI_DOWNLOAD DAT_MODEValue range
Default
6. CODEPAGE
GUI_DOWNLOAD CODEPAGEValue range
Default
7. REPLACEMENT
GUI_DOWNLOAD REPLACEMENTValue range
Default
8. WRITE_BOM
GUI_DOWNLOAD WRITE_BOMValue range
Default
9. FIELDNAMES
GUI_DOWNLOAD FIELDNAMES
- SAP UTF-8 文件输出方式 及 GUI_DOWNLOAD 参数说明
- GUI_DOWNLOAD如何带表头及输出前导0
- GUI_Download的Codepage参数
- GUI_Download的Codepage参数
- printf函数常用的输出方式及格式化输出说明
- GUI_DOWNLOAD
- SAP接口程序方式说明
- 字符编码方式及判断整理(ANSI,Unicode,utf-8,utf-16,utf-32)
- 探讨gui_upload(gui_download)的两个参数
- ws_download 和 gui_download参数codepage解析
- 编码格式说明及Unicode与utf-8互转
- UTF-8的说明
- python文件编码说明 coding=utf-8
- 文件编码UTF-8控制台输出乱码的问题
- JAVA输出带BOM的UTF-8编码的文件
- Java中utf-8 bom文件的输出,读入。utf-8的判断等sample source
- directfbrc文件的使用及参数的详细说明
- CFtpConnection::GetFile()下载FTP服务器文件及相关参数说明
- ASP.NET Media Player Control
- MYSQL查询一周内的数据(最近7天的)怎么写
- Defect预防及defect分析方法
- java序列化
- 二分图---一起复习一下啊!
- SAP UTF-8 文件输出方式 及 GUI_DOWNLOAD 参数说明
- 充分表达自己
- 用log4j代替tomcat自身的log
- Try 一 Try
- 转: ABAP--关于ABAP流程处理的一些命令的说明(stop,exit,return,check,reject)
- ActionScript 3 和 Flex框架的性能优化
- C++基础(C++转义字符)
- 网页相对路径
- 概要设计与详细设计的区别