<?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: uploading data from excel in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/uploading-data-from-excel/m-p/444166#M13235</link>
    <description>&lt;P&gt;Instead of using &lt;STRONG&gt;TEXT_CONVERT_XLS_TO_SAP&lt;/STRONG&gt;, you can use &lt;STRONG&gt;ALSM_EXCEL_TO_INTERNAL_TABLE&lt;/STRONG&gt; as it is easy to manipulate your records according to your needs and using &lt;B&gt;TEXT_CONVERT_XLS_TO_SAP &lt;/B&gt;will give dump because of mismatch datatype.&lt;/P&gt;&lt;P&gt;Refer to the following programs:&lt;BR /&gt;&lt;STRONG&gt;ZTCOLG &lt;/STRONG&gt;is the DDIC table which has this columns:&lt;EM&gt; &lt;/EM&gt;&lt;EM&gt;Mandt, Rollno, Name, Course, DOJ&lt;BR /&gt;&lt;/EM&gt;&amp;amp; &lt;STRONG&gt;Colg.xlsx&lt;/STRONG&gt; is the excel file which has the column in this order:&lt;EM&gt; &lt;/EM&gt;&lt;EM&gt;Name, Course, DOJ, Rollno&lt;/EM&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;DATA: lt_tab TYPE TABLE OF ztcolg,
      ls_tab TYPE ztcolg,
      lt_excel TYPE TABLE OF alsmex_tabline,
      ls_excel TYPE alsmex_tabline
      .

CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'
  EXPORTING
    filename                = 'C:\Users\roy\Desktop\Colg.xlsx'
    i_begin_col             = '1'
    i_begin_row             = '1'
    i_end_col               = '4'
    i_end_row               = '50'
  TABLES
    intern                  = lt_excel
  EXCEPTIONS
    inconsistent_parameters = 1
    upload_ole              = 2
    OTHERS                  = 3.
IF sy-subrc &amp;lt;&amp;gt; 0.
  MESSAGE 'Error in uploading Excel' TYPE 'E'.
ELSE.
  LOOP AT lt_excel INTO ls_excel.
    CASE ls_excel-col.
      WHEN '0001'.      "NAME COL IN XLS
        MOVE ls_excel-value TO ls_tab-name.
      WHEN '0002'.      "COURSE COL IN XLS
        MOVE ls_excel-value TO ls_tab-course.
      WHEN '0003'.      "DOJ COL IN XLS
        MOVE ls_excel-value TO ls_tab-doj.
      WHEN '0004'.      "ROLL COL IN XLS
        MOVE ls_excel-value TO ls_tab-rollno.
        APPEND ls_tab TO lt_tab.
        CLEAR: ls_excel.
      WHEN OTHERS.
    ENDCASE.
  ENDLOOP.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Now, &lt;STRONG&gt;LT_TAB&lt;/STRONG&gt; contains the data according to the DDIC columns. Now you can insert this data directly into your table.&lt;/P&gt;</description>
    <pubDate>Wed, 08 Mar 2017 08:15:47 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2017-03-08T08:15:47Z</dc:date>
    <item>
      <title>uploading data from excel</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/uploading-data-from-excel/m-p/444165#M13234</link>
      <description>&lt;P&gt;My requirement is to upload a data from excel to SAP abap DDIC table. So I have &lt;/P&gt;&lt;P&gt;TEXT_CONVERT_XLS_TO_SAP FM to upload the data from my excel. But I had a problem that my DDIC table has column in one order but my excel has column in different order. How to I upload data by matching with its column name.&lt;/P&gt;&lt;P&gt;Example: &lt;/P&gt;&lt;P&gt;My DDIC table has following column&lt;/P&gt;&lt;P&gt;Mandt  Rollno   Name  Course  DOJ &lt;/P&gt;&lt;P&gt;My Excel has following column&lt;/P&gt;&lt;P&gt;Name Course DOJ Rollno &lt;/P&gt;&lt;P&gt;how I can upload the data in the excel file to DDIC table correctly using column name&lt;/P&gt;</description>
      <pubDate>Wed, 08 Mar 2017 06:31:33 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/uploading-data-from-excel/m-p/444165#M13234</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2017-03-08T06:31:33Z</dc:date>
    </item>
    <item>
      <title>Re: uploading data from excel</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/uploading-data-from-excel/m-p/444166#M13235</link>
      <description>&lt;P&gt;Instead of using &lt;STRONG&gt;TEXT_CONVERT_XLS_TO_SAP&lt;/STRONG&gt;, you can use &lt;STRONG&gt;ALSM_EXCEL_TO_INTERNAL_TABLE&lt;/STRONG&gt; as it is easy to manipulate your records according to your needs and using &lt;B&gt;TEXT_CONVERT_XLS_TO_SAP &lt;/B&gt;will give dump because of mismatch datatype.&lt;/P&gt;&lt;P&gt;Refer to the following programs:&lt;BR /&gt;&lt;STRONG&gt;ZTCOLG &lt;/STRONG&gt;is the DDIC table which has this columns:&lt;EM&gt; &lt;/EM&gt;&lt;EM&gt;Mandt, Rollno, Name, Course, DOJ&lt;BR /&gt;&lt;/EM&gt;&amp;amp; &lt;STRONG&gt;Colg.xlsx&lt;/STRONG&gt; is the excel file which has the column in this order:&lt;EM&gt; &lt;/EM&gt;&lt;EM&gt;Name, Course, DOJ, Rollno&lt;/EM&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;DATA: lt_tab TYPE TABLE OF ztcolg,
      ls_tab TYPE ztcolg,
      lt_excel TYPE TABLE OF alsmex_tabline,
      ls_excel TYPE alsmex_tabline
      .

CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'
  EXPORTING
    filename                = 'C:\Users\roy\Desktop\Colg.xlsx'
    i_begin_col             = '1'
    i_begin_row             = '1'
    i_end_col               = '4'
    i_end_row               = '50'
  TABLES
    intern                  = lt_excel
  EXCEPTIONS
    inconsistent_parameters = 1
    upload_ole              = 2
    OTHERS                  = 3.
IF sy-subrc &amp;lt;&amp;gt; 0.
  MESSAGE 'Error in uploading Excel' TYPE 'E'.
ELSE.
  LOOP AT lt_excel INTO ls_excel.
    CASE ls_excel-col.
      WHEN '0001'.      "NAME COL IN XLS
        MOVE ls_excel-value TO ls_tab-name.
      WHEN '0002'.      "COURSE COL IN XLS
        MOVE ls_excel-value TO ls_tab-course.
      WHEN '0003'.      "DOJ COL IN XLS
        MOVE ls_excel-value TO ls_tab-doj.
      WHEN '0004'.      "ROLL COL IN XLS
        MOVE ls_excel-value TO ls_tab-rollno.
        APPEND ls_tab TO lt_tab.
        CLEAR: ls_excel.
      WHEN OTHERS.
    ENDCASE.
  ENDLOOP.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Now, &lt;STRONG&gt;LT_TAB&lt;/STRONG&gt; contains the data according to the DDIC columns. Now you can insert this data directly into your table.&lt;/P&gt;</description>
      <pubDate>Wed, 08 Mar 2017 08:15:47 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/uploading-data-from-excel/m-p/444166#M13235</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2017-03-08T08:15:47Z</dc:date>
    </item>
    <item>
      <title>Re: uploading data from excel</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/uploading-data-from-excel/m-p/444167#M13236</link>
      <description>&lt;P&gt;Thank you&lt;/P&gt;&lt;P&gt;Vigneshwaran&lt;/P&gt;</description>
      <pubDate>Wed, 08 Mar 2017 09:42:19 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/uploading-data-from-excel/m-p/444167#M13236</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2017-03-08T09:42:19Z</dc:date>
    </item>
  </channel>
</rss>

