SAP UTF-8 文件输出方式 及 GUI_DOWNLOAD 参数说明

Function Module: GUI_DOWNLOAD

注: 如需要导出 UTF-8 的文件,可使用以下格式即可。

 

call function 'GUI_DOWNLOAD'
    exporting
     filename                        = p_file
     FILETYPE                        = 'DAT'
     CODEPAGE                        = '4110'
     WRITE_BOM                       = 'X'

 

如是使用open dataset 方式输出 UTF-8,则可用认下方式。

 

 

open dataset gv_file for output in text mode encoding UTF-8 WITH BYTE-ORDER MARK WITH SMART LINEFEED

 

 

对FUNCTION: GUI_DOWNLOAD中某些参数的用法.

  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 FILETYPE

'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.

 

Default

'ASC'


2. APPEND
GUI_DOWNLOAD APPEND

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.

Value range

'X'   = Data is appended.

SPACE = Data is overwritten if the file already exists.

Default

SPACE


3. WRITE_FIELD_SEPARATOR
GUI_DOWNLOAD WRITE_FIELD_SEPARATOR

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.

Value range

'X'   : Write separator.

SPACE : Do not write separator.

Default

SPACE


4. WRITE_LF
GUI_DOWNLOAD WRITE_LF

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.

Value range

'X': Row separator is inserted.

SPACE: Row separator is not inserted.

Default

'X'


5. DAT_MODE
GUI_DOWNLOAD DAT_MODE

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.

Value range

'X': DAT_MODE is switched on.

SPACE: DAT_MODE is not switched on.

Default

SPACE


6. CODEPAGE
GUI_DOWNLOAD CODEPAGE

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.

Value range

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

Default

SPACE


7. REPLACEMENT
GUI_DOWNLOAD REPLACEMENT

Specifies the replacement character to be used when during a character set conversion a character cannot be converted.

Value range

An individual character.

Default

'#'


8. WRITE_BOM
GUI_DOWNLOAD WRITE_BOM

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.

Value range

'X': Write BOM.

SPACE: Do not write BOM.

Default

SPACE


9. FIELDNAMES
GUI_DOWNLOAD FIELDNAMES

Optional table with column names for the individual columns.

  • 'DBF': The column names are entered into the structure definition of the DBF file.
  • 'DAT':  An additional row with the column names is inserted at the beginning of the table.
  • 0
    点赞
  • 8
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
sle-11-sp4-sap-dvd-x86_64-gm-dvd1.iso是一种操作系统的软件镜像文件。SLE代表SUSE Linux Enterprise,11代表它是第11个版本,SP4代表它的服务包级别是第4个,SAP表示它是专门为SAP软件开发和运行的版本。x86_64代表它适用于64位的x86架构处理器。gm代表它是General Maintenance版本,dvd1表示这是整个软件分发的第一个光盘映像文件。 这个软件镜像文件主要被用于进行新系统的安装或者现有系统的升级。用户可以将这个镜像文件刻录到光盘上,然后通过该光盘引导计算机,开始进行系统的安装。该镜像文件还可以被挂载到虚拟机中,进行虚拟机的安装或者升级。 SLE-11-SP4-SAP-DVD-x86_64-GM-DVD1.iso中包含了SUSE Linux Enterprise 11 SP4 SAP Edition所需的所有软件和工具。它包含了专门用于SAP运行环境的增强功能和优化设置,并提供了SAP管理员和开发人员需要的工具和资源。它还包括了SUSE Linux Enterprise操作系统的核心组件和必备的软件包。 通过安装这个系统镜像文件,用户可以获得一个稳定、可靠且特别针对SAP应用程序优化的操作系统环境。它提供了高可用性、可扩展性、安全性和性能最佳化等特性,以确保SAP软件在企业中的顺利运行。用户还可以根据自己的需求自定义安装,选择需要的软件包和工具,实现个性化的系统配置。 总之,sle-11-sp4-sap-dvd-x86_64-gm-dvd1.iso是一种专门为SAP软件开发和运行优化的SUSE Linux Enterprise 11 SP4操作系统的软件镜像文件。通过安装这个系统,用户可以获得一个稳定、高性能且优化的SAP应用环境。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

ChampaignWolf

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值