<?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: Problem while Summing up numeric values of a column in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-while-summing-up-numeric-values-of-a-column/m-p/5941642#M1334672</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Thanx for ur help...but you are forgetting I dont have to sum all the amount to get the net amount..rather on change of posting date..I have to check first whether the totol number of record  till the new posting date is less than 900 or not&lt;/P&gt;&lt;P&gt;if it is less than 900 then I have to do the sum and check if the balance is zero and then add a balancing entry.&lt;/P&gt;&lt;P&gt;if it is more than 900, then I have to take the first 900...add and check whether balance is 0 and add a balancing entry to make the total 0 and post it and then process the remaining data in the same way.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 20 Jul 2009 06:27:15 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2009-07-20T06:27:15Z</dc:date>
    <item>
      <title>Problem while Summing up numeric values of a column</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-while-summing-up-numeric-values-of-a-column/m-p/5941639#M1334669</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have a internal table which has the following field&lt;/P&gt;&lt;P&gt;   1) posting data&lt;/P&gt;&lt;P&gt;   2) amount &lt;/P&gt;&lt;P&gt;  3) account no&lt;/P&gt;&lt;P&gt;  4) account indicator ( S for debit , H for credit)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now I have to implement 3 logic on this internal table&lt;/P&gt;&lt;P&gt;first -&amp;gt;I have to loop on this internal table and... on change of posting date i have to add all the amount for this posting date (this amount can be both credit and debit.Debit will be with -sign and credit will be + sign).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Second -&amp;gt; after adding I need to check the no of record which is processed for the same posting date&lt;/P&gt;&lt;P&gt;if it is less than 900..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;third - &amp;gt; I will check the amount , if the amount (ie credit + debit ) is not equal to zero, I will a balancing entry in account no 3311001 and amount will the total amount calculated with a opposite sign...so that the total becomes 0, and add this entry to internal table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if the no of records is more than 900...then first I need to process the first 900 (by repaeting step third) record and the rest of the record for the same posting date will be processed (according to step third)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am very confused about how to implment all 3 logic..I can use AT new posting data...sum ...endat.&lt;/P&gt;&lt;P&gt;but sum only calculates the numeric value of a row..I want total value of the column...and then checking for 900 records...please help..any suggestion would be helpful.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 19 Jul 2009 18:03:53 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-while-summing-up-numeric-values-of-a-column/m-p/5941639#M1334669</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-07-19T18:03:53Z</dc:date>
    </item>
    <item>
      <title>Re: Problem while Summing up numeric values of a column</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-while-summing-up-numeric-values-of-a-column/m-p/5941640#M1334670</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi , &lt;/P&gt;&lt;P&gt;below should work .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at itab .&lt;/P&gt;&lt;P&gt;x = x + 1. &lt;/P&gt;&lt;P&gt;amount_tot = itab-amount + amount_tot  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if x &amp;gt; 900 .&lt;/P&gt;&lt;P&gt;if amount_tot &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;P&gt;create docu with itab-postingdate .&lt;/P&gt;&lt;P&gt;clear x.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;clear amount_tot.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;at end posting_dt .&lt;/P&gt;&lt;P&gt;if amount_tot &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;P&gt;create document with itab-postingdate .&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;clear amount_tot.&lt;/P&gt;&lt;P&gt;clear x .&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;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;vinay&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: vinay kolla on Jul 20, 2009 1:40 AM&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: vinay kolla on Jul 20, 2009 1:44 AM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 19 Jul 2009 23:40:09 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-while-summing-up-numeric-values-of-a-column/m-p/5941640#M1334670</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-07-19T23:40:09Z</dc:date>
    </item>
    <item>
      <title>Re: Problem while Summing up numeric values of a column</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-while-summing-up-numeric-values-of-a-column/m-p/5941641#M1334671</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;Check this. I am giving you a skeleton of the logic that you asked for. Work on this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;

LOOP AT t_itab.
  IF t_itab-acct_ind = 'S'.
    s_amount = s_amount + t_itab-amount.
  ELSEIF t_itab-acct_ind = 'H'.
    h_amount = h_amount + t_itab-amount.
  ENDIF.
  tot_amount = s_amount + h_amount.
  count = count + 1.
  IF count EQ 900.
    temp_amount = tot_amount.
   " Do your logic
  ENDIF.
  AT END OF post_date.
    IF count LE 900.
           "Make an entry and add a -ve sign
    ELSEIF count GT 900.
       tot_amount = tot_amount-temp_amount.
       "Do your logic
    ENDIF.
    CLEAR: s_amount,
           h_amount,
           count.
  ENDAT.
ENDLOOP.

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 20 Jul 2009 06:04:50 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-while-summing-up-numeric-values-of-a-column/m-p/5941641#M1334671</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-07-20T06:04:50Z</dc:date>
    </item>
    <item>
      <title>Re: Problem while Summing up numeric values of a column</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-while-summing-up-numeric-values-of-a-column/m-p/5941642#M1334672</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Thanx for ur help...but you are forgetting I dont have to sum all the amount to get the net amount..rather on change of posting date..I have to check first whether the totol number of record  till the new posting date is less than 900 or not&lt;/P&gt;&lt;P&gt;if it is less than 900 then I have to do the sum and check if the balance is zero and then add a balancing entry.&lt;/P&gt;&lt;P&gt;if it is more than 900, then I have to take the first 900...add and check whether balance is 0 and add a balancing entry to make the total 0 and post it and then process the remaining data in the same way.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 20 Jul 2009 06:27:15 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-while-summing-up-numeric-values-of-a-column/m-p/5941642#M1334672</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-07-20T06:27:15Z</dc:date>
    </item>
  </channel>
</rss>

