<?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: count from an internal table in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/count-from-an-internal-table/m-p/2844686#M666345</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;try this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: counter(2) type n.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sort itab by division.&lt;/P&gt;&lt;P&gt;loop at itab.&lt;/P&gt;&lt;P&gt; at new division.&lt;/P&gt;&lt;P&gt;    add 1 to counter.&lt;/P&gt;&lt;P&gt; endat.&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 28 Sep 2007 08:11:41 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-09-28T08:11:41Z</dc:date>
    <item>
      <title>count from an internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/count-from-an-internal-table/m-p/2844685#M666344</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;In my internal table, I have multiple entries for different divisions.&lt;/P&gt;&lt;P&gt;I need the count of all the distinct divisions.&lt;/P&gt;&lt;P&gt;For example: I have &lt;/P&gt;&lt;P&gt;2 records for division 20,&lt;/P&gt;&lt;P&gt;2 records for division 30, and&lt;/P&gt;&lt;P&gt;2 records for division 40.&lt;/P&gt;&lt;P&gt;then in this case the count value should be 3.&lt;/P&gt;&lt;P&gt;Can anyone suggest any logic for this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Points will rewarded for correct answer.&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 28 Sep 2007 07:36:00 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/count-from-an-internal-table/m-p/2844685#M666344</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-09-28T07:36:00Z</dc:date>
    </item>
    <item>
      <title>Re: count from an internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/count-from-an-internal-table/m-p/2844686#M666345</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;try this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: counter(2) type n.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sort itab by division.&lt;/P&gt;&lt;P&gt;loop at itab.&lt;/P&gt;&lt;P&gt; at new division.&lt;/P&gt;&lt;P&gt;    add 1 to counter.&lt;/P&gt;&lt;P&gt; endat.&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 28 Sep 2007 08:11:41 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/count-from-an-internal-table/m-p/2844686#M666345</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-09-28T08:11:41Z</dc:date>
    </item>
    <item>
      <title>Re: count from an internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/count-from-an-internal-table/m-p/2844687#M666346</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;Try the follwing it will resolve the problem. Use control break for internal table (AT new field name) &amp;amp;  counter. increase the counter at each new loop pass: e.g.:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Loop at itab into wa.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;AT NEW division.&lt;/P&gt;&lt;P&gt;count = count + 1.&lt;/P&gt;&lt;P&gt;ENDAT.&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;Reward points if helpful answer.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ashvender.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 28 Sep 2007 08:20:31 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/count-from-an-internal-table/m-p/2844687#M666346</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-09-28T08:20:31Z</dc:date>
    </item>
  </channel>
</rss>

