Select language:

Component documentationGUI_DOWNLOAD

 

Downloads a file to the client computer.

Arguments

[IMPORTING] bin_filesize TYPE I

Amount of data transferred. This information needs to be specified if the data is transferred in binary format.

This parameter is optional. Possible values:

  • >= 0

[IMPORTING] filename TYPE STRING

Name of file into which data should be stored. If no directory path is specified, the file will be stored in the current directory, i.e. the directory which was used in the last file operation that was completed (-> see note 622128).

[IMPORTING] filetype TYPE CHAR10

Format in which the data should be transferred.

Possible values:

  • ASC

    data should be transferred as ASCII text. Data is converted as necessary.

  • BIN

    data should be transferred unconverted in binary format

  • DAT

    data should be transported unconverted as ASCII text where the different columns are separated by tabulators

  • DBF

    data should be sent in dBase format in which the data types of the data in the different columns is included in the data sent

  • IBM

    if data should be transferred as ASCII text in codepage 1103

  • VSS

    data should be sent in ASCII format. Each line has two columns where the first column is a length field for the text in the second column

  • WK1

    data should be transported in Lotus 1-2-3 format

[IMPORTING] append TYPE CHAR01

Flag indicating whether the data should be appended to an existing file or not.

Possible values:

  • ' '

    data should not be appended to an existing file. If a file with the specified name exists, the data in that file will be overwritten

  • 'X'

    data should be appended to the data of an existing file. A new file will be created if no file with that name exists.

[IMPORTING] write_field_separator TYPE CHAR01

Indicates whether a tabulator character should be inserted between columns in the data transferred. This flag can be used in connection with the ASCII transfer types ASC, DAT and IBM. With the transfer type DAT this flag is set implicitly.

Possible values:

  • ' '

    no tabulator character should be inserted between columns. This is the default for all transfer formats except DAT.

  • 'X'

    tabulator characters should be inserted between columns. This will be done automatically if the transfer type is DAT.

[IMPORTING] header TYPE XSTRING

Hexadecimal string prepended to data transferred. The length of this string may not exceed 1023 characters.

[IMPORTING] trunc_trailing_blanks TYPE CHAR01

Flag indicating whether trailing blanks should be removed from the data transferred. This option is only relevant for the ASCII text transfer types ASC, DAT and IBM.

Possible values:

  • ' '

    trailing blanks should be left untouched

  • 'X'

    trailing blanks should be removed

[IMPORTING] write_lf TYPE CHAR01

Indicates whether a line feed should be included at the end of each table line.

Possible values:

  • ' '

    no line feeds should be added at the end of table line

  • 'X'

    a line feed should be appended to each row in the data table

[IMPORTING] col_select TYPE CHAR01

This flag indicates whether only specific columns of a table should be added to the data transferred to the client.

This option is only relevant for the transfer formats DAT and DBF.

Possible values:

  • ' '

    all columns should be transferred

  • 'X'

    only the columns specified in the selection mask 'col_select_mask' should be sent.

[IMPORTING] col_select_mask TYPE CHAR255

In col_select_mask the columns to be transferred to the client can be specified. In order to select a column to be transferred an 'X' has to be inserted at the corresponding position in the selection mask. Columns not to be added are marked with ' '.

[IMPORTING] dat_mode TYPE CHAR01

If this flag is set, columns will be separated by tabulators as they are in the transfer type DAT. Unlike in transfer mode DAT trailing blanks are not removed. Conversion exits are not executed.

Possible values:

  • ' '

    if columns should not be sent tab separated in transfer types different from DAT.

  • 'X'

    if columns should be sent tab separated.

[IMPORTING] confirm_overwrite TYPE CHAR01

If this option is activated, the user is asked whether an existing file should be overwritten or not. Otherwise the file will be overwritten without asking the user.

Possible values:

  • ' '

    an existing file should be overwritten in any case

  • 'X'

    the user should be asked whether to overwrite an existing file or not

[IMPORTING] no_auth_check TYPE CHAR01

This option allows activating/deactivating of the check of the authorization object S_GUI prior to attempting to execute this operation.

Possible values:

  • ' '

    check of authorization object should be deactivated

  • 'X'

    check of authorization object should be done prior to executing operation

[IMPORTING] codepage TYPE ABAP_ENCODING

Encoding in which data should be transferred. This is the desired SAP codepage. If a blank is specified instead, the codepage in which the SAP GUI is communicating with the server is used.

[IMPORTING] ignore_cerr TYPE ABAP_BOOL

Flag indicating whether errors in the conversion of the data should be ignored or not.

Possible values:

  • ABAP_FALSE

    conversion errors should not be ignored

  • ABAP_TRUE

    conversion errors should be ignored

[IMPORTING] replacement TYPE ABAP_REPL

Character to use for characters that cannot be converted, i.e. which cannot be represented in the specified encoding.

[IMPORTING] write_bom TYPE ABAP_BOOL

If this flag is set to ABAP_TRUE, a byte order mark will be added to the data transferred to the GUI if the data is encoded in Unicode, i.e. UTF-8 or UTF-16 Big Endian/Little Endian.

Possible values:

  • ABAP_FALSE

    no byte order mark should be prepended to the data

  • ABAP_TRUE

    byte order mark should be added to the data transmitted

[IMPORTING] trunc_trailing_blanks_eol TYPE CHAR01

Flag indicating whether the trailing blanks in a line should be removed. This affects only the last column in a line.

Possible values:

  • ' '

    the trailing blanks should not be removed

  • 'X'

    trailing blanks should be deleted

[IMPORTING] wk1_n_format TYPE C

Specifies how numeric columns should be handled for transfer type WK1.

Possible values:

  • ' ' or '0'

    standard format should be used

  • "1<x>"

    numeric columns should be interpreted as decimal values where "1<x>" has to be replaced with the desired number of positions after the decimal point

  • "2<x>"

    numeric columns should be interpreted as a currency value with <x> decimal positions

[IMPORTING] wk1_n_size TYPE C

Column width for numeric values for transfer type WK1.

Possible values:

  • >= 0

[IMPORTING] wk1_t_format TYPE C

Specifies alignment of text in cells containing text for transfer type WK1.

Possible values:

  • '0'

    text should be left aligned

  • '1'

    text should be right aligned

  • '2'

    text should be center aligned

[IMPORTING] wk1_t_size TYPE C

Width of text columns for WK1 transfer type.

Possible values:

  • [0, 240]

[IMPORTING] show_transfer_status TYPE CHAR01

Flag indicating whether status messages regarding the amount of data transmitted and the codepage used should be displayed in the status bar or not.

Possible values:

  • ' '

    no status messages should be displayed

  • 'X'

    status message should be displayed

[EXPORTING] filelength TYPE I

Number of bytes transferred to the client.

Possible values:

  • >= 0

[CHANGING] data_tab TYPE STANDARD TABLE

Table containing data to be sent to the client.

Note Note

This parameter should have been defined as an importing parameter because the content passed to the method will not be changed.

End of the note.

[IMPORTING] write_lf_after_last_line TYPE ABAP_BOOL

Flag indicating whether a line feed character should be written after the last line or not Possible values:

Possible values:

  • ABAP_TRUE

    if after last line a line feed character should be inserted

  • ABAP_FALSE

    if no line feed character should be inserted at the end of the last line

Exceptions

ACCESS_DENIED

Raised if user declines overwrite of existing file.

CONTROL_FLUSH_ERROR

Thrown if operation on control could not be executed.

DATAPROVIDER_EXCEPTION

If this exception is raised, an unspecified exception in the dataprovider occurred.

DISK_FULL

Thrown if not enough space is available on the disc of the client system to store the data.

DP_ERROR_CREATE

Raised if dataprovider could not be instantiated.

DP_ERROR_SEND

Thrown if an error occurred while transmitting the data via the dataprovider.

DP_ERROR_WRITE

This exception is fired if the data transferred via the dataprovider can not be written to the disc on the client system.

DP_OUT_OF_MEMORY

Currently not used.

DP_TIMEOUT

Currently not used.

ERROR_NO_GUI

Currently not used.

FILE_NOT_FOUND

Currently not used.

FILE_WRITE_ERROR

This exception is fired if an error occurred while writing the file in the Web GUI.

FILESIZE_NOT_ALLOWED

Thrown if a file size has been specified for any transfer type other than BIN.

GUI_REFUSE_FILETRANSFER

If this exception is fired, the data could not be transferred to the Web GUI.

HEADER_NOT_ALLOWED

Raised if the parameter header contains data and any transfer type other than binary transfer type BIN has been specified or the append option has been set for transfer type BIN and the header contains data.

HEADER_TOO_LONG

If the header specified exceeds the maximum length allowed for the header, this exception will be raised.

INVALID_TYPE

This exception is raised if an invalid transfer type has been specified.

NO_BATCH

Currently not used.

NO_AUTHORITY

Thrown if user does not have the authorization to execute this operation.

NOT_SUPPORTED_BY_GUI

Currently not used.

SEPARATOR_NOT_ALLOWED

Fired if a separator has been specified for any transfer type other than BIN.

UNKNOWN_DP_ERROR

Thrown in case of an unidentified dataprovider error.

UNKNOWN_ERROR

Raised if an error occurs during the conversion of data to be transferred to the specified encoding or during the file transfer.