<?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: Fill Internal table from excel sheet dynamically in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/fill-internal-table-from-excel-sheet-dynamically/m-p/6741458#M1458670</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Shaik,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Refer to the below link:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://divulgesap.com/blog.php?p=MjE=" target="test_blank"&gt;http://divulgesap.com/blog.php?p=MjE=&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This article has a sample report/code which exactly matches your requirement. You can specify the number of columns in your excel sheet in the selection screen, upload the file and get the data into an internal table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Let me know if you have any issues.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best Regards,&lt;/P&gt;&lt;P&gt;Ravikiran&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 10 Mar 2010 18:08:30 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2010-03-10T18:08:30Z</dc:date>
    <item>
      <title>Fill Internal table from excel sheet dynamically</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/fill-internal-table-from-excel-sheet-dynamically/m-p/6741454#M1458666</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 will get excel file with different number of colums i.e it may contain 2 colums or 3 or......100 colums.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;now I have to fill  the excel sheet data to internal table regradless of the number of coloums available in the excel sheet.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advnce......&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ShaiK Shadulla.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Mar 2010 13:49:56 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/fill-internal-table-from-excel-sheet-dynamically/m-p/6741454#M1458666</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-03-10T13:49:56Z</dc:date>
    </item>
    <item>
      <title>Re: Fill Internal table from excel sheet dynamically</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/fill-internal-table-from-excel-sheet-dynamically/m-p/6741455#M1458667</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Are you getting an excel sheet or a csv file?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Mar 2010 13:57:53 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/fill-internal-table-from-excel-sheet-dynamically/m-p/6741455#M1458667</guid>
      <dc:creator>rainer_hbenthal</dc:creator>
      <dc:date>2010-03-10T13:57:53Z</dc:date>
    </item>
    <item>
      <title>Re: Fill Internal table from excel sheet dynamically</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/fill-internal-table-from-excel-sheet-dynamically/m-p/6741456#M1458668</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN __default_attr="blue" __jive_macro_name="color"&gt; 
Hi,
&amp;lt;li&amp;gt;Try this way.
&lt;PRE&gt;&lt;CODE&gt;
REPORT ztest_notepad.
DATA: BEGIN OF it_data OCCURS 0,
       bukrs TYPE t001-bukrs,
       butxt TYPE t001-butxt,
       ort01 TYPE t001-ort01,
     END OF it_data.
TYPE-POOLS:truxs.
DATA:it_tab_raw_data TYPE  truxs_t_text_data.
"Call TEXT_CONVERT_XLS_TO_SAP fm
CALL FUNCTION 'TEXT_CONVERT_XLS_TO_SAP'
 EXPORTING
   i_tab_raw_data       = it_tab_raw_data
   i_filename           = 'C:\test.xls'
 TABLES
   i_tab_converted_data = it_data
 EXCEPTIONS
   conversion_failed    = 1
   OTHERS               = 2.
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.
ELSE.
 "Loop the data table  
 LOOP AT it_data.
   WRITE:/ it_data-bukrs,it_data-butxt, it_data-ort01.
 ENDLOOP.
ENDIF.&lt;/CODE&gt;&lt;/PRE&gt;

Thanks
Venkat.O&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Mar 2010 14:06:35 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/fill-internal-table-from-excel-sheet-dynamically/m-p/6741456#M1458668</guid>
      <dc:creator>venkat_o</dc:creator>
      <dc:date>2010-03-10T14:06:35Z</dc:date>
    </item>
    <item>
      <title>Re: Fill Internal table from excel sheet dynamically</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/fill-internal-table-from-excel-sheet-dynamically/m-p/6741457#M1458669</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;This can be acheveid by creating a final IT with line type string where you can place all the columns separated by comma in to internal tabel. Doesnt matter how many columns in excel.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i have given the code for the same.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA : IT_FILE  LIKE ALSMEX_TABLINE OCCURS 0 WITH HEADER LINE.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;DATA FILE_PATH LIKE  RLGRAP-FILENAME.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;TYPES : BEGIN OF  SBU_UPLOAD ,&lt;/P&gt;&lt;P&gt;  BU TYPE c,&lt;/P&gt;&lt;P&gt;  BU_DESC TYPE c,&lt;/P&gt;&lt;P&gt;  DELETE TYPE C,  &lt;/P&gt;&lt;P&gt;END OF SBU_UPLOAD .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;***Declare a variable with sring.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: begin of it,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;a type string.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;end of it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA TBU_UPLOAD  TYPE STANDARD TABLE OF SBU_UPLOAD  WITH HEADER LINE.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;CALL FUNCTION 'F4_FILENAME'&lt;/P&gt;&lt;P&gt;    EXPORTING&lt;/P&gt;&lt;P&gt;      field_name = 'FILE_LOC' "Here file_LOC is the text Element name on Screen.&lt;/P&gt;&lt;P&gt;    IMPORTING&lt;/P&gt;&lt;P&gt;      file_name  = FILE_PATH. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;"In FILE_PATH you get the excel file path , ehich you want to upload in Internal table ex: E:\Prem\Premral_details.xls' and we pass this file name to the following function Module which Return back the Internal table of its own Format ."&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                = FILE_PATH&lt;/P&gt;&lt;P&gt;      I_BEGIN_COL             = '1'&lt;/P&gt;&lt;P&gt;      I_BEGIN_ROW             = '3'&lt;/P&gt;&lt;P&gt;      I_END_COL               = '3'&lt;/P&gt;&lt;P&gt;      I_END_ROW               = '256'&lt;/P&gt;&lt;P&gt;    TABLES&lt;/P&gt;&lt;P&gt;      INTERN                  = IT_FILE&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 NE SPACE.&lt;/P&gt;&lt;P&gt;*leave PROGRAM.&lt;/P&gt;&lt;P&gt;  ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;" Now I use the following Logic to convert that IT_FILE table  into our own table format."&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  LOOP AT IT_FILE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;at new  IT_FILE-row.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;string avriable will be cleared whenever new row comes&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  &lt;/P&gt;&lt;P&gt;CLEAR it-a.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;endat.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;here all the columns will be placed in the IT separted by comma&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;concatenate  IT_FILE-value it-a into it-a seprated by ','.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    AT END OF ROW.&lt;/P&gt;&lt;P&gt; "At end of row it is updated with the desired value i.e&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When Row Column in table one converted  from 1 to 2 , the first column in Table 2 is inserted. Which is the required format of us . "&lt;/P&gt;&lt;P&gt;     &lt;/P&gt;&lt;P&gt; APPEND it.&lt;/P&gt;&lt;P&gt;      &lt;/P&gt;&lt;P&gt;    ENDAT.&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;shanmugavel Chandrasekaran.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Mar 2010 14:10:55 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/fill-internal-table-from-excel-sheet-dynamically/m-p/6741457#M1458669</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-03-10T14:10:55Z</dc:date>
    </item>
    <item>
      <title>Re: Fill Internal table from excel sheet dynamically</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/fill-internal-table-from-excel-sheet-dynamically/m-p/6741458#M1458670</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Shaik,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Refer to the below link:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://divulgesap.com/blog.php?p=MjE=" target="test_blank"&gt;http://divulgesap.com/blog.php?p=MjE=&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This article has a sample report/code which exactly matches your requirement. You can specify the number of columns in your excel sheet in the selection screen, upload the file and get the data into an internal table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Let me know if you have any issues.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best Regards,&lt;/P&gt;&lt;P&gt;Ravikiran&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Mar 2010 18:08:30 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/fill-internal-table-from-excel-sheet-dynamically/m-p/6741458#M1458670</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-03-10T18:08:30Z</dc:date>
    </item>
  </channel>
</rss>

