<?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: Totalling with out NESTED LOOPS?? in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/totalling-with-out-nested-loops/m-p/3793422#M912401</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;make vbeln in another table of the same structure of t_vbap a key and then do this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
loop at t_vbap.
read table t_vbak with key vbeln = vbap-vbenln.
if sy-subrc eq 0.
collect vbap into other_vbap.
endif.
endloop.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You will have the sum in kwmeng in the other table&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 12 May 2008 20:13:43 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-05-12T20:13:43Z</dc:date>
    <item>
      <title>Totalling with out NESTED LOOPS??</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/totalling-with-out-nested-loops/m-p/3793420#M912399</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 hv data in t_vbak and t_vbap itabs.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I need to SUM the QUANTITY i.e. VBAP-KWMENG for each VBELN in VBAK i.e each Doc.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So, normally, I use,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at t_vbak.&lt;/P&gt;&lt;P&gt;loop at t_vbap where vbeln = t_vbak-vbeln&lt;/P&gt;&lt;P&gt;tot_qty = tot_qty + vbap-kwmeng&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;modify ......&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But, I do not wanna to use NESTED LOOPS, so, pls. let me any other solution?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanq&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 12 May 2008 20:06:11 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/totalling-with-out-nested-loops/m-p/3793420#M912399</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-05-12T20:06:11Z</dc:date>
    </item>
    <item>
      <title>Re: Totalling with out NESTED LOOPS??</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/totalling-with-out-nested-loops/m-p/3793421#M912400</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Forget it, wasn't look to well a coding....vbaK and vbaP&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sort the table by VBELN and next use SUM (standard ABAP statement) within loop at vbap.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Micky Oestreich on May 12, 2008 10:12 PM&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Micky Oestreich on May 12, 2008 10:12 PM&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Micky Oestreich on May 12, 2008 10:14 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 12 May 2008 20:11:40 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/totalling-with-out-nested-loops/m-p/3793421#M912400</guid>
      <dc:creator>Sm1tje</dc:creator>
      <dc:date>2008-05-12T20:11:40Z</dc:date>
    </item>
    <item>
      <title>Re: Totalling with out NESTED LOOPS??</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/totalling-with-out-nested-loops/m-p/3793422#M912401</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;make vbeln in another table of the same structure of t_vbap a key and then do this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
loop at t_vbap.
read table t_vbak with key vbeln = vbap-vbenln.
if sy-subrc eq 0.
collect vbap into other_vbap.
endif.
endloop.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You will have the sum in kwmeng in the other table&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 12 May 2008 20:13:43 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/totalling-with-out-nested-loops/m-p/3793422#M912401</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-05-12T20:13:43Z</dc:date>
    </item>
    <item>
      <title>Re: Totalling with out NESTED LOOPS??</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/totalling-with-out-nested-loops/m-p/3793423#M912402</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Use COLLECT statement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
* Declare IT_SUM with VBELN and QTY

LOOP AT IT_VBAP.
IT_SUM-VBELN = IT_VBAP-VBELN.
IT_SUM-QTY = IT_VBAP-MENGE.
COLLECT IT_SUM.
CLEAR   IT_SUM.
ENDLOOP.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Naimesh Patel&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 12 May 2008 20:21:31 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/totalling-with-out-nested-loops/m-p/3793423#M912402</guid>
      <dc:creator>naimesh_patel</dc:creator>
      <dc:date>2008-05-12T20:21:31Z</dc:date>
    </item>
  </channel>
</rss>

