GUI_UPLOAD error

Hi,
I am getting a dump error while using the FM GUI_UPLOAD, i am using the FM KD_GET_FILENAME_ON_F4 to get the file name and the Parameter is defined as parameters: p_pcfile type rlgrap-filename. The error is  CALL_FUNCTION_CONFLICT_TYPE
CX_SY_DYN_CALL_ILLEGAL_TYPE
Is there any other way to over come this issue.
Thanks
Kumar

hi check this simple example.....
send the file to a string before giving it to the gui_upload.
REPORT  ZVENKATTEST0.
data: begin of itab occurs 0,
      a type c,
      c type c,
      b type i,
      end of itab.
itab-a = 'a' .
itab-c = ':'.
itab-b = 1 .
append itab .
itab-a = 'b' .
itab-c = ':'.
itab-b = 2 .
append itab .
itab-a = 'c' .
itab-c = ':'.
itab-b = 3 .
append itab .
data: file type string .
file = 'C:\Documents and Settings\venkatapp\Desktop\testing1.txt'.
CALL FUNCTION 'GUI_DOWNLOAD'
  EXPORTING
    FILENAME                        = file
   FILETYPE                        = 'ASC'
   WRITE_FIELD_SEPARATOR           = ':'
  TABLES
    DATA_TAB                        = itab.

Similar Messages

  • FM "GUI_UPLOAD" : Error Message

    Dear All,
    I'm doing one Customer Invoice upload program.
    In the selection screen, I have one parameter to get File path from the users.
    It executes first time without any error.
    I dont change any parameter in the selection screen. I execute this program again. But it shows an information message stating "WRONG PARAMETER: FILE_NAME" and after OK, it shows an error message stating "File is not available". This error is coming from the FM "GUI_UPLOAD".
    I set breakpoint after GUI_UPLOAD. SY-SUBRC = 1. It means "file_open_error = 1".
    Can anyone tell the reason and solution for this problem?
    Points will be rewarded.
    Thanks & Regards,
    Neeraj

    yes u need to assign file name type string ......see the sample code ...........here i have used class 'frontend services' to fetch the file......
    DATA: FILENAME  TYPE STRING,                           "Default File Name
          FILETABLE TYPE FILETABLE,                        "Table Holding Selected Files
          V_RC      TYPE I,                                "Return Code, Number of Files or -1 If Error Occurred
          V_FILE TYPE STRING.                              "
    FILENAME = 'C:\Documents and Settings\ramyav\Desktop\raam.txt'..
    CALL METHOD CL_GUI_FRONTEND_SERVICES=>FILE_OPEN_DIALOG
      EXPORTING
       WINDOW_TITLE            =
       DEFAULT_EXTENSION       =
        DEFAULT_FILENAME        = FILENAME
       FILE_FILTER             =
       WITH_ENCODING           =
       INITIAL_DIRECTORY       =
       MULTISELECTION          =
      CHANGING
        FILE_TABLE              =  FILETABLE
        RC                      =  V_RC
       USER_ACTION             =
       FILE_ENCODING           =
      EXCEPTIONS
        FILE_OPEN_DIALOG_FAILED = 1
        CNTL_ERROR              = 2
        ERROR_NO_GUI            = 3
        NOT_SUPPORTED_BY_GUI    = 4
        OTHERS                  = 5
    IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
               WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    IF SY-SUBRC = 0.
      READ TABLE FILETABLE INDEX 1 INTO V_FILE.
    ENDIF.
    IF V_RC = 1.
      CALL FUNCTION 'GUI_UPLOAD'
        EXPORTING
          FILENAME                      = V_FILE
         FILETYPE                      = 'ASC'
         HAS_FIELD_SEPARATOR           = 'X'
      HEADER_LENGTH                 = 0
      READ_BY_LINE                  = 'X'
      DAT_MODE                      = ' '
      CODEPAGE                      = ' '
      IGNORE_CERR                   = ABAP_TRUE
      REPLACEMENT                   = '#'
      CHECK_BOM                     = ' '
      VIRUS_SCAN_PROFILE            = VIRUS_SCAN_PROFILE
      NO_AUTH_CHECK                 = ' '
    IMPORTING
      FILELENGTH                    = FILELENGTH
      HEADER                        = HEADER
        TABLES
          DATA_TAB                      = IT_TABLE
       EXCEPTIONS
         FILE_OPEN_ERROR               = 1
         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
         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
         OTHERS                        = 17
      IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    ENDIF.
    reward points if helpful

  • GUI_UPLOAD error when reading PDF

    Hi,
    I am using GUI_UPLOAD to read a PDF and store it against a material number. When I go into MM03 to view all the attachments it shows that it is there but when I try to open it an error appears stating 'There was an error opening this document. The file is damaged and could not be repaired.' I have done the same process with other types of documents and it works fine. The problem is only for PDF. Any assistance in this would be truly appreciated.
    Kind regards,
    Neera

    Hi
    Refer this link. You will find the <b>procedure to upload PDF files</b> in <b> page  7</b>.
    <a href=" https://www.sdn.sap.comhttp://www.sdn.sap.comhttp://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/8046aa90-0201-0010-5e99-962948c83331">https://www.sdn.sap.comhttp://www.sdn.sap.comhttp://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/8046aa90-0201-0010-5e99-962948c83331</a>
    Regards
    Raj

  • GUI_UPLOAD error conversion 'u00E7'

    Hi,
    I have a file to upload to an internal table  and i use GUI_UPLOAD function, i already try with filetype ASC and DAT but the words with CHAR 'Ç' as convert in 'A#' increase one CHAR in line on my internal table.
    Anyone could help me.
    Thanks and Regards,
    Eduardo Paiva

    Hi Eduardo,
    I don't know if you wrote wrong only here or in your abap code too, but the code page is 1160, not 1106.
    You can see this number with the FM NLS_GET_FRONTEND_CP
      DATA: t_file TYPE STANDARD TABLE OF string.
      DATA: v_frontend_cp TYPE cpcodepage,
            v_codepage    TYPE abap_encod.
      CALL FUNCTION 'NLS_GET_FRONTEND_CP'
        EXPORTING
          langu                       = sy-langu
    *     FETYPE                      = 'MS'
        IMPORTING
          frontend_codepage           = v_frontend_cp
        EXCEPTIONS
          illegal_syst_codepage       = 1
          no_frontend_cp_found        = 2
          internal_or_db_error        = 3
          others                      = 4.
      IF sy-subrc <> 0.
         MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
             WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
      v_codepage = v_frontend_cp.
      CALL FUNCTION 'GUI_UPLOAD'
        EXPORTING
          filename                      = 'C:\temp.txt'
          filetype                      = 'ASC'
          codepage                      = v_codepage
        TABLES
          data_tab                      = t_file
        EXCEPTIONS
          file_open_error               = 1
          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
          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
          others                        = 17.
      IF sy-subrc <> 0.
         MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
             WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    Not sure if it solve your problem.. but try it anyway
    Paulo.

  • "Cannot interpret data in file" error while using GUI_UPLOAD for .xls file

    Hi,
         I have made a program using FM GUI_UPLOAD to upload an .xls file to an internal table. But upon executing ,it gives error "Cannot Interpret data in file". I have seen in other posts people talking about GUI_UPLOAD FM to upload data from excel directly into internal table. Kindly help.
    Here is my code. I had tried using different combination for HAS_FIELD_SEPARATOR but still its not working.
    In my emp1.xls file , the data in each column is present in the same order as in the internal table. Although the first column in my internal table is NUMC. I dont know if that is causing the problem.
    REPORT  ZUPLOAD_1.
    data: itab TYPE TABLE OF zempl_master WITH HEADER LINE.
    CALL FUNCTION 'GUI_UPLOAD'
      EXPORTING
        FILENAME                      = 'C:\empl1.xls'
        FILETYPE                      = 'ASC'
        HAS_FIELD_SEPARATOR           = 'X'
    *   HEADER_LENGTH                 = 0
    *   READ_BY_LINE                  = 'X'
    *   DAT_MODE                      = ' '
    *   CODEPAGE                      = ' '
    *   IGNORE_CERR                   = ABAP_TRUE
    *   REPLACEMENT                   = '#'
    *   CHECK_BOM                     = ' '
    *   VIRUS_SCAN_PROFILE            =
    *   NO_AUTH_CHECK                 = ' '
    * IMPORTING
    *   FILELENGTH                    =
    *   HEADER                        =
      TABLES
        DATA_TAB                      = itab.
    * EXCEPTIONS
    *   FILE_OPEN_ERROR               = 1
    *   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
    *   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
    *   OTHERS                        = 17
    IF SY-SUBRC <> 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    LOOP at itab.
      write:/ itab-emp_no,itab-name.
    endloop.

    hi amber22 you need to use the below fm to upload an xls file
    FORM EXCEL_UPLOAD .
    CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'
        EXPORTING
          FILENAME    = FILENAM
          I_BEGIN_COL = 1
          I_BEGIN_ROW = 1
          I_END_COL   = 6
          I_END_ROW   = 100
        TABLES
          INTERN      = xl_itab.
    * EXCEPTIONS
    * INCONSISTENT_PARAMETERS = 1
    * UPLOAD_OLE = 2
    * OTHERS = 3 .
      IF SY-SUBRC = 0.
    MESSAGE 'DATA UPLOADED SUCCESSFULLY' TYPE 'I'.
      ENDIF.
    ENDFORM.                    " EXCEL_UPLOAD

  • Error while using the function module GUI_UPLOAD

    Hi,
    My requirement is to upload the data from .txt file into internal table.
    I have given my code like this
    PARAMETERS: p_fname LIKE rlgrap-filename.
    data: begin of gt_string occurs 0,
           record type char255,
          end of gt_string.
    AT SELECTION-SCREEN ON VALUE-REQUEST for p_fname.
      CALL FUNCTION 'KD_GET_FILENAME_ON_F4'
       EXPORTING
        PROGRAM_NAME        = SYST-REPID
        DYNPRO_NUMBER       = SYST-DYNNR
        FIELD_NAME          = ' '
         STATIC              = 'X'
        MASK                = ' '
        CHANGING
          file_name           = p_fname
       EXCEPTIONS
         MASK_TOO_LONG       = 1
         OTHERS              = 2
      IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
      CALL FUNCTION 'GUI_UPLOAD'
        EXPORTING
          filename                      = p_fname
         FILETYPE                      = 'ASC'
         HAS_FIELD_SEPARATOR           = 'X'
         HEADER_LENGTH                 = 0
        READ_BY_LINE                  = 'X'
        DAT_MODE                      = ' '
        CODEPAGE                      = ' '
        IGNORE_CERR                   = ABAP_TRUE
        REPLACEMENT                   = '#'
        CHECK_BOM                     = ' '
        NO_AUTH_CHECK                 = ' '
      IMPORTING
        FILELENGTH                    =
        HEADER                        =
        tables
          data_tab                      = gt_string
       EXCEPTIONS
         FILE_OPEN_ERROR               = 1
         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
         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
         OTHERS                        = 17
      IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    Here I am getting dump error as 'Type conflict when calling a function module.
    The function module interface allows you to specify only fields
    of a particular type under "FILENAME". The field "P_FNAME" specified here has a different field type'.
    What would be the reason for this error?
    Can anyone help me?
    Regards,
    Hema

    see this sample program for F4 help
    *& Report  ZSD_EXCEL_INT_APP
    REPORT  ZSD_EXCEL_INT_APP.
    parameter: file_nm type localfile.
    types : begin of it_tab1,
            f1(20),
            f2(40),
            f3(20),
           end of it_tab1.
    data : it_tab type table of ALSMEX_TABLINE with header line,
           file type rlgrap-filename.
    data : it_tab2 type it_tab1 occurs 1,
           wa_tab2 type it_tab1,
           w_message(100)  TYPE c.
    at selection-screen on value-request for file_nm.
    CALL FUNCTION 'KD_GET_FILENAME_ON_F4'
    EXPORTING
      PROGRAM_NAME        = SYST-REPID
      DYNPRO_NUMBER       = SYST-DYNNR
      FIELD_NAME          = ' '
       STATIC              = 'X'
      MASK                = ' '
      CHANGING
       file_name           = file_nm
    EXCEPTIONS
       MASK_TOO_LONG       = 1
       OTHERS              = 2
    IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
             WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    start-of-selection.
    refresh it_tab2[].clear wa_tab2.
    file = file_nm.
    CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'
      EXPORTING
        filename                      = file
        i_begin_col                   = '1'
        i_begin_row                   =  '1'
        i_end_col                     = '10'
        i_end_row                     = '35'
      tables
        intern                        = it_tab
    EXCEPTIONS
       INCONSISTENT_PARAMETERS       = 1
       UPLOAD_OLE                    = 2
       OTHERS                        = 3
    IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
             WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    loop at it_tab.
      case it_tab-col.
       when '002'.
        wa_tab2-f1 = it_tab-value.
       when '004'.
        wa_tab2-f2 = it_tab-value.
      when '008'.
        wa_tab2-f3 = it_tab-value.
    endcase.
    at end of row.
      append wa_tab2 to it_tab2.
    clear wa_tab2.
      endat.
    endloop.
    data : p_file TYPE  rlgrap-filename value 'TEST3.txt'.
    OPEN DATASET p_file FOR OUTPUT IN TEXT MODE ENCODING DEFAULT.
    *--- Display error messages if any.
      IF sy-subrc NE 0.
        MESSAGE e001(zsd_mes).
        EXIT.
      ELSE.
    *---Data is downloaded to the application server file path
        LOOP AT it_tab2 INTO wa_tab2.
          TRANSFER wa_tab2 TO p_file.
        ENDLOOP.
      ENDIF.
    *--Close the Application server file (Mandatory).
      CLOSE DATASET p_file.
    loop at it_tab2 into wa_tab2.
      write : / wa_tab2-f1,wa_tab2-f2,wa_tab2-f3.
    endloop.

  • Runtime error while using GUI_UPLOAD

    Hi All,
    I have a text file which contains few records delimited by tab.
    I am trying to upload the contents of the file into an internal table using the FM GUI_UPLOAD
    But, I am getting run time error 'Type conflict when calling a function module'.
    The code that I had written is shown below.
    Please let me know where I went wrong.
    REPORT  Z84364BDC                               .
    TYPES : BEGIN OF ITAB_TP,
            MATNR TYPE MARA-MATNR,
            EAN11 TYPE MARA-EAN11,
            END OF ITAB_TP.
    DATA : FILE_ITAB TYPE STANDARD TABLE OF ITAB_TP.
    DATA : ITAB_WA TYPE ITAB_TP.
    SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-T01.
    PARAMETERS : P_FILE TYPE RLGRAP-FILENAME DEFAULT 'D:\Example.txt'.
    SELECTION-SCREEN END OF BLOCK B1.
    ***FILLING THE INTERNAL TABLE****
    CALL FUNCTION 'GUI_UPLOAD'
      EXPORTING
        filename                      = P_FILE
        FILETYPE                      = 'ASC'
        has_field_separator           = ','
        tables
        data_tab                      = FILE_ITAB
    EXCEPTIONS
       FILE_OPEN_ERROR               = 1
       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
       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
       OTHERS                        = 17
    IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
             WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.

    The file is delimited by Comma field as mentioned above.
    Below is the code that I had written. But, I face the same problem
    REPORT  Z84364BDC                               .
    TYPES : BEGIN OF ITAB_TP,
            MATNR TYPE MARA-MATNR,
            EAN11 TYPE MARA-EAN11,
            END OF ITAB_TP.
    DATA : FILE_ITAB TYPE STANDARD TABLE OF ITAB_TP.
    DATA : ITAB_WA TYPE ITAB_TP.
    SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-T01.
    PARAMETERS : P_PATH TYPE RLGRAP-FILENAME DEFAULT 'D:\Example.txt'.
    SELECTION-SCREEN END OF BLOCK B1.
    DATA : P_FILE TYPE STRING.
    P_FILE = P_PATH.
    ****FILLING THE INTERNAL TABLE*****
    CALL FUNCTION 'GUI_UPLOAD'
      EXPORTING
        filename                      = P_FILE
        FILETYPE                      = 'ASC'
        has_field_separator           = 'X'
        tables
        data_tab                      = FILE_ITAB
    EXCEPTIONS
       FILE_OPEN_ERROR               = 1
       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
       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
       OTHERS                        = 17
    IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
             WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    ***Displaying the Material*****
    LOOP AT FILE_ITAB INTO ITAB_WA.
    WRITE:/ ITAB_WA-MATNR.
    ENDLOOP.

  • Error in gui_upload

    hi guru,
    iam doing some bdc program.. but ity will going to dump on gui_upload.. so plz help me.
    An exception occurred that is explained in detail
    The exception, which is assigned to class 'CX_SY_DYN_CALL_ILLEGAL_TYPE', was
    not caught in.
    procedure "F_UPLOAD_FILE" "(FORM)", nor was it propagated by a RAISING clause.
    Since the caller of the procedure could not have anticipated that the
    exception would occur, the current program is terminated.
    The reason for the exception is:
    The call to the function module "GUI_UPLOAD" is incorrect:
    The function module interface allows you to specify only
    fields of a particular type under "FILENAME".
    The field "P_P_FILE" specified here is a different
    field type
    SELECTION-SCREEN : BEGIN OF BLOCK b1 WITH FRAME TITLE text-h01.                         
    PARAMETERS: p_file LIKE rlgra-filename                                                                               
    SELECTION-SCREEN : END OF BLOCK b1.                                                                                .----
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.                                                                               
    PERFORM f_get_file USING p_file.                                                                               
    CALL FUNCTION 'KD_GET_FILENAME_ON_F4'       
    *EXPORTING-                                                                               
    CHANGING                                                                               
    FILE_NAME           = p_p_file                                                                               
    endform.               
    form f_upload_file  using    p_p_file.                                                                               
    CALL FUNCTION 'GUI_UPLOAD'                                                                               
    EXPORTING                                                                               
    FILENAME                      = p_p_file                                                                               
    FILETYPE                      = 'DAT'                                                                               
    endform.

    Hi,
    Refer the program given below. it is working fine for me.
    make the paramerter as:
    pa_dfile TYPE rcgfiletr-ftfront.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR pa_dfile.
      CALL FUNCTION 'KD_GET_FILENAME_ON_F4'
        EXPORTING
          static        = 'X'
          mask          = '(Text file|*.TXT'
        CHANGING
          file_name     = pa_dfile
        EXCEPTIONS
          mask_too_long = 1
          OTHERS        = 2.
      IF sy-subrc <> 0.
        MESSAGE ID 'PG' TYPE 'E' NUMBER '016'
              WITH 'Error in F4 help'(005).
        "The provided file is not an excel sheet.
        RETURN.
      ENDIF.
    DATA: lv_filetype(10) TYPE c,
            lv_gui_sep TYPE c,
            lv_file_name TYPE string.
      lv_filetype = 'ASC'.
      lv_gui_sep = 'X'.
      lv_file_name = pa_dfile.
    FM call to upload file
      CALL FUNCTION 'GUI_UPLOAD'
        EXPORTING
          filename                = lv_file_name
          filetype                = lv_filetype
          has_field_separator     = lv_gui_sep 
        TABLES
          data_tab                = gi_table
        EXCEPTIONS
          file_open_error         = 1
          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
          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
          OTHERS                  = 17.
      IF sy-subrc <> 0.
        MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      ENDIF.
    Hope it helps.
    Regards
    Rajesh Kumar
    Edited by: Rajesh Kumar on Jul 24, 2009 7:11 AM

  • Regarding error in GUI_UPLOAD FM

    Dear all,
    i  got an error mesaage in GUI_UPLAD FM when i m uploading a file in to it .
    error message " Recursive occurrence of virus scan profile /SCET/GUI_UPLOAD in the sequence /SCET/GUI_UPLOAD"
    please give me any solution how to slove it.
    thanks in advance
    abhilash

    Solved by self
    see this link for ans.
    https://cw.sdn.sap.com/cw/docs/DOC-113596?decorator=print

  • Getting CONTROL_FLUSH_ERROR error with GUI_UPLOAD

    Hi Friends
    In my Report I am using the FM: GUI_UPLOAD and while running the report in foreground, I am getting the proper results. But while running the same in Background I am getting the error: CONTROL_FLUSH_ERROR .
    As my understanding ,to resolve this we have to upgrade the sap gui.
    Can anyone suggest me the exact reason for this error and the solution as well.
    Points are assured for useful answers.
    @SAP GURUS: I am eagerly waiting for your help and suggestions on this.
    Regards,
    Sree

    Hi,
    As far as i know, there is no note for this. this is the functionality of GUI_UPLOAD>
    GUI_* and WS_* function modules are not designed to work in that way, as they need to access your personal computer  file.
    To choose the correct download method to used, you can check the value of SY-BATCH in your code, check if background or foreground mode and then execute.
    Hope this helps. Pls reward points if useful.
    Shruthi

  • Error in background on GUI_UPLOAD.

    Hi,
    If i run a report in background which contains the function module : GUI_UPLOAD it is getting the error message as 'Error uploading C:\Documents and Settings\...' .
    do the gui_upload wont execute in background?.
    Please suggest.
    Usefull anwers will be rewarded.
    Neslin.

    Hi
      The GUI Upload and GUI download FMs are used only when the program is executed in the foreground only.
       If we have to use the GUI download in the background u have to first create a program such that the file from the presentation server is trannsferred to the application server through the help of the dataset statements.
      Then on onwards your program would be executed in the background succesfully.
    Regards
    Rajesh.

  • FM GUI_UPLOAD gives PC036 "Error when opening the download file".

    Dear all
    I'm having a problem with a particular PC.
    A program which calls FM GUI_UPLOAD gives the error PC036 "Error when opening the download file".
    The file we are trying to upload is a text file, with tab delimiter.
    If the same user executes the same program from another PCs, it works fine.
    If another user executes the program in the "problematic" PC, it gives the error.
    So, the problem is PC-related.
    I checked SAP GUI Codepage, and was the same as other PCs.
    I cheched regional configuration, and was also the same as other PCs.
    The operating  system is Windows XP, and the SAP GUI version is 7.10,  File version 7100.2.7.3077, Build 967944 , Patch level 7.
    SAP version is ECC6.
    I searched across forums, SAP note, and the web, but I couldn't find anything.
    I would be grateful if someone could give me ideas.
    Thanks in advance
    Jordi

    Hello. The user accounts are have same privilegies (like both are "Power users")? Also the file system are the same in both PC NTFS or FAT32 (today i'm find FAT32 in enterprise ) If NTFS may be some Domain politics are not allow to save file correctly, or space are not enough....Try check this first...Regards.

  • SLIN error for GUI_upload

    Hi
    I'm working with Unicode project, I have replaced ws_upload with gui_upload. I found one error in EPC(extended program check) the file is not compatible.
    Can anyone help me?
    Thanks
    Sapien

    PARAMETERS: p_syfild TYPE rlgrap-filename.
    DATA: lv_file TYPE string.
    lv_file = p_syfilh.
      CALL FUNCTION 'GUI_UPLOAD'
       EXPORTING
          filename                      = lv_file
       filetype                      = 'ASC'
         HAS_FIELD_SEPARATOR           = ' '
         HEADER_LENGTH                 = 0
         READ_BY_LINE                  = 'X'
         DAT_MODE                      = ' '
         CODEPAGE                      = ' '
         IGNORE_CERR                   = ABAP_TRUE
         REPLACEMENT                   = '#'
         CHECK_BOM                     = ' '
        IMPORTING
         FILELENGTH                    =
         HEADER                        =
        TABLES
          data_tab                      = it_legacy
       EXCEPTIONS
         file_open_error               = 1
         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
         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
         OTHERS                        = 17.
      IF sy-subrc <> 0.
        MESSAGE e000 WITH 'Unable to upload the file'(007).    "Error Message
       endif.

  • FTP using GUI_UPLOAD file.Its showing error like 'FILE NOT AVAIABLE''.

    Hi Friends,
    I am calling a file by FTP using GUI_UPLOAD file.
    Its showing error like 'FILE NOT AVAIABLE''
    Below is my sample code.
    I_FILE = 'FTP://10.121.6.61/IPSM/FILE1.TXT'.
    CALL FUNCTION 'GUI_UPLOAD'
      EXPORTING
        FILENAME                      = I_FILE
        FILETYPE                      = 'ASC'
      TABLES
        DATA_TAB                      = IT_TABLE.
    Pls suggest.

    Hi ,
    CALL FUNCTION 'GUI_UPLOAD'
      EXPORTING
        FILENAME                      = '
    172.19.125.2\flat\G1\meeting.txt'
      FILETYPE                      = 'ASC'
       HAS_FIELD_SEPARATOR           = '#'
    TABLES
        DATA_TAB                      = itab
    Try this .
    With Regards ,
    M.Sreeram .
    Edited by: sreeram manoharan on Feb 11, 2010 12:47 PM

  • Getting error while uploading data  using the EXCEL( GUI_upload)

    Dear Freinds,
    I am uploading data from my excel sheet to my Custom table . I am using the below code
    call function 'GUI_UPLOAD'
    exporting
    filename = l_fn
    filetype = 'BIN' "'ASC'
    has_field_separator = 'X'
    tables
    data_tab = p_i_ins_db
    exceptions
    others = 17.
    i can see in my internal P_i_ins_db ...all the data is coming in encrypted format.
    The flat given to me is the .CSV file .
    Could any one please let me know how i can upload the data which is there in .csv file.
    regards
    syamala

    Hi Syamala,
    Before using the GUI_UPLOAD to upload the data from the excel file to the internal table,you can try usng the Function Module 'SAP_CONVERT_TO_TEX_FORMAT' or 'SAP_CONVERT_TO_CSV_FORMAT' as it helps n formatting the data.
    In case you have any further clarifications,do let me know.
    Regards,
    Puneet Jhari.

Maybe you are looking for