<?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 Problem with loop at end of ... in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-loop-at-end-of/m-p/8818784#M1681976</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear experts,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am trying to sum a value in an internal table with the following code:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; sort it_vbrp by matnr.&lt;/P&gt;&lt;P&gt;&amp;nbsp; loop at&amp;nbsp; it_vbrp.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; at new matnr.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; clear it_sqty.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; endat.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; it_sqty-matnr =&amp;nbsp; it_vbrp-matnr.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; it_sqty-slqty = it_sqty-slqty +&amp;nbsp; it_vbrp-FKIMG. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; at end of &lt;STRONG&gt;matnr&lt;/STRONG&gt;.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; append it_sqty.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; endat.&lt;/P&gt;&lt;P&gt;&amp;nbsp; endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The problem is that it goes to the statement&lt;STRONG&gt; "append it_sqty."&lt;/STRONG&gt; in every loop even though &lt;STRONG&gt;matnr&lt;/STRONG&gt; is still the same.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Would you please let me know how to correct it?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sincerely,&lt;/P&gt;&lt;P&gt;VT&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #ff0000;"&gt;&lt;STRONG&gt;Moderator Message: It is explained in SAP documentation, read it once. Thread Locked.&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: Kesavadas Thekkillath&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 15 Jun 2012 09:47:24 GMT</pubDate>
    <dc:creator>former_member431874</dc:creator>
    <dc:date>2012-06-15T09:47:24Z</dc:date>
    <item>
      <title>Problem with loop at end of ...</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-loop-at-end-of/m-p/8818784#M1681976</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear experts,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am trying to sum a value in an internal table with the following code:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; sort it_vbrp by matnr.&lt;/P&gt;&lt;P&gt;&amp;nbsp; loop at&amp;nbsp; it_vbrp.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; at new matnr.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; clear it_sqty.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; endat.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; it_sqty-matnr =&amp;nbsp; it_vbrp-matnr.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; it_sqty-slqty = it_sqty-slqty +&amp;nbsp; it_vbrp-FKIMG. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; at end of &lt;STRONG&gt;matnr&lt;/STRONG&gt;.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; append it_sqty.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; endat.&lt;/P&gt;&lt;P&gt;&amp;nbsp; endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The problem is that it goes to the statement&lt;STRONG&gt; "append it_sqty."&lt;/STRONG&gt; in every loop even though &lt;STRONG&gt;matnr&lt;/STRONG&gt; is still the same.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Would you please let me know how to correct it?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sincerely,&lt;/P&gt;&lt;P&gt;VT&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #ff0000;"&gt;&lt;STRONG&gt;Moderator Message: It is explained in SAP documentation, read it once. Thread Locked.&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: Kesavadas Thekkillath&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 15 Jun 2012 09:47:24 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-loop-at-end-of/m-p/8818784#M1681976</guid>
      <dc:creator>former_member431874</dc:creator>
      <dc:date>2012-06-15T09:47:24Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with loop at end of ...</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-loop-at-end-of/m-p/8818785#M1681977</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;MATNR should be the first field in it_vbrp for this to work.&lt;/P&gt;&lt;P&gt;In your internal table say, if you have VBELN VBPOS MATNR, then AT END OF MATNR will be trigerred when one of these 3 fields change.&lt;/P&gt;&lt;P&gt;Check the documentation for At END of&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Shambu&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 15 Jun 2012 10:00:20 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-loop-at-end-of/m-p/8818785#M1681977</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2012-06-15T10:00:20Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with loop at end of ...</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-loop-at-end-of/m-p/8818786#M1681978</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;When you keep the fields in a group the sort fields should be the first.Just check in debug mode.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Madhu.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 15 Jun 2012 10:02:48 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-loop-at-end-of/m-p/8818786#M1681978</guid>
      <dc:creator>madhu_vadlamani</dc:creator>
      <dc:date>2012-06-15T10:02:48Z</dc:date>
    </item>
  </channel>
</rss>

