<?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: Need help regarding processing large data with multiple approach.cursor in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/need-help-regarding-processing-large-data-with-multiple-approach-cursor/m-p/11171968#M1908312</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Rinki,&lt;/P&gt;&lt;P&gt;Did not understand your second 'FECTCH NEXT', need this ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Generally, we do like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 12px; color: #333333;"&gt;OPEN CURSOR s_cursor FOR&amp;nbsp;&amp;nbsp; (ON HOLD is not necessary, no explicit&amp;nbsp; db commit here)&lt;BR /&gt;SELECT *&lt;/P&gt;&lt;P style="font-size: 12px; color: #333333;"&gt;FROM A&lt;/P&gt;&lt;P style="font-size: 12px; color: #333333;"&gt;WHERE conditions.&lt;/P&gt;&lt;P style="font-size: 12px; color: #333333;"&gt;&lt;/P&gt;&lt;P style="font-size: 12px; color: #333333;"&gt;DO.&lt;BR /&gt;FETCH NEXT CURSOR s_cursor into TABLE itab_a PACKAGE SIZE p_size(from selection screen,default 10000, depend on your data size. If in this time of 'FETCH NEXT', the summary size of itab_a, itab_b and itab_c&amp;nbsp; over the abap memory size, it will occurs memory dump, then you need reduce this size number).&lt;BR /&gt;IF sy-subrc &amp;lt;&amp;gt; 0.&lt;BR /&gt;EXIT.&lt;BR /&gt;ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 12px; color: #333333;"&gt;SELECT * INTO itab_b&lt;/P&gt;&lt;P style="font-size: 12px; color: #333333;"&gt;FROM B for all entries in A&lt;BR /&gt;WHERE conditions&lt;/P&gt;&lt;P style="font-size: 12px; color: #333333;"&gt;&lt;/P&gt;&lt;P style="font-size: 12px; color: #333333;"&gt;SELECT * INTO itab_c&lt;/P&gt;&lt;P style="font-size: 12px; color: #333333;"&gt;FROM C for all entries in A &lt;BR /&gt;WHERE conditions.&lt;/P&gt;&lt;P style="font-size: 12px; color: #333333;"&gt;&lt;/P&gt;&lt;P style="font-size: 12px; color: #333333;"&gt;LOOP itab_A...&lt;/P&gt;&lt;P style="font-size: 12px; color: #333333;"&gt;&amp;nbsp; functions.&lt;/P&gt;&lt;P style="font-size: 12px; color: #333333;"&gt;ENDLOOP.&lt;/P&gt;&lt;P style="font-size: 12px; color: #333333;"&gt;&lt;/P&gt;&lt;P style="font-size: 12px; color: #333333;"&gt;ENDDO.&lt;/P&gt;&lt;P style="font-size: 12px; color: #333333;"&gt;&lt;/P&gt;&lt;P style="font-size: 12px; color: #333333;"&gt;regards,&lt;BR /&gt;Archer&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 13 Jul 2015 11:34:21 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2015-07-13T11:34:21Z</dc:date>
    <item>
      <title>Need help regarding processing large data with multiple approach.cursor</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/need-help-regarding-processing-large-data-with-multiple-approach-cursor/m-p/11171966#M1908310</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;&lt;/P&gt;&lt;P&gt;We need you help regarding&amp;nbsp; one of the approach for more performance effective as it involves multiple data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;We have the following requirement,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;We need to retrieve large amount of data form&amp;nbsp; four consecutive table and then processing needs to be done by looping to the initial table and&lt;/P&gt;&lt;P&gt;number of processing of data will be around &lt;STRONG style="font-size: 12pt;"&gt;4/5&lt;/STRONG&gt;&lt;SPAN style="font-size: 12pt;"&gt; milllion.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now we are taking the approach to open cursor for retrieving data from the tables, as i am new in using this so bit confused whoch approach will be more performance effective,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="text-decoration: underline;"&gt;First approach&lt;/STRONG&gt; is&amp;nbsp; we will open the cursor and retrieve data from rest of the three table also and append those and the close the cursor, and the loop processing will be done without cursor, basically if the tables are A, B Aand C then will do the following ..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;OPEN CURSOR WITH HOLD s_cursor FOR&lt;BR /&gt;SELECT&lt;/P&gt;&lt;P&gt;----&lt;/P&gt;&lt;P&gt;----&lt;BR /&gt;FROM A&lt;/P&gt;&lt;P&gt;WHERE conditions&lt;/P&gt;&lt;P&gt;DO.&lt;BR /&gt;FETCH NEXT CURSOR s_cursor appending TABLE lt_A PACKAGE SIZE 60000.&lt;BR /&gt;IF sy-subrc &amp;lt;&amp;gt; 0.&lt;BR /&gt;EXIT.&lt;BR /&gt;ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT&amp;nbsp; &lt;/P&gt;&lt;P&gt;----&lt;/P&gt;&lt;P&gt;----&lt;BR /&gt;FROM B&lt;/P&gt;&lt;P&gt;for all entries in A ----- ?&lt;STRONG&gt; I guess we&amp;nbsp; can use&amp;nbsp; for all entries..&lt;/STRONG&gt;&lt;BR /&gt;WHERE conditions&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DO.&lt;BR /&gt;FETCH NEXT CURSOR s_cursor appending TABLE lt_B PACKAGE SIZE 60000.&lt;BR /&gt;IF sy-subrc &amp;lt;&amp;gt; 0.&lt;BR /&gt;EXIT.&lt;BR /&gt;ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and then similar retrieval for 3rd table and then&lt;/P&gt;&lt;P&gt;ENDDO.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;close cursor.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;and then will process through lt_A and perform actions and all those.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="text-decoration: underline;"&gt;second approach&lt;/STRONG&gt; is&amp;nbsp; we will open the cursor and retrieve data from rest of the three table by package size but here our processing for main table and all those will be done within the cursor,means we will do the processing as package size 60000 and same way the whole will be done..please&lt;/P&gt;&lt;P&gt;find them below..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;OPEN CURSOR WITH HOLD s_cursor FOR&lt;BR /&gt;SELECT&lt;/P&gt;&lt;P&gt;----&lt;/P&gt;&lt;P&gt;----&lt;BR /&gt;FROM A &lt;/P&gt;&lt;P&gt;WHERE conditions&lt;/P&gt;&lt;P&gt;DO.&lt;BR /&gt;FETCH NEXT CURSOR s_cursor into TABLE lt_A PACKAGE SIZE 60000.&lt;BR /&gt;IF sy-subrc &amp;lt;&amp;gt; 0.&lt;BR /&gt;EXIT.&lt;BR /&gt;ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT&amp;nbsp; &lt;/P&gt;&lt;P&gt;----&lt;/P&gt;&lt;P&gt;----&lt;BR /&gt;FROM B for all entries in A ----- ? I guess we&amp;nbsp; can use&amp;nbsp; for all entries..&lt;BR /&gt;WHERE conditions&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DO.&lt;BR /&gt;FETCH NEXT CURSOR s_cursor into&amp;nbsp; TABLE lt_B PACKAGE SIZE 60000.&lt;BR /&gt;IF sy-subrc &amp;lt;&amp;gt; 0.&lt;BR /&gt;EXIT.&lt;BR /&gt;ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and then similar retrieval for 3rd table and then.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;and then will process through lt_A and perform actions and all those foe each bulk of 60000 entries..&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at lt_a into..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;functions...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDLOOP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;ENDDO.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;close cursor.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;STRONG&gt; &lt;SPAN style="font-size: 10pt;"&gt;Please help us regarding the approaches, which should be followed ?&amp;nbsp; it will really help a lot. I think we should follow second but as i am new to this so&amp;nbsp; &lt;/SPAN&gt;&lt;/STRONG&gt;&lt;STRONG style=": ; font-size: 10pt;"&gt;need your advice. Also, package size 60000 is ok&amp;nbsp; or it should be reduced ?&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;Thanks a lot in advance.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 13 Jul 2015 07:11:30 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/need-help-regarding-processing-large-data-with-multiple-approach-cursor/m-p/11171966#M1908310</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2015-07-13T07:11:30Z</dc:date>
    </item>
    <item>
      <title>Re: Need help regarding processing large data with multiple approach.cursor</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/need-help-regarding-processing-large-data-with-multiple-approach-cursor/m-p/11171967#M1908311</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Rinki,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If processing needs to be done based on initial table, then it will be better to use Join in the OPen-Cursor Select.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If processing needs to be done based on records from unique fields of all four tables then you can use all four tables in the Join.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And please reduce the package size.. As far as we are using , we would consider 10000 as the size. Since if the number of columns are more, then we will get dump due to spacing issue.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Deepan Swaminathan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 13 Jul 2015 07:22:33 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/need-help-regarding-processing-large-data-with-multiple-approach-cursor/m-p/11171967#M1908311</guid>
      <dc:creator>deepan_v_s</dc:creator>
      <dc:date>2015-07-13T07:22:33Z</dc:date>
    </item>
    <item>
      <title>Re: Need help regarding processing large data with multiple approach.cursor</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/need-help-regarding-processing-large-data-with-multiple-approach-cursor/m-p/11171968#M1908312</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Rinki,&lt;/P&gt;&lt;P&gt;Did not understand your second 'FECTCH NEXT', need this ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Generally, we do like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 12px; color: #333333;"&gt;OPEN CURSOR s_cursor FOR&amp;nbsp;&amp;nbsp; (ON HOLD is not necessary, no explicit&amp;nbsp; db commit here)&lt;BR /&gt;SELECT *&lt;/P&gt;&lt;P style="font-size: 12px; color: #333333;"&gt;FROM A&lt;/P&gt;&lt;P style="font-size: 12px; color: #333333;"&gt;WHERE conditions.&lt;/P&gt;&lt;P style="font-size: 12px; color: #333333;"&gt;&lt;/P&gt;&lt;P style="font-size: 12px; color: #333333;"&gt;DO.&lt;BR /&gt;FETCH NEXT CURSOR s_cursor into TABLE itab_a PACKAGE SIZE p_size(from selection screen,default 10000, depend on your data size. If in this time of 'FETCH NEXT', the summary size of itab_a, itab_b and itab_c&amp;nbsp; over the abap memory size, it will occurs memory dump, then you need reduce this size number).&lt;BR /&gt;IF sy-subrc &amp;lt;&amp;gt; 0.&lt;BR /&gt;EXIT.&lt;BR /&gt;ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 12px; color: #333333;"&gt;SELECT * INTO itab_b&lt;/P&gt;&lt;P style="font-size: 12px; color: #333333;"&gt;FROM B for all entries in A&lt;BR /&gt;WHERE conditions&lt;/P&gt;&lt;P style="font-size: 12px; color: #333333;"&gt;&lt;/P&gt;&lt;P style="font-size: 12px; color: #333333;"&gt;SELECT * INTO itab_c&lt;/P&gt;&lt;P style="font-size: 12px; color: #333333;"&gt;FROM C for all entries in A &lt;BR /&gt;WHERE conditions.&lt;/P&gt;&lt;P style="font-size: 12px; color: #333333;"&gt;&lt;/P&gt;&lt;P style="font-size: 12px; color: #333333;"&gt;LOOP itab_A...&lt;/P&gt;&lt;P style="font-size: 12px; color: #333333;"&gt;&amp;nbsp; functions.&lt;/P&gt;&lt;P style="font-size: 12px; color: #333333;"&gt;ENDLOOP.&lt;/P&gt;&lt;P style="font-size: 12px; color: #333333;"&gt;&lt;/P&gt;&lt;P style="font-size: 12px; color: #333333;"&gt;ENDDO.&lt;/P&gt;&lt;P style="font-size: 12px; color: #333333;"&gt;&lt;/P&gt;&lt;P style="font-size: 12px; color: #333333;"&gt;regards,&lt;BR /&gt;Archer&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 13 Jul 2015 11:34:21 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/need-help-regarding-processing-large-data-with-multiple-approach-cursor/m-p/11171968#M1908312</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2015-07-13T11:34:21Z</dc:date>
    </item>
  </channel>
</rss>

