<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: &amp;quot;Cannot interpret data in file&amp;quot; error while using GUI_UPLOAD for .xls file in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/quot-cannot-interpret-data-in-file-quot-error-while-using-gui-upload-for/m-p/8007927#M1607428</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi amber22 you need to use the below fm to upload an xls file&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
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
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 21 Jul 2011 07:29:26 GMT</pubDate>
    <dc:creator>koolspy_ultimate</dc:creator>
    <dc:date>2011-07-21T07:29:26Z</dc:date>
    <item>
      <title>"Cannot interpret data in file" error while using GUI_UPLOAD for .xls file</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/quot-cannot-interpret-data-in-file-quot-error-while-using-gui-upload-for/m-p/8007924#M1607425</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;     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.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is my code. I had tried using different combination for HAS_FIELD_SEPARATOR but still its not working.&lt;/P&gt;&lt;P&gt;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.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;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 &amp;lt;&amp;gt; 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.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 Jul 2011 14:59:22 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/quot-cannot-interpret-data-in-file-quot-error-while-using-gui-upload-for/m-p/8007924#M1607425</guid>
      <dc:creator>abaper_guy</dc:creator>
      <dc:date>2011-07-20T14:59:22Z</dc:date>
    </item>
    <item>
      <title>Re: "Cannot interpret data in file" error while using GUI_UPLOAD for .xls file</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/quot-cannot-interpret-data-in-file-quot-error-while-using-gui-upload-for/m-p/8007925#M1607426</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Use FM ALSM_EXCEL_TO_INTERNAL_TABLE instead. There are plenty of threads on the forum describing how to use it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rob&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 Jul 2011 15:40:55 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/quot-cannot-interpret-data-in-file-quot-error-while-using-gui-upload-for/m-p/8007925#M1607426</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-07-20T15:40:55Z</dc:date>
    </item>
    <item>
      <title>Re: "Cannot interpret data in file" error while using GUI_UPLOAD for .xls file</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/quot-cannot-interpret-data-in-file-quot-error-while-using-gui-upload-for/m-p/8007926#M1607427</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FM GUI_UPLOAD only suitable for text file, not an excel file.&lt;/P&gt;&lt;P&gt;Try to use FM &lt;STRONG&gt;TEXT_CONVERT_XLS_TO_SAP&lt;/STRONG&gt;, this function is very simple, even we don't need to define starting row/column and ending row/column, all rows containing data will be transferred to internal table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this can help you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Ramses Hutahaean&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 Jul 2011 16:25:13 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/quot-cannot-interpret-data-in-file-quot-error-while-using-gui-upload-for/m-p/8007926#M1607427</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-07-20T16:25:13Z</dc:date>
    </item>
    <item>
      <title>Re: "Cannot interpret data in file" error while using GUI_UPLOAD for .xls file</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/quot-cannot-interpret-data-in-file-quot-error-while-using-gui-upload-for/m-p/8007927#M1607428</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi amber22 you need to use the below fm to upload an xls file&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
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
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 Jul 2011 07:29:26 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/quot-cannot-interpret-data-in-file-quot-error-while-using-gui-upload-for/m-p/8007927#M1607428</guid>
      <dc:creator>koolspy_ultimate</dc:creator>
      <dc:date>2011-07-21T07:29:26Z</dc:date>
    </item>
    <item>
      <title>Re: "Cannot interpret data in file" error while using GUI_UPLOAD for .xls file</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/quot-cannot-interpret-data-in-file-quot-error-while-using-gui-upload-for/m-p/8007928#M1607429</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;HI Amber,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;+ Although the first column in my internal table is NUMC.+ .This is not an issue. &lt;/P&gt;&lt;P&gt;use f4_filename and then use ALSM_EXCEL_TO_INTERNAL_TABLE. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Madhu.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 Jul 2011 07:44:53 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/quot-cannot-interpret-data-in-file-quot-error-while-using-gui-upload-for/m-p/8007928#M1607429</guid>
      <dc:creator>madhu_vadlamani</dc:creator>
      <dc:date>2011-07-21T07:44:53Z</dc:date>
    </item>
  </channel>
</rss>

