BASIS Function module Used the same way in S/4HANA

GUI_UPLOAD Upload File from PC

Reads a text or binary file from the user's PC into an internal table through SAP GUI. Almost every upload program that loads data from tab-delimited text or CSV files uses it. Pass HAS_FIELD_SEPARATOR = 'X' for tab-delimited files and choose the right CODEPAGE for national characters (e.g. 4110 for UTF-8); it does not run in the background, so use OPEN DATASET for server files.

Function group
SFES
Remote-enabled (RFC)
No
Type
Function module

Importing parameters

ParameterTypeDescriptionRequired
FILENAMESTRINGFile name (full path)Yes
FILETYPECHAR10File type (ASC, BIN, DAT)—
HAS_FIELD_SEPARATORCHAR01Fields separated by tab—
CODEPAGEABAP_ENCODINGCode page—
READ_BY_LINECHAR01Read line by line—

Exporting parameters

ParameterTypeDescription
FILELENGTHIFile length
HEADERXSTRINGFile header

Changing parameters

ParameterTypeDescriptionRequired
ISSCANPERFORMEDCHAR01Virus scan performed—

Tables parameters

ParameterTypeDescriptionRequired
DATA_TAB—Data tableYes

Exceptions

  • ACCESS_DENIED — Access denied
  • BAD_DATA_FORMAT — Bad data format
  • DISK_FULL — Disk full
  • DP_OUT_OF_MEMORY — Data provider out of memory
  • DP_TIMEOUT — Data provider timeout
  • FILE_OPEN_ERROR — File open error
  • FILE_READ_ERROR — File read error
  • GUI_REFUSE_FILETRANSFER — SAP GUI refused file transfer
  • HEADER_NOT_ALLOWED — Header not allowed
  • HEADER_TOO_LONG — Header too long
  • INVALID_TYPE — Invalid file type
  • NO_AUTHORITY — No authorization
  • NO_BATCH — Cannot run in background
  • SEPARATOR_NOT_ALLOWED — Separator not allowed
  • UNKNOWN_DP_ERROR — Unknown data provider error
  • UNKNOWN_ERROR — Unknown error

Call template (ABAP)

A skeleton generated from the interface. It lists mandatory importing parameters, exporting parameters and tables; declare the variables with suitable types in your own program.

CALL FUNCTION 'GUI_UPLOAD'
  EXPORTING
    filename = lv_filename
  IMPORTING
    filelength = lv_filelength
    header = lv_header
  CHANGING
    isscanperformed = lv_isscanperformed
  TABLES
    data_tab = lt_data_tab
  EXCEPTIONS
    access_denied = 1
    bad_data_format = 2
    disk_full = 3
    dp_out_of_memory = 4
    dp_timeout = 5
    file_open_error = 6
    file_read_error = 7
    gui_refuse_filetransfer = 8
    OTHERS = 9.

Can't find the report you need?

We also build anything that is not in the catalog. Describe it briefly and we will suggest the right solution.

Request a custom report