<?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: Amount calculation in internal table.... in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/amount-calculation-in-internal-table/m-p/10427953#M1845224</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;sort the internal table by HKONT and loop at internal table,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;in loop u can use&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;at end of HKONT.&lt;/P&gt;&lt;P&gt;sum.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i don't know if it is possible without using loop.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 18 Jul 2014 12:05:24 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2014-07-18T12:05:24Z</dc:date>
    <item>
      <title>Amount calculation in internal table....</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/amount-calculation-in-internal-table/m-p/10427950#M1845221</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;BR /&gt;HI,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have an internal table ITAB with fields HKONT, BELNR, BUZEI &amp;amp; DMBTR. I want a sum of DMBTR for the same HKONT. Is it possible to do thi without looping ?...or Please suggest a better way to do this ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I will have millions of records in this internal table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 18 Jul 2014 11:53:01 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/amount-calculation-in-internal-table/m-p/10427950#M1845221</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2014-07-18T11:53:01Z</dc:date>
    </item>
    <item>
      <title>Re: Amount calculation in internal table....</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/amount-calculation-in-internal-table/m-p/10427951#M1845222</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; When u volume of data is large &amp;amp; u want sum of dmbtr for individual HKONT, then why u re populating ur ITAB with belnr and buzei,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Use Aggregate function SUM to retrieve data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 18 Jul 2014 12:02:33 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/amount-calculation-in-internal-table/m-p/10427951#M1845222</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2014-07-18T12:02:33Z</dc:date>
    </item>
    <item>
      <title>Re: Amount calculation in internal table....</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/amount-calculation-in-internal-table/m-p/10427952#M1845223</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;Use Collect statement..............&lt;SPAN __jive_emoticon_name="wink" __jive_macro_name="emoticon" class="jive_macro_emoticon jive_macro jive_emote" src="https://community.sap.com/906/images/emoticons/wink.gif"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;or while selecting from database table you can use SUM aggregate function&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;&lt;/P&gt;&lt;P&gt;Yogendra Bhaskar&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 18 Jul 2014 12:03:24 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/amount-calculation-in-internal-table/m-p/10427952#M1845223</guid>
      <dc:creator>yogendra_bhaskar</dc:creator>
      <dc:date>2014-07-18T12:03:24Z</dc:date>
    </item>
    <item>
      <title>Re: Amount calculation in internal table....</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/amount-calculation-in-internal-table/m-p/10427953#M1845224</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;sort the internal table by HKONT and loop at internal table,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;in loop u can use&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;at end of HKONT.&lt;/P&gt;&lt;P&gt;sum.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i don't know if it is possible without using loop.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 18 Jul 2014 12:05:24 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/amount-calculation-in-internal-table/m-p/10427953#M1845224</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2014-07-18T12:05:24Z</dc:date>
    </item>
    <item>
      <title>Re: Amount calculation in internal table....</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/amount-calculation-in-internal-table/m-p/10427954#M1845225</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 guess you will get a problem when populating your internal table with "millions of records" because of the restriction of the main memory. So, I would also suggest using an aggregate function.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you need the data in the internal table absolutely, you should read the data in packages by using a cursor:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="L0S52"&gt;DATA&lt;SPAN class="L0S55"&gt;: &lt;/SPAN&gt;g_cursor &lt;SPAN class="L0S52"&gt;TYPE &lt;/SPAN&gt;&lt;SPAN class="L0S52"&gt;cursor&lt;/SPAN&gt;&lt;SPAN class="L0S55"&gt;,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp; &lt;SPAN class="L0S52"&gt;OPEN &lt;/SPAN&gt;&lt;SPAN class="L0S52"&gt;CURSOR &lt;/SPAN&gt;&lt;SPAN class="L0S52"&gt;WITH &lt;/SPAN&gt;HOLD g_cursor &lt;SPAN class="L0S52"&gt;FOR&lt;/SPAN&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="L0S52"&gt;SELECT &lt;/SPAN&gt;... &lt;SPAN class="L0S52"&gt;FROM ...&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp; &lt;SPAN class="L0S52"&gt;DO&lt;/SPAN&gt;&lt;SPAN class="L0S55"&gt;.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="L0S52"&gt;FETCH &lt;/SPAN&gt;&lt;SPAN class="L0S52"&gt;NEXT &lt;/SPAN&gt;&lt;SPAN class="L0S52"&gt;CURSOR &lt;/SPAN&gt;g_cursor&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="L0S52"&gt;INTO &lt;/SPAN&gt;&lt;SPAN class="L0S52"&gt;TABLE &lt;/SPAN&gt;gt_internal_table&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; PACKAGE &lt;SPAN class="L0S52"&gt;SIZE &lt;/SPAN&gt;&lt;SPAN class="L0S32"&gt;1000&lt;/SPAN&gt;&lt;SPAN class="L0S55"&gt;.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="L0S52"&gt;&lt;SPAN class="L0S55"&gt;&lt;/SPAN&gt;&lt;BR /&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="L0S52"&gt;*&amp;nbsp; do something with the internal table &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="L0S52"&gt;&amp;nbsp; ......&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="L0S52"&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="L0S52"&gt;IF &lt;/SPAN&gt;sy&lt;SPAN class="L0S70"&gt;-&lt;/SPAN&gt;subrc &amp;lt;&amp;gt; &lt;SPAN class="L0S32"&gt;0&lt;/SPAN&gt;&lt;SPAN class="L0S55"&gt;.&lt;/SPAN&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="L0S52"&gt;CLOSE &lt;/SPAN&gt;&lt;SPAN class="L0S52"&gt;CURSOR &lt;/SPAN&gt;g_cursor&lt;SPAN class="L0S55"&gt;.&lt;/SPAN&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="L0S52"&gt;EXIT&lt;/SPAN&gt;&lt;SPAN class="L0S55"&gt;.&lt;/SPAN&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="L0S52"&gt;ENDIF&lt;/SPAN&gt;&lt;SPAN class="L0S55"&gt;.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp; &lt;SPAN class="L0S52"&gt;ENDDO&lt;/SPAN&gt;&lt;SPAN class="L0S55"&gt;.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 18 Jul 2014 13:34:30 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/amount-calculation-in-internal-table/m-p/10427954#M1845225</guid>
      <dc:creator>former_member201285</dc:creator>
      <dc:date>2014-07-18T13:34:30Z</dc:date>
    </item>
  </channel>
</rss>

