<?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: internal table in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table/m-p/1774747#M334257</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Use this function module..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;GUI_DOWNLOAD.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CALL FUNCTION 'GUI_DOWNLOAD'&lt;/P&gt;&lt;P&gt;EXPORTING&lt;/P&gt;&lt;P&gt;FILENAME = 'C:\TEST.XLS'&lt;/P&gt;&lt;P&gt;TABLES&lt;/P&gt;&lt;P&gt;DATA_TAB = IT.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 10 Dec 2006 09:58:57 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2006-12-10T09:58:57Z</dc:date>
    <item>
      <title>internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table/m-p/1774745#M334255</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi experts,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i wan to fetch records from a big internal table into another internal table where the number of records to be fetched is entered by the user in the selectioon screen.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;after fetching the records into internal table i want to download this table to excel sheet.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Could any one help me in this case. as soon as possible.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 10 Dec 2006 09:48:51 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table/m-p/1774745#M334255</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-12-10T09:48:51Z</dc:date>
    </item>
    <item>
      <title>Re: internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table/m-p/1774746#M334256</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Ali&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can try this logic,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
DATA: V_COUNT TYPE I VALUE 1.

DO.

* Read Table 1
READ TABLE &amp;lt;I_TAB1&amp;gt; INTO &amp;lt;W_TAB1&amp;gt; INDEX V_COUNT.
* Append to Second Table
APPEND &amp;lt;W_TAB1&amp;gt; TO &amp;lt;I_TAB2&amp;gt;.

V_COUNT = V_COUNT + 1.
* limit is reached is then exit
IF V_COUNT &amp;gt; &amp;lt;No of Records&amp;gt;.
EXIT.
ENDIF.

ENDDO.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;You can find the code sample for downloading ot excel here&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;A class="jive_macro jive_macro_thread" href="https://community.sap.com/" __jive_macro_name="thread" modifiedtitle="true" __default_attr="64725"&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Kathirvel&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 10 Dec 2006 09:58:31 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table/m-p/1774746#M334256</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-12-10T09:58:31Z</dc:date>
    </item>
    <item>
      <title>Re: internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table/m-p/1774747#M334257</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Use this function module..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;GUI_DOWNLOAD.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CALL FUNCTION 'GUI_DOWNLOAD'&lt;/P&gt;&lt;P&gt;EXPORTING&lt;/P&gt;&lt;P&gt;FILENAME = 'C:\TEST.XLS'&lt;/P&gt;&lt;P&gt;TABLES&lt;/P&gt;&lt;P&gt;DATA_TAB = IT.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 10 Dec 2006 09:58:57 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table/m-p/1774747#M334257</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-12-10T09:58:57Z</dc:date>
    </item>
    <item>
      <title>Re: internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table/m-p/1774748#M334258</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi Kathirvel Balakrishnan ,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i really appreciate your fast reply. &lt;/P&gt;&lt;P&gt;after i get the second internal table how i could download it into more than one excel sheets.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;with consideration of maximum limite of record could excel sheet could have.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;best regared&lt;/P&gt;&lt;P&gt;Ali&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 10 Dec 2006 10:15:52 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table/m-p/1774748#M334258</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-12-10T10:15:52Z</dc:date>
    </item>
    <item>
      <title>Re: internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table/m-p/1774749#M334259</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;first of all &lt;/P&gt;&lt;P&gt;declare the internal table (jtab)  u want to fill from the internal table(big = itab )  with the fileds u want to append .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;second to append the records u need to append like this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;loop at itab.
jtab-f1 = itab-f1.
jtab-f2 = itab-f2.
jtab-f3 = itab-f3.
jtab-f4 = itab-f4.

append jtab.
clear jtab.

endloop&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;this way u will fetch all the records into ur jtab with the desired fields.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;third .to  download this into an excel sheet .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;use this fm .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;DATA : v_length TYPE p.
p_pcfile will he the location to where u will drop the excel sheet .

declare this as 

parameters :  p_pcfile LIKE rlgrap-filename DEFAULT text-001 .

in the text  give the pathname this will do.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;CALL FUNCTION 'WS_DOWNLOAD'
       EXPORTING
            filename   = p_pcfile          " ur path file .
            filetype   = 'DAT'                "this is for excel 
       IMPORTING
            filelength = v_length
       TABLES
            data_tab   = jtab.             " this is ur contents
*              fieldnames = it_fieldnames.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;also u can use GUI_DOWNLOAD with the same effect.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;vijay&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 10 Dec 2006 10:15:59 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table/m-p/1774749#M334259</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-12-10T10:15:59Z</dc:date>
    </item>
    <item>
      <title>Re: internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table/m-p/1774750#M334260</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Ali&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Excel has a limitation around 64 thousand records/rows.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Besides if you are planning to create multiple worksheets then you should opt for Excel ole. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The codes for the same are here,&lt;/P&gt;&lt;P&gt;&lt;A class="jive_macro jive_macro_message" href="https://community.sap.com/" __jive_macro_name="message" modifiedtitle="true" __default_attr="1950836"&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.sapdevelopment.co.uk/ms/ms_excel.htm" target="test_blank"&gt;http://www.sapdevelopment.co.uk/ms/ms_excel.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The logic is that after creating an Excel OLE object,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Loop into the internal table and start moving the contents to the sheet1 until 64K entries are reached as shown below&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
* Create first Excel Sheet
  CALL METHOD OF application 'Worksheets' = sheet
                               EXPORTING #1 = 1.
  CALL METHOD OF sheet 'Activate'.
  SET PROPERTY OF sheet 'Name' = 'Sheet1'.
  LOOP AT itab1.
    index = row_max * ( sy-tabix - 1 ) + 1. " 1 - column name
    CALL METHOD OF sheet 'Cells' = cells EXPORTING #1 = index.
    SET PROPERTY OF cells 'Value' = itab1-first_name.
  ENDLOOP.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Once it reaches the limit then you can add another sheet similarly as shown above and continues the same.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You just need to put a logic inside loop for creating the work sheets as you reach the 64K entries.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this solves your problem.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Kathirvel&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 10 Dec 2006 10:32:19 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table/m-p/1774750#M334260</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-12-10T10:32:19Z</dc:date>
    </item>
    <item>
      <title>Re: internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table/m-p/1774751#M334261</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;sorry Kathirvel Balakrishnan  &lt;/P&gt;&lt;P&gt;.&lt;/P&gt;&lt;P&gt;i could not understand. &lt;/P&gt;&lt;P&gt;Could you simplify the code in such a way ?&lt;/P&gt;&lt;P&gt;Until now i download the internal table with entered No. of record.&lt;/P&gt;&lt;P&gt;But i have to use multiple sheet because the data so huge .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;best regareds.&lt;/P&gt;&lt;P&gt;Ali&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 10 Dec 2006 13:03:16 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table/m-p/1774751#M334261</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-12-10T13:03:16Z</dc:date>
    </item>
  </channel>
</rss>

