<?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: Excel file upload in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/excel-file-upload/m-p/1726940#M316800</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi&lt;/P&gt;&lt;P&gt;good&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;yes i think you can do this, check this example&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;call function 'ALSM_EXCEL_TO_INTERNAL_TABLE' &lt;/P&gt;&lt;P&gt;  exporting &lt;/P&gt;&lt;P&gt;    filename                      = FILENM &lt;/P&gt;&lt;P&gt;    i_begin_col                   = 1 &lt;/P&gt;&lt;P&gt;    i_begin_row                   = 1 &lt;/P&gt;&lt;P&gt;    i_end_col                     = 100 &lt;/P&gt;&lt;P&gt;    i_end_row                     = 30000 &lt;/P&gt;&lt;P&gt;  tables &lt;/P&gt;&lt;P&gt;    intern                        = IEXCEL &lt;/P&gt;&lt;P&gt;  EXCEPTIONS &lt;/P&gt;&lt;P&gt;    INCONSISTENT_PARAMETERS       = 1 &lt;/P&gt;&lt;P&gt;    UPLOAD_OLE                    = 2 &lt;/P&gt;&lt;P&gt;    OTHERS                        = 3. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if sy-subrc &amp;lt;&amp;gt; 0. &lt;/P&gt;&lt;P&gt;   WRITE: / 'EXCEL UPLOAD FAILED ', FILENM, SY-SUBRC. &lt;/P&gt;&lt;P&gt;ELSE. &lt;/P&gt;&lt;P&gt;  SORT IEXCEL BY row col. &lt;/P&gt;&lt;P&gt;  LOOP AT IEXCEL. &lt;/P&gt;&lt;P&gt;    IF NOHEADER = 'X' &lt;/P&gt;&lt;P&gt;    AND IEXCEL-row = 1. &lt;/P&gt;&lt;P&gt;      CONTINUE. &lt;/P&gt;&lt;P&gt;    ENDIF. &lt;/P&gt;&lt;P&gt;    tind = IEXCEL-col. &lt;/P&gt;&lt;P&gt;    CONCATENATE 'DATA_TAB-VALUE_' tind INTO zwfeld. &lt;/P&gt;&lt;P&gt;    ASSIGN (zwfeld) TO &amp;lt;fs1&amp;gt;. &lt;/P&gt;&lt;P&gt;    &amp;lt;fs1&amp;gt; = IEXCEL-value. &lt;/P&gt;&lt;P&gt;    AT END OF row. &lt;/P&gt;&lt;P&gt;      APPEND data_tab. &lt;/P&gt;&lt;P&gt;      WRITE:/ 'data_tab ', data_tab-value_0001, data_tab-value_0002, &lt;/P&gt;&lt;P&gt;                           data_tab-value_0003, data_tab-value_0004. &lt;/P&gt;&lt;P&gt;      CLEAR data_tab. &lt;/P&gt;&lt;P&gt;    ENDAT. &lt;/P&gt;&lt;P&gt;  ENDLOOP. &lt;/P&gt;&lt;P&gt;endif. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks&lt;/P&gt;&lt;P&gt;mrutyun^&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 03 Nov 2006 04:18:19 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2006-11-03T04:18:19Z</dc:date>
    <item>
      <title>Excel file upload</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/excel-file-upload/m-p/1726936#M316796</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;I am using the following FM to upload an EXCEL file.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'&lt;/P&gt;&lt;P&gt;  EXPORTING&lt;/P&gt;&lt;P&gt;    FILENAME                      = p_file&lt;/P&gt;&lt;P&gt;    I_BEGIN_COL                   = 1&lt;/P&gt;&lt;P&gt;    I_BEGIN_ROW                   = 1&lt;/P&gt;&lt;P&gt;    I_END_COL                     = 3&lt;/P&gt;&lt;P&gt;    I_END_ROW                     = 4&lt;/P&gt;&lt;P&gt;  TABLES&lt;/P&gt;&lt;P&gt;    INTERN                        = t_datain2&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;EXCEPTIONS&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  INCONSISTENT_PARAMETERS       = 1&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  UPLOAD_OLE                    = 2&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  OTHERS                        = 3&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;it works fine but, i have one more requirement, the number of lines in the excel sheet is going to decided according to the file that the user is going to upload. therefore i cannot hardcode the value i_end_row an i_col for the function module. i there any workaround for this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Narendiran Rathinavelu.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 03 Nov 2006 04:00:36 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/excel-file-upload/m-p/1726936#M316796</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-11-03T04:00:36Z</dc:date>
    </item>
    <item>
      <title>Re: Excel file upload</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/excel-file-upload/m-p/1726937#M316797</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Narendiran,&lt;/P&gt;&lt;P&gt; U can fix the no. of rows / no. of columns to maximum value, so that it will work for any excel sheet. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- Satya Priya&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 03 Nov 2006 04:10:46 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/excel-file-upload/m-p/1726937#M316797</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-11-03T04:10:46Z</dc:date>
    </item>
    <item>
      <title>Re: Excel file upload</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/excel-file-upload/m-p/1726938#M316798</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Use this.&lt;/P&gt;&lt;P&gt;  CALL FUNCTION 'GUI_UPLOAD'&lt;/P&gt;&lt;P&gt;    EXPORTING&lt;/P&gt;&lt;P&gt;      filename                      = p_file&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  FILETYPE                      = 'ASC'&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;     has_field_separator            = '#'&lt;/P&gt;&lt;P&gt;    TABLES&lt;/P&gt;&lt;P&gt;      data_tab                      = t_datain2[].&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 03 Nov 2006 04:12:00 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/excel-file-upload/m-p/1726938#M316798</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-11-03T04:12:00Z</dc:date>
    </item>
    <item>
      <title>Re: Excel file upload</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/excel-file-upload/m-p/1726939#M316799</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi&lt;/P&gt;&lt;P&gt;is there anyway of dynamically determining this file length at runtime.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Narendiran Rathinavelu&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 03 Nov 2006 04:18:13 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/excel-file-upload/m-p/1726939#M316799</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-11-03T04:18:13Z</dc:date>
    </item>
    <item>
      <title>Re: Excel file upload</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/excel-file-upload/m-p/1726940#M316800</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi&lt;/P&gt;&lt;P&gt;good&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;yes i think you can do this, check this example&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;call function 'ALSM_EXCEL_TO_INTERNAL_TABLE' &lt;/P&gt;&lt;P&gt;  exporting &lt;/P&gt;&lt;P&gt;    filename                      = FILENM &lt;/P&gt;&lt;P&gt;    i_begin_col                   = 1 &lt;/P&gt;&lt;P&gt;    i_begin_row                   = 1 &lt;/P&gt;&lt;P&gt;    i_end_col                     = 100 &lt;/P&gt;&lt;P&gt;    i_end_row                     = 30000 &lt;/P&gt;&lt;P&gt;  tables &lt;/P&gt;&lt;P&gt;    intern                        = IEXCEL &lt;/P&gt;&lt;P&gt;  EXCEPTIONS &lt;/P&gt;&lt;P&gt;    INCONSISTENT_PARAMETERS       = 1 &lt;/P&gt;&lt;P&gt;    UPLOAD_OLE                    = 2 &lt;/P&gt;&lt;P&gt;    OTHERS                        = 3. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if sy-subrc &amp;lt;&amp;gt; 0. &lt;/P&gt;&lt;P&gt;   WRITE: / 'EXCEL UPLOAD FAILED ', FILENM, SY-SUBRC. &lt;/P&gt;&lt;P&gt;ELSE. &lt;/P&gt;&lt;P&gt;  SORT IEXCEL BY row col. &lt;/P&gt;&lt;P&gt;  LOOP AT IEXCEL. &lt;/P&gt;&lt;P&gt;    IF NOHEADER = 'X' &lt;/P&gt;&lt;P&gt;    AND IEXCEL-row = 1. &lt;/P&gt;&lt;P&gt;      CONTINUE. &lt;/P&gt;&lt;P&gt;    ENDIF. &lt;/P&gt;&lt;P&gt;    tind = IEXCEL-col. &lt;/P&gt;&lt;P&gt;    CONCATENATE 'DATA_TAB-VALUE_' tind INTO zwfeld. &lt;/P&gt;&lt;P&gt;    ASSIGN (zwfeld) TO &amp;lt;fs1&amp;gt;. &lt;/P&gt;&lt;P&gt;    &amp;lt;fs1&amp;gt; = IEXCEL-value. &lt;/P&gt;&lt;P&gt;    AT END OF row. &lt;/P&gt;&lt;P&gt;      APPEND data_tab. &lt;/P&gt;&lt;P&gt;      WRITE:/ 'data_tab ', data_tab-value_0001, data_tab-value_0002, &lt;/P&gt;&lt;P&gt;                           data_tab-value_0003, data_tab-value_0004. &lt;/P&gt;&lt;P&gt;      CLEAR data_tab. &lt;/P&gt;&lt;P&gt;    ENDAT. &lt;/P&gt;&lt;P&gt;  ENDLOOP. &lt;/P&gt;&lt;P&gt;endif. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks&lt;/P&gt;&lt;P&gt;mrutyun^&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 03 Nov 2006 04:18:19 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/excel-file-upload/m-p/1726940#M316800</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-11-03T04:18:19Z</dc:date>
    </item>
    <item>
      <title>Re: Excel file upload</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/excel-file-upload/m-p/1726941#M316801</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;i mean the number of rows or columns&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Narendiran Rathinvelu&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 03 Nov 2006 04:19:18 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/excel-file-upload/m-p/1726941#M316801</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-11-03T04:19:18Z</dc:date>
    </item>
    <item>
      <title>Re: Excel file upload</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/excel-file-upload/m-p/1726942#M316802</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;thanks for the response, is there anyway of obtaining the number of lines and number of rows dynamicaly in this case.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Narendiran Rathinavelu&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 03 Nov 2006 04:21:19 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/excel-file-upload/m-p/1726942#M316802</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-11-03T04:21:19Z</dc:date>
    </item>
    <item>
      <title>Re: Excel file upload</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/excel-file-upload/m-p/1726943#M316803</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Narendiran,&lt;/P&gt;&lt;P&gt; After uploading the excel sheet with i_end_col and i_end_row set to max values, u can get the no.of rows and no. of columns from the table t_datain2. Like&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;declare one more table  t_datain1 type t_datain2.&lt;/P&gt;&lt;P&gt;t_datain1[] =  t_datain2[]&lt;/P&gt;&lt;P&gt;sort t_datain1 by row descending.&lt;/P&gt;&lt;P&gt;read table t_datain1 index 1. *Gets the no. of rows in XL&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;t_datain1[] =  t_datain2[]&lt;/P&gt;&lt;P&gt;sort t_datain1 by col descending.&lt;/P&gt;&lt;P&gt;read table t_datain1 index 1. &lt;/P&gt;&lt;P&gt;                     *Gets the no. of columns in XL&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-Satya Priya Vepakomma&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 03 Nov 2006 05:28:19 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/excel-file-upload/m-p/1726943#M316803</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-11-03T05:28:19Z</dc:date>
    </item>
  </channel>
</rss>

