SAP GUI_UPLOAD Function Module for Upload for Data Provider









GUI_UPLOAD is a standard gui upload SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used for Upload for Data Provider processing and below is the pattern details for this FM, showing its interface including any import and export parameters, exceptions etc. there is also a full "cut and paste" ABAP pattern code example, along with implementation ABAP coding, documentation and contribution comments specific to this or related objects.


See here to view full function module documentation and code listing for gui upload FM, simply by entering the name GUI_UPLOAD into the relevant SAP transaction such as SE37 or SE38.

Function Group: SFES
Program Name: SAPLSFES
Main Program: SAPLSFES
Appliation area:
Release date: 23-Mar-2001
Mode(Normal, Remote etc): Normal Function Module
Update:



Function GUI_UPLOAD pattern details

In-order to call this FM within your sap programs, simply using the below ABAP pattern details to trigger the function call...or see the full ABAP code listing at the end of this article. You can simply cut and paste this code into your ABAP progrom as it is, including variable declarations.
CALL FUNCTION 'GUI_UPLOAD'"Upload for Data Provider
EXPORTING
FILENAME = "Name of file
* CHECK_BOM = ' ' "The consistency of the codepage and byte order mark will be checked
* VIRUS_SCAN_PROFILE = "Virus Scan Profile
* NO_AUTH_CHECK = ' ' "Switch off Check for Access Rights
* FILETYPE = 'ASC' "File Type (ASC or BIN)
* HAS_FIELD_SEPARATOR = ' ' "Columns Separated by Tabs in Case of ASCII Upload
* HEADER_LENGTH = 0 "Length of Header for Binary Data
* READ_BY_LINE = 'X' "The file will be written to the internal table line-by-line
* DAT_MODE = ' ' "Numeric and Date Fields Imported in ws_download 'DAT' Format
* CODEPAGE = ' ' "Character Representation for Output
* IGNORE_CERR = ABAP_TRUE "Specifies whether to ignore errors converting character sets
* REPLACEMENT = '#' "Replacement Character for Non-Convertible Characters

IMPORTING
FILELENGTH = "File Length
HEADER = "File Header in Case of Binary Upload

CHANGING
* ISSCANPERFORMED = ' ' "File already scanned

TABLES
DATA_TAB = "Transfer table for file contents

EXCEPTIONS
FILE_OPEN_ERROR = 1 SEPARATOR_NOT_ALLOWED = 10 HEADER_TOO_LONG = 11 UNKNOWN_DP_ERROR = 12 ACCESS_DENIED = 13 DP_OUT_OF_MEMORY = 14 DISK_FULL = 15 DP_TIMEOUT = 16 FILE_READ_ERROR = 2 NO_BATCH = 3 GUI_REFUSE_FILETRANSFER = 4 INVALID_TYPE = 5 NO_AUTHORITY = 6 UNKNOWN_ERROR = 7 BAD_DATA_FORMAT = 8 HEADER_NOT_ALLOWED = 9
.



IMPORTING Parameters details for GUI_UPLOAD

FILENAME - Name of file

Data type: STRING
Optional: No
Call by Reference: Yes

CHECK_BOM - The consistency of the codepage and byte order mark will be checked

Data type: CHAR01
Default: SPACE
Optional: Yes
Call by Reference: Yes

VIRUS_SCAN_PROFILE - Virus Scan Profile

Data type: VSCAN_PROFILE
Optional: Yes
Call by Reference: Yes

NO_AUTH_CHECK - Switch off Check for Access Rights

Data type: CHAR01
Default: SPACE
Optional: Yes
Call by Reference: Yes

FILETYPE - File Type (ASC or BIN)

Data type: CHAR10
Default: 'ASC'
Optional: Yes
Call by Reference: Yes

HAS_FIELD_SEPARATOR - Columns Separated by Tabs in Case of ASCII Upload

Data type: CHAR01
Default: SPACE
Optional: Yes
Call by Reference: Yes

HEADER_LENGTH - Length of Header for Binary Data

Data type: I
Optional: Yes
Call by Reference: Yes

READ_BY_LINE - The file will be written to the internal table line-by-line

Data type: CHAR01
Default: 'X'
Optional: Yes
Call by Reference: Yes

DAT_MODE - Numeric and Date Fields Imported in ws_download 'DAT' Format

Data type: CHAR01
Default: SPACE
Optional: Yes
Call by Reference: Yes

CODEPAGE - Character Representation for Output

Data type: ABAP_ENCODING
Default: SPACE
Optional: Yes
Call by Reference: Yes

IGNORE_CERR - Specifies whether to ignore errors converting character sets

Data type: ABAP_BOOL
Default: ABAP_TRUE
Optional: Yes
Call by Reference: Yes

REPLACEMENT - Replacement Character for Non-Convertible Characters

Data type: ABAP_REPL
Default: '#'
Optional: Yes
Call by Reference: Yes

EXPORTING Parameters details for GUI_UPLOAD

FILELENGTH - File Length

Data type: I
Optional: No
Call by Reference: No ( called with pass by value option)

HEADER - File Header in Case of Binary Upload

Data type: XSTRING
Optional: No
Call by Reference: No ( called with pass by value option)

CHANGING Parameters details for GUI_UPLOAD

ISSCANPERFORMED - File already scanned

Data type: CHAR01
Default: SPACE
Optional: Yes
Call by Reference: Yes

TABLES Parameters details for GUI_UPLOAD

DATA_TAB - Transfer table for file contents

Data type:
Optional: No
Call by Reference: No ( called with pass by value option)

EXCEPTIONS details

FILE_OPEN_ERROR - File does not exist and cannot be opened

Data type:
Optional: No
Call by Reference: No ( called with pass by value option)

SEPARATOR_NOT_ALLOWED - Invalid separator

Data type:
Optional: No
Call by Reference: Yes

HEADER_TOO_LONG - The header information is limited to 1023 bytes at present

Data type:
Optional: No
Call by Reference: Yes

UNKNOWN_DP_ERROR - Error when calling data provider

Data type:
Optional: No
Call by Reference: Yes

ACCESS_DENIED - Access to File Denied

Data type:
Optional: No
Call by Reference: Yes

DP_OUT_OF_MEMORY - Not Enough Memory in Data Provider

Data type:
Optional: No
Call by Reference: Yes

DISK_FULL - Storage medium is full.

Data type:
Optional: No
Call by Reference: Yes

DP_TIMEOUT - Timeout of Data Provider

Data type:
Optional: No
Call by Reference: Yes

FILE_READ_ERROR - Error when reading file

Data type:
Optional: No
Call by Reference: No ( called with pass by value option)

NO_BATCH - Cannot execute front-end function in background

Data type:
Optional: No
Call by Reference: No ( called with pass by value option)

GUI_REFUSE_FILETRANSFER - Incorrect front end or error on front end

Data type:
Optional: No
Call by Reference: No ( called with pass by value option)

INVALID_TYPE - Incorrect parameter FILETYPE

Data type:
Optional: No
Call by Reference: No ( called with pass by value option)

NO_AUTHORITY - No Authorization for Upload

Data type:
Optional: No
Call by Reference: No ( called with pass by value option)

UNKNOWN_ERROR -

Data type:
Optional: No
Call by Reference: No ( called with pass by value option)

BAD_DATA_FORMAT - Cannot Interpret Data in File

Data type:
Optional: No
Call by Reference: Yes

HEADER_NOT_ALLOWED - Invalid header

Data type:
Optional: No
Call by Reference: Yes

Copy and paste ABAP code example for GUI_UPLOAD Function Module

The ABAP code below is a full code listing to execute function module POPUP_TO_CONFIRM including all data declarations. The code uses the original data declarations rather than the latest in-line data DECLARATION SYNTAX but I have included an ABAP code snippet at the end to show how declarations would look using the newer method of declaring data variables on the fly. This will allow you to compare and fully understand the new inline method. Please note some of the newer syntax such as the @DATA is not available until a later 4.70 service pack (SP8), which i why i have stuck to the origianl for this example.

DATA:
lt_data_tab  TYPE STANDARD TABLE OF STRING, "   
lv_filename  TYPE STRING, "   
lv_filelength  TYPE I, "   
lv_file_open_error  TYPE I, "   
lv_isscanperformed  TYPE CHAR01, "   SPACE
lv_check_bom  TYPE CHAR01, "   SPACE
lv_separator_not_allowed  TYPE CHAR01, "   
lv_header_too_long  TYPE CHAR01, "   
lv_virus_scan_profile  TYPE VSCAN_PROFILE, "   
lv_no_auth_check  TYPE CHAR01, "   SPACE
lv_unknown_dp_error  TYPE CHAR01, "   
lv_access_denied  TYPE CHAR01, "   
lv_dp_out_of_memory  TYPE CHAR01, "   
lv_disk_full  TYPE CHAR01, "   
lv_dp_timeout  TYPE CHAR01, "   
lv_header  TYPE XSTRING, "   
lv_filetype  TYPE CHAR10, "   'ASC'
lv_file_read_error  TYPE CHAR10, "   
lv_no_batch  TYPE CHAR10, "   
lv_has_field_separator  TYPE CHAR01, "   SPACE
lv_header_length  TYPE I, "   0
lv_gui_refuse_filetransfer  TYPE I, "   
lv_invalid_type  TYPE I, "   
lv_read_by_line  TYPE CHAR01, "   'X'
lv_dat_mode  TYPE CHAR01, "   SPACE
lv_no_authority  TYPE CHAR01, "   
lv_codepage  TYPE ABAP_ENCODING, "   SPACE
lv_unknown_error  TYPE ABAP_ENCODING, "   
lv_ignore_cerr  TYPE ABAP_BOOL, "   ABAP_TRUE
lv_bad_data_format  TYPE ABAP_BOOL, "   
lv_replacement  TYPE ABAP_REPL, "   '#'
lv_header_not_allowed  TYPE ABAP_REPL. "   

  CALL FUNCTION 'GUI_UPLOAD'  "Upload for Data Provider
    EXPORTING
         FILENAME = lv_filename
         CHECK_BOM = lv_check_bom
         VIRUS_SCAN_PROFILE = lv_virus_scan_profile
         NO_AUTH_CHECK = lv_no_auth_check
         FILETYPE = lv_filetype
         HAS_FIELD_SEPARATOR = lv_has_field_separator
         HEADER_LENGTH = lv_header_length
         READ_BY_LINE = lv_read_by_line
         DAT_MODE = lv_dat_mode
         CODEPAGE = lv_codepage
         IGNORE_CERR = lv_ignore_cerr
         REPLACEMENT = lv_replacement
    IMPORTING
         FILELENGTH = lv_filelength
         HEADER = lv_header
    CHANGING
         ISSCANPERFORMED = lv_isscanperformed
    TABLES
         DATA_TAB = lt_data_tab
    EXCEPTIONS
        FILE_OPEN_ERROR = 1
        SEPARATOR_NOT_ALLOWED = 10
        HEADER_TOO_LONG = 11
        UNKNOWN_DP_ERROR = 12
        ACCESS_DENIED = 13
        DP_OUT_OF_MEMORY = 14
        DISK_FULL = 15
        DP_TIMEOUT = 16
        FILE_READ_ERROR = 2
        NO_BATCH = 3
        GUI_REFUSE_FILETRANSFER = 4
        INVALID_TYPE = 5
        NO_AUTHORITY = 6
        UNKNOWN_ERROR = 7
        BAD_DATA_FORMAT = 8
        HEADER_NOT_ALLOWED = 9
. " GUI_UPLOAD




ABAP code using 7.40 inline data declarations to call FM GUI_UPLOAD

The below ABAP code uses the newer in-line data declarations. This allows you to see the coding differences/benefits of the later inline syntax. Please note some of the newer syntax below, such as the @DATA is not available until 4.70 EHP 8.

 
 
 
 
DATA(ld_isscanperformed) = ' '.
 
DATA(ld_check_bom) = ' '.
 
 
 
 
DATA(ld_no_auth_check) = ' '.
 
 
 
 
 
 
 
DATA(ld_filetype) = 'ASC'.
 
 
 
DATA(ld_has_field_separator) = ' '.
 
 
 
 
DATA(ld_read_by_line) = 'X'.
 
DATA(ld_dat_mode) = ' '.
 
 
DATA(ld_codepage) = ' '.
 
 
DATA(ld_ignore_cerr) = ABAP_TRUE.
 
 
DATA(ld_replacement) = '#'.
 
 


Search for further information about these or an SAP related objects



Comments on this SAP object

What made you want to lookup this SAP object? Please tell us what you were looking for and anything you would like to be included on this page!