<?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: package size in select query in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/package-size-in-select-query/m-p/2658308#M613110</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;300 seems small. I usually try for package sizes in th 5,000 to 10,000 range:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
  select * from adrc
         into table lt_adrc
         package size 5000
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rob&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 28 Aug 2007 13:04:54 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-08-28T13:04:54Z</dc:date>
    <item>
      <title>package size in select query</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/package-size-in-select-query/m-p/2658306#M613108</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can any body help for how to use package size in select statemtent.&lt;/P&gt;&lt;P&gt;I want to seletc record in lot of 300 form 10k records.&lt;/P&gt;&lt;P&gt;And i am using 4.6c version and wnat to know this statement (package size) is there in 4.6c.&lt;/P&gt;&lt;P&gt;I know it is in 6.0.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Aug 2007 06:25:56 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/package-size-in-select-query/m-p/2658306#M613108</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-08-28T06:25:56Z</dc:date>
    </item>
    <item>
      <title>Re: package size in select query</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/package-size-in-select-query/m-p/2658307#M613109</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;When you read several lines of a database table, you can place them in an internal table. To do this, use the following in the INTO clause:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT ... INTO|APPENDING [CORRESPONDING FIELDS OF] TABLE &amp;lt;itab&amp;gt;&lt;/P&gt;&lt;P&gt;                          [PACKAGE SIZE &amp;lt;n&amp;gt;] ...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The same applies to the line type of &amp;lt;itab&amp;gt;, the way in which the data for a line of the database table are assigned to a table line, and the CORRESPONDING FIELDS addition as for flat work areas (see above).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The internal table is filled with all of the lines of the selection. When you use INTO, all existing lines in the table are deleted. When you use APPENDING; the new lines are added to the existing internal table &amp;lt;itab&amp;gt;. With APPENDING, the system adds the lines to the internal table appropriately for the table type. Fields in the internal table not affected by the selection are filled with initial values. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you use the PACKAGE SIZE addition, the lines of the selection are not written into the internal table at once, but in packets. You can define packets of &amp;lt;n&amp;gt; lines that are written one after the other into the internal table. If you use INTO, each packet replaces the preceding one. If you use APPENDING, the packets are inserted one after the other. This is only possible in a loop that ends with ENDSELECT. Outside the SELECT loop, the contents of the internal table are undetermined. You must process the selected lines within the loop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;yes it is there in 4.6.....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;reward points if helpful...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Aug 2007 06:42:00 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/package-size-in-select-query/m-p/2658307#M613109</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-08-28T06:42:00Z</dc:date>
    </item>
    <item>
      <title>Re: package size in select query</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/package-size-in-select-query/m-p/2658308#M613110</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;300 seems small. I usually try for package sizes in th 5,000 to 10,000 range:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
  select * from adrc
         into table lt_adrc
         package size 5000
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rob&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Aug 2007 13:04:54 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/package-size-in-select-query/m-p/2658308#M613110</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-08-28T13:04:54Z</dc:date>
    </item>
    <item>
      <title>Re: package size in select query</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/package-size-in-select-query/m-p/2658309#M613111</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;Package size can be used if you for example only want to finish processing a limited amount of data at a time due to lack of memory. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The example below  read 50 records at a time from VBAK into an internal table, and selects the corresponding entries from vbap into an internal table. Then the two internal tables can be processed, and the next 50 records from VBAk can be read. Remember to reinitialize tha tables before the next read.  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;REPORT  z_test. 

TYPES: 
  BEGIN OF t_vbak, 
    vbeln LIKE vbak-vbeln, 
    erdat LIKE vbak-erdat, 
  END OF t_vbak, 

  BEGIN OF t_vbap, 
    posnr  LIKE vbap-posnr, 
    matnr  LIKE vbap-matnr, 
    meins  LIKE vbap-meins, 
  END OF t_vbap, 

  BEGIN OF t_report, 
    vbeln LIKE vbak-vbeln, 
    erdat LIKE vbak-erdat, 
    posnr  LIKE vbap-posnr, 
    matnr  LIKE vbap-matnr, 
    meins  LIKE vbap-meins, 
  END OF t_report. 

DATA: 
  li_vbak   TYPE t_vbak OCCURS 0, 
  l_vbak    TYPE  t_vbak, 
  li_vbap   TYPE t_vbap OCCURS 0, 
  l_vbap    TYPE t_vbap, 
  li_report TYPE t_report OCCURS 0, 
  l_report  TYPE t_report. 

START-OF-SELECTION. 
  SELECT vbeln erdat 
    FROM vbak 
    INTO TABLE li_vbak PACKAGE SIZE 50. 
    SELECT posnr matnr meins 
      FROM vbap 
      INTO TABLE li_vbap 
      FOR ALL ENTRIES IN li_vbak 
      WHERE vbeln = li_vbak-vbeln. 
    IF sy-subrc = 0. 
*   Now you have the two internal tables li_vbak and li_vbap filled 
*   with data. 
*   Do something with the data - remember to reinitialize internal 
*   tables 
    ENDIF. 
  ENDSELECT. 

*-- End of Program&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;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt; Sudheer&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Aug 2007 13:07:01 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/package-size-in-select-query/m-p/2658309#M613111</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-08-28T13:07:01Z</dc:date>
    </item>
    <item>
      <title>Re: package size in select query</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/package-size-in-select-query/m-p/2658310#M613112</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks a lot Rob,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But i want to select record in lot of 200.&lt;/P&gt;&lt;P&gt;Currently the code is taking 200 records but next 200 record are overwritten.&lt;/P&gt;&lt;P&gt;I want first time it reterive record 200 then second time another 200 and append it in same interbal table.&lt;/P&gt;&lt;P&gt;I think we have to use APPEND also within the select statement.&lt;/P&gt;&lt;P&gt;I if you about the plz let me know.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks &lt;/P&gt;&lt;P&gt;Amar&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 29 Aug 2007 04:32:07 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/package-size-in-select-query/m-p/2658310#M613112</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-08-29T04:32:07Z</dc:date>
    </item>
    <item>
      <title>Re: package size in select query</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/package-size-in-select-query/m-p/2658311#M613113</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;Yes definitely you use the &amp;lt;b&amp;gt;'appending table'&amp;lt;/b&amp;gt; statement , then internal table contains all records instead of overwriting the exitsting records.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can follow the below sample code is&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: BEGIN OF tbl_mara OCCURS 0,&lt;/P&gt;&lt;P&gt;      matnr LIKE mara-matnr,&lt;/P&gt;&lt;P&gt;      mbrsh LIKE mara-mbrsh,&lt;/P&gt;&lt;P&gt;      END OF tbl_mara.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT matnr mbrsh FROM mara&lt;/P&gt;&lt;P&gt; &amp;lt;b&amp;gt; APPENDING TABLE tbl_mara PACKAGE SIZE 10&amp;lt;/b&amp;gt;.&lt;/P&gt;&lt;P&gt;ENDSELECT.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DESCRIBE TABLE tbl_mara.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;WRITE &lt;span class="lia-unicode-emoji" title=":confused_face:"&gt;😕&lt;/span&gt; sy-tfill.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;reward with points if helpful.&amp;lt;/b&amp;gt;&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>Wed, 29 Aug 2007 07:35:23 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/package-size-in-select-query/m-p/2658311#M613113</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-08-29T07:35:23Z</dc:date>
    </item>
    <item>
      <title>Re: package size in select query</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/package-size-in-select-query/m-p/2658312#M613114</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;package size always selects data in select endselect and in each pass it overwrites the data into that table so in that case you have to move the data to another internal table in between the select endselect.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select * from dbtabinto itab1 package size 200.&lt;/P&gt;&lt;P&gt;appned lines of table itab1 to itab2.&lt;/P&gt;&lt;P&gt;endselect.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*here you have all the entries in itab 2&lt;/P&gt;&lt;P&gt;loop at itab2.&lt;/P&gt;&lt;P&gt;*statements&lt;/P&gt;&lt;P&gt;endloop.&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;vivekanand&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 29 Aug 2007 08:56:32 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/package-size-in-select-query/m-p/2658312#M613114</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-08-29T08:56:32Z</dc:date>
    </item>
    <item>
      <title>Re: package size in select query</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/package-size-in-select-query/m-p/2658313#M613115</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;Package size in SELECT statements&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Package size can be used to retreive a spcific number of records at a time. This can be used if you &lt;/P&gt;&lt;P&gt;for example only want tofinish  processing a limited amount of data at a time due to lack of memory.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The exampel below  read 50 records at a time from VBAK into an internal table, and selects the &lt;/P&gt;&lt;P&gt;corresponding entries from vbap into an internal table. Then the two internal tables can be &lt;/P&gt;&lt;P&gt;processed, and the next 50 records from VBAk can be read. remeber to reinitialize tha tables before &lt;/P&gt;&lt;P&gt;the next read.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Note the usage of SELECT - ENDSELECT !&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;REPORT  z_test                        .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TYPES:&lt;/P&gt;&lt;P&gt;BEGIN OF t_vbak,&lt;/P&gt;&lt;P&gt;vbeln LIKE vbak-vbeln,&lt;/P&gt;&lt;P&gt;erdat LIKE vbak-erdat,&lt;/P&gt;&lt;P&gt;END OF t_vbak,&lt;/P&gt;&lt;P&gt;BEGIN OF t_vbap,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;posnr  LIKE vbap-posnr,&lt;/P&gt;&lt;P&gt;matnr  LIKE vbap-matnr,&lt;/P&gt;&lt;P&gt;meins  LIKE vbap-meins,&lt;/P&gt;&lt;P&gt;END OF t_vbap,&lt;/P&gt;&lt;P&gt;BEGIN OF t_report,&lt;/P&gt;&lt;P&gt;vbeln LIKE vbak-vbeln,&lt;/P&gt;&lt;P&gt;erdat LIKE vbak-erdat,&lt;/P&gt;&lt;P&gt;posnr  LIKE vbap-posnr,&lt;/P&gt;&lt;P&gt;matnr  LIKE vbap-matnr,&lt;/P&gt;&lt;P&gt;meins  LIKE vbap-meins,&lt;/P&gt;&lt;P&gt;END OF t_report.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA:&lt;/P&gt;&lt;P&gt;li_vbak   TYPE t_vbak OCCURS 0,&lt;/P&gt;&lt;P&gt;l_vbak    TYPE  t_vbak,&lt;/P&gt;&lt;P&gt;li_vbap   TYPE t_vbap OCCURS 0,&lt;/P&gt;&lt;P&gt;l_vbap    TYPE t_vbap,&lt;/P&gt;&lt;P&gt;li_report TYPE t_report OCCURS 0,&lt;/P&gt;&lt;P&gt;l_report  TYPE t_report.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;START-OF-SELECTION.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT vbeln erdat&lt;/P&gt;&lt;P&gt;FROM vbak&lt;/P&gt;&lt;P&gt;INTO TABLE li_vbak PACKAGE SIZE 50.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT posnr matnr meins&lt;/P&gt;&lt;P&gt;FROM vbap&lt;/P&gt;&lt;P&gt;INTO TABLE li_vbap&lt;/P&gt;&lt;P&gt;FOR ALL ENTRIES IN li_vbak&lt;/P&gt;&lt;P&gt;WHERE vbeln = li_vbak-vbeln.&lt;/P&gt;&lt;P&gt;IF sy-subrc = 0.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  Now you have the two internal tables li_vbak and liÆ_vbap filled with data.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  Do something with the data - remember to reinitialize internal tables&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDSELECT.&lt;/P&gt;&lt;P&gt;All of the  product names here are trademarks of their respective companies.  The site &lt;/P&gt;&lt;P&gt;&lt;A href="https://community.sap.com/www.allsaplinks.com" target="test_blank"&gt;www.allsaplinks.com&lt;/A&gt; no way affiliated with SAP AG. We have made every effort for the content &lt;/P&gt;&lt;P&gt;integrity.  Information used on this site is at your own risk.&lt;/P&gt;&lt;P&gt;          +&lt;B&gt;&lt;/B&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt; REWARD IF USEFULL&lt;/P&gt;+&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 29 Aug 2007 10:19:37 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/package-size-in-select-query/m-p/2658313#M613115</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-08-29T10:19:37Z</dc:date>
    </item>
    <item>
      <title>Re: package size in select query</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/package-size-in-select-query/m-p/2658314#M613116</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The PACKAGE SIZE addition is generally ony used when you will be selecting so much data that if you did it all in one go, there wouldn't be enough space in the internal table (system constraint) and it would dump.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So you read a number of records into an internal table using PACKAGE SIZE, process these records into a &amp;lt;u&amp;gt;different&amp;lt;/u&amp;gt; internal table and then read another package into the first table (over writing the original contents).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It doesn't matter that the table is being over written, because you are only interested in the second table that contains the processed entries.&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, 29 Aug 2007 13:16:22 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/package-size-in-select-query/m-p/2658314#M613116</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-08-29T13:16:22Z</dc:date>
    </item>
    <item>
      <title>Re: package size in select query</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/package-size-in-select-query/m-p/2658315#M613117</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Since actual data package size is greater than MAXLINES, data is transferred in packages of size MAXLINES or 40000 bytes.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 30 Aug 2007 09:32:20 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/package-size-in-select-query/m-p/2658315#M613117</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-08-30T09:32:20Z</dc:date>
    </item>
  </channel>
</rss>

