<?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: Help required with logic in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/help-required-with-logic/m-p/6444811#M1412839</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;STRONG&gt;&lt;SPAN __default_attr="red" __jive_macro_name="color"&gt;Moderator message: pleause use a meaningful subject in future&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 17 Dec 2009 09:03:20 GMT</pubDate>
    <dc:creator>matt</dc:creator>
    <dc:date>2009-12-17T09:03:20Z</dc:date>
    <item>
      <title>Help required with logic</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/help-required-with-logic/m-p/6444809#M1412837</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;STRONG&gt;&lt;SPAN __default_attr="red" __jive_macro_name="color"&gt;Moderator message: pleause use a meaningful subject in future&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I have a custom table which has customer ID field and amount field.&lt;/P&gt;&lt;P&gt;In the report I need to bucket data by amount and no. of customers in that bucket.&lt;/P&gt;&lt;P&gt;For ex: for amount range 1.00 u2013 25.00 there are 100 customers and total amount $1000.00, 25.01 to 50.00 there are 34 customers  and total amount $20,000 and so on.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What I am planning to do is fetch records from table into internal table using group by clause,&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
SELECT CUSTOMER AMOUNT FROM CUSTOMER_FINES INTO TABLE LT_FINES GROUP BY CUSTOMER AMOUNT.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This would bring me in the internal table all customers and their fine. Now what would be the best logic to separate them out into groups.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Approach what I thought of is having two variables for each bucket no_of_customers and total_amount. Then loop through the internal table add If conditions on amount and then accordingly increment no_of_customers for that bucket and add amount to total_amount.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But the internal table is likely to have a lot of records about half a million. Is this a good approach. Can you'll recommend what is the right way to achieve this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance,&lt;/P&gt;&lt;P&gt;CD&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Matt on Dec 17, 2009 10:02 AM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 16 Dec 2009 16:31:31 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/help-required-with-logic/m-p/6444809#M1412837</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-12-16T16:31:31Z</dc:date>
    </item>
    <item>
      <title>Re: Help required with logic</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/help-required-with-logic/m-p/6444810#M1412838</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; do this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; 1. create counters for the no of ranges you have say 1.00 u2013 25.00 counter1 total_amt1, 25.01 to 50.00 counter2 total_amt2 etc&lt;/P&gt;&lt;P&gt; 2. loop at your internal table&lt;/P&gt;&lt;P&gt; 3. check which range the amount falls into using IF statement&lt;/P&gt;&lt;P&gt; 4. increment counter* by 1 and add amount to total_amt*&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You are done. &lt;SPAN __jive_emoticon_name="happy"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Prasenjit&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 16 Dec 2009 20:08:54 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/help-required-with-logic/m-p/6444810#M1412838</guid>
      <dc:creator>prasenjit_sharma</dc:creator>
      <dc:date>2009-12-16T20:08:54Z</dc:date>
    </item>
    <item>
      <title>Re: Help required with logic</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/help-required-with-logic/m-p/6444811#M1412839</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;STRONG&gt;&lt;SPAN __default_attr="red" __jive_macro_name="color"&gt;Moderator message: pleause use a meaningful subject in future&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 17 Dec 2009 09:03:20 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/help-required-with-logic/m-p/6444811#M1412839</guid>
      <dc:creator>matt</dc:creator>
      <dc:date>2009-12-17T09:03:20Z</dc:date>
    </item>
  </channel>
</rss>

