SAP Function GUI_UPLOAD - Upload for Data Provider

Parameter Reference Type Length Default Optional Text
CHECK_BOM CHAR01 C 1 SPACE X The consistency of the codepage and byte order mark will be checked
CODEPAGE ABAP_ENCODING 0 SPACE X Character Representation for Output
DAT_MODE CHAR01 C 1 SPACE X Numeric and Date Fields Imported in ws_download 'DAT' Format
FILENAME STRING g 0 Name of file
FILETYPE CHAR10 C 10 'ASC' X File Type (ASC or BIN)
HAS_FIELD_SEPARATOR CHAR01 C 1 SPACE X Columns Separated by Tabs in Case of ASCII Upload
HEADER_LENGTH I I 4 0 X Length of Header for Binary Data
IGNORE_CERR ABAP_BOOL 0 ABAP_TRUE X Specifies whether to ignore errors converting character sets
NO_AUTH_CHECK CHAR01 C 1 SPACE X Switch off Check for Access Rights
READ_BY_LINE CHAR01 C 1 'X' X The file will be written to the internal table line-by-line
REPLACEMENT ABAP_REPL C 1 '#' X Replacement Character for Non-Convertible Characters
VIRUS_SCAN_PROFILE VSCAN_PROFILE C 40 X Virus Scan Profile

Parameter Reference Type Length Text
FILELENGTH I I 4 File length
HEADER XSTRING y 0 File Header in Case of Binary Upload

Parameter Reference Length Optional Text
DATA_TAB 0 Transfer table for file contents

Exception Text
ACCESS_DENIED Access to File Denied
BAD_DATA_FORMAT Cannot Interpret Data in File
DISK_FULL Storage Medium full
DP_OUT_OF_MEMORY Not Enough Memory in Data Provider
DP_TIMEOUT Timeout of Data Provider
FILE_OPEN_ERROR File Does not Exist and Cannot be Opened
FILE_READ_ERROR Error reading file
GUI_REFUSE_FILETRANSFER Incorrect front end, or error in front end
HEADER_NOT_ALLOWED Header not Allowed
HEADER_TOO_LONG The header information is limited to 1023 bytes at present
INVALID_TYPE Incorrect parameter FILETYPE
NO_AUTHORITY No Authorization for Upload
NO_BATCH Front-End Function Cannot Be Executed in Backgrnd
SEPARATOR_NOT_ALLOWED Separator not Allowed
UNKNOWN_DP_ERROR Error Calling Data Provider
UNKNOWN_ERROR

Functionality
The module loads a file from the PC to the server. Data can betransferred binarily or as text. Numbers and date fields can beinterpreted according to the user settings.

Example

  • Binary upload: No conversion or interpretation

  • begin of itab,
    raw(255) type x,
    end of itab occurs 0.
    CALL FUNCTION 'GUI_UPLOAD'
    exporting
    filetype = 'BIN'
    filename = 'C:\DOWNLOAD.BIN'
    tables
    data_tab = itab.
    • Text upload

    • begin of itab,
      text(255) type c,
      end of itab occurs 0.
      CALL FUNCTION 'GUI_UPLOAD'
      exporting
      filetype = 'ASC'
      filename = 'C:\DOWNLOAD.TXT'
      tables
      data_tab = itab.

      Description
      Specifies the number of bytes transferred. If the file contains aheader, this header is not included in this value.

      Description
      Specifies the header information if this is contained in the file. Thisparameter is only set during a 'BIN' upload. The header is read in thelength of the parameter Header_Length from the beginning of the file.

      Description
      An exception is triggered if the file does not contain a byte order
      mark.

      Value range
      SPACE or 'X'

      Default
      SPACE

      Description
      Use parameter CODEPAGE to specify the desired source codepage. If thisparameter is not set, the codepage of the SAP GUI is used as the sourcecodepage.

      Value range
      4-digit number of the SAP codepage. The function moduleSCP_CODEPAGE_BY_EXTERNAL_NAME returns the SAP codepage number for anexternal character set name, for example, "iso-8859-1". The functionmodule NLS_GET_FRONTEND_CP returns the appropriate non-Unicode frontendcodepage for a language.
      You can determine the desired codepage interactively if the parameterwith_encoding of method file_open_dialog is set bycl_gui_frontend_services.
      If the specified codepage does not match the byte order mark, anexception is triggered.
      SPACE: Codepage of the frontend operating system.

      Default
      SPACE

      Description
      The components of the internal table are filled from the file. If thetable contains several columns, the entries in the file must beseparated by tabs. No conversion exits are performed.
      The following applies for the different data types:

      • I or N or P or F

      • The number must be formatted according to the decimal representation
        defined in the user settings.
        • D

        • The date must be formatted according to the date format defined in the
          user settings.
          • T

          • The time must be formatted as hh:mm:ss.

            Value range
            SPACE or 'X'

            Default
            SPACE

            Description
            Name of data file to be uploaded (if required with path name as prefix).If the path is invalid, the related exception is triggered.

            Value range
            A valid file name

            Description
            Describes how the upload file is read.

            Value range

            • 'BIN'.

            • The system reads a binary representation of the internal table from the
              file. The data is neither converted nor interpreted in this case.
              Usually, reasonable results are obtained only if the internal table
              consists of a single column of type 'X'.
              • 'DAT'

              • The components of the internal table are filled from the file. If the
                table contains several columns, the entries in the file must be
                separated by tabs. No conversion exits are performed.
                The following applies for the different data types:
                I or N or P or F
                The numbers must be formatted according to the decimal representation
                defined in the user settings.
                D
                The date must be formatted according to the date format defined in the
                user settings.
                T
                The time must be formatted as hh:mm:ss.
                • 'ASC'.

                • The components of the internal table are filled from the file. Only
                  data types with fixed length are allowed. The data must be contained
                  in the file in its full length.

                  Default
                  ASC

                  Description
                  Specifies if the fields in the file are separated by a tab. This isnecessary if the structure passed contains several components. CR/LFoccurs instead of a tab after the last field of a row.

                  Value range

                  • 'X': Fields are separated by tabs.

                  • SPACE: Fields are not separated by tabs. In this case, the table must

                  • contain either only one single column or all columns must be contained

                  • in the file in their full length.
                  • Default
                    SPACE

                    Description
                    Specifies the length of the header information. You must only set thisparameter if the file type is 'BIN'. The default value '00' means thatthere is no header in the file.

                    Default
                    '00'

                    Description
                    Specifies whether errors during the character set conversion should beignored.

                    Value range
                    ABAP_FALSE
                    Errors during a character set conversion, which cause the replacementcharacter to be used, are not ignored but trigger an exception.
                    ABAP_TRUE
                    If a character cannot be converted correctly and must be represented bythe replacement character, no exception is triggered.

                    Default
                    ABAP_TRUE

                    Description
                    If this parameter is set, then one row of the file corresponds toexactly one row of the internal table.
                    If this parameter is not set, then the rows of the internal table arefilled completely with the data in the file.
                    However, this feature is only supported for internal tables that haveexactly one data field which must be of the type character or string.Note that the row end characters CR/LF are not truncated as usual, butare also copied into the internal table.

                    Value range
                    SPACE or 'X'

                    Default
                    'X'

                    Description
                    Specifies the replacement character to be used if a character cannot beconverted during a character set conversion.

                    Value range
                    An individual character.

                    Default
                    '#'

                    Description
                    Specifies the name of a virus scan profile.
                    Application programs use the virus scan interface via virus scanprofiles.
                    A virus scan profile contains a list of scanner groups to be used tocheck a document. A virus scan profile also allows you to predefineconfiguration parameters for the virus scanner.
                    One virus scan profile can be flagged as the default profile. If will beused if an application access the virus scanner without explicitlyspecifying a profile name.

                    Value range
                    The namespace for virus scan profiles not delivered by SAP ise:

                    • X*

                    • Y*

                    • Z*
                    • Default

                      Description
                      Data table that is to hold the data to be uploaded.

                      Value range
                      An internal table with any number of fields which must be of theelementary type.
                      Important:
                      If you want to carry out a binary upload, the upload table must be oftype HEX.

803637Virus check added to gui_upload
1073779setting the Frontend Up-/Download Codepage
1467481Japan:FI-CA:RFKKJPDT00: Error while reading incoming file
1543940Crash after second upload/download of the same "doc"-file
513435Windows code page setup for non-Unicode text files
739192Batchman: Program termination in background processing
1088209Help for troubleshooting: Code page display problems
752835Usage of the file interfaces in Unicode systems
986717DSD: Procedure for dumps when transferring between HH and CN
735946Migration runtime error during upload
695907Syslog CP7 ... rscpc 180
617872DMEE: Runtime error during upload/download of XML tree