<?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: SQL: Package selection with entry-point/up to rows in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/sql-package-selection-with-entry-point-up-to-rows/m-p/6794025#M1466367</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Did you look into using the PACKAGE SIZE option of the SELECT statement? This does automatically on database level what you're trying to simulate here on the application server.&lt;/P&gt;&lt;P&gt;Thomas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 06 Apr 2010 15:48:50 GMT</pubDate>
    <dc:creator>ThomasZloch</dc:creator>
    <dc:date>2010-04-06T15:48:50Z</dc:date>
    <item>
      <title>SQL: Package selection with entry-point/up to rows</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sql-package-selection-with-entry-point-up-to-rows/m-p/6794024#M1466366</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello together, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would like to ask for a "mathematical" question concerning select clause with entry-point to build package wise selection. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If I have one key, I just can set the where-clause by keyfield &amp;gt; keyfield as next entry point, e.g.: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select * from mara into table lt_mara &lt;/P&gt;&lt;P&gt;up to 1000 rows &lt;/P&gt;&lt;P&gt;where matnr &amp;gt; lv_last_matnr. &lt;/P&gt;&lt;P&gt;lv_last_matnr = {last selected row].&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But if I have more keys, so I need all relevant components in the where-clause. &lt;/P&gt;&lt;P&gt;(There is a requirement with more than 10 key elements) &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there a general rule, where can be used to formulate the corresponding where-clause? &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks &amp;amp; best regards, &lt;/P&gt;&lt;P&gt;Kurt.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 06 Apr 2010 15:41:35 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sql-package-selection-with-entry-point-up-to-rows/m-p/6794024#M1466366</guid>
      <dc:creator>Weiskopf</dc:creator>
      <dc:date>2010-04-06T15:41:35Z</dc:date>
    </item>
    <item>
      <title>Re: SQL: Package selection with entry-point/up to rows</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sql-package-selection-with-entry-point-up-to-rows/m-p/6794025#M1466367</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Did you look into using the PACKAGE SIZE option of the SELECT statement? This does automatically on database level what you're trying to simulate here on the application server.&lt;/P&gt;&lt;P&gt;Thomas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 06 Apr 2010 15:48:50 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sql-package-selection-with-entry-point-up-to-rows/m-p/6794025#M1466367</guid>
      <dc:creator>ThomasZloch</dc:creator>
      <dc:date>2010-04-06T15:48:50Z</dc:date>
    </item>
    <item>
      <title>Re: SQL: Package selection with entry-point/up to rows</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sql-package-selection-with-entry-point-up-to-rows/m-p/6794026#M1466368</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Thomas, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thank you for your answer. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Unfortunately, I cannot use this type of selection, because I'll have commit process that will close the prior opened cursor (equals select ... endselect). &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm looking for a general rule cause the program will be very generic; any table will be selected with different keys. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks &amp;amp; best regards, &lt;/P&gt;&lt;P&gt;Kurt.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 07 Apr 2010 08:17:40 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sql-package-selection-with-entry-point-up-to-rows/m-p/6794026#M1466368</guid>
      <dc:creator>Weiskopf</dc:creator>
      <dc:date>2010-04-07T08:17:40Z</dc:date>
    </item>
    <item>
      <title>Re: SQL: Package selection with entry-point/up to rows</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sql-package-selection-with-entry-point-up-to-rows/m-p/6794027#M1466369</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I see, but I think it would be quite difficult to come up with a generic solution.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regarding the commit work, there is a workaround using OPEN CURSOR ... WITH HOLD that still allows you to use PACKAGE SIZE:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;OPEN CURSOR WITH HOLD ... FOR SELECT ...
DO.
  FETCH NEXT CURSOR ... PACKAGE SIZE ...
  IF SY-SUBRC &amp;amp;lt;&amp;amp;gt; 0.
    EXIT.
  ENDIF.
* do something that requires a periodic DB commit
  CALL FUNCTION 'DB_COMMIT'.
ENDDO.
CLOSE CURSOR ...&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thomas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 07 Apr 2010 14:39:40 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sql-package-selection-with-entry-point-up-to-rows/m-p/6794027#M1466369</guid>
      <dc:creator>ThomasZloch</dc:creator>
      <dc:date>2010-04-07T14:39:40Z</dc:date>
    </item>
  </channel>
</rss>

