Output Mode and gui_download parameters of SAP UTF-8

Source: Internet
Author: User
Tags sap gui
Document directory
  • Default
  • Value Range
  • Default
  • Value Range
  • Default
  • Value Range
  • Default
  • Value Range
  • Default
  • Value Range
  • Default
  • Value Range
  • Default
  • Value Range
  • Default

Function module: gui_download

Note: to export a UTF-8 file, use the following format.

 

Call function 'gui _ download'
Exporting
Filename = p_file
Filetype = 'dat'
CodePage = '20140901'
Write_bom = 'X'

 

If you use the open dataset method to output the UTF-8, you can recognize the way.

 

Open dataset gv_file for output in text mode encoding UTF-8 with byte-order mark with smart linefeed


 

Usage of some parameters in 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 = '000000'
* 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 saved med. The output format additionally depends on the parameters codePage, trunc_trailing_blks, and trunc_trailing_blks_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 saved med 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 shoshould 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 shoshould 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 saved med. 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 endianCodePage 4103, binary values 'fffe'

Unicode-big endianCodePage 4102, binary values 'feff'

UTF-8CodePage 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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.