<?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 Calculate sum internal table in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/calculate-sum-internal-table/m-p/9488320#M1745707</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;At the end of an abap program, let’s say I have the following internal table:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="1" cellpadding="0" cellspacing="0" style="border: none;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD style="border: solid windowtext 1.0pt; background: #B8CCE4; padding: 0 5.4pt 0 5.4pt;" valign="top" width="154"&gt;&lt;P align="center" style="margin-bottom: 0.0001pt; text-align: center;"&gt;&lt;STRONG&gt;Field1&lt;/STRONG&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD style="border: solid windowtext 1.0pt; border-left: none; background: #B8CCE4; padding: 0 5.4pt 0 5.4pt;" valign="top" width="154"&gt;&lt;P align="center" style="margin-bottom: 0.0001pt; text-align: center;"&gt;&lt;STRONG&gt;Field2&lt;/STRONG&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD style="border: solid windowtext 1.0pt; border-left: none; background: #B8CCE4; padding: 0 5.4pt 0 5.4pt;" valign="top" width="154"&gt;&lt;P align="center" style="margin-bottom: 0.0001pt; text-align: center;"&gt;&lt;STRONG&gt;Field3&lt;/STRONG&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD style="border: solid windowtext 1.0pt; border-left: none; background: #B8CCE4; padding: 0 5.4pt 0 5.4pt;" valign="top" width="154"&gt;&lt;P align="center" style="margin-bottom: 0.0001pt; text-align: center;"&gt;&lt;STRONG&gt;Amount&lt;/STRONG&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="border: solid windowtext 1.0pt; border-top: none; padding: 0 5.4pt 0 5.4pt;" valign="top" width="154"&gt;&lt;P align="center" style="margin-bottom: 0.0001pt; text-align: center;"&gt;TEST1&lt;/P&gt;&lt;/TD&gt;&lt;TD style="border-top: none; border-left: none; border-bottom: solid windowtext 1.0pt; border-right: solid windowtext 1.0pt; padding: 0 5.4pt 0 5.4pt;" valign="top" width="154"&gt;&lt;P align="center" style="margin-bottom: 0.0001pt; text-align: center;"&gt;22/01/2013&lt;/P&gt;&lt;/TD&gt;&lt;TD style="border-top: none; border-left: none; border-bottom: solid windowtext 1.0pt; border-right: solid windowtext 1.0pt; padding: 0 5.4pt 0 5.4pt;" valign="top" width="154"&gt;&lt;P align="center" style="margin-bottom: 0.0001pt; text-align: center;"&gt;A001&lt;/P&gt;&lt;/TD&gt;&lt;TD style="border-top: none; border-left: none; border-bottom: solid windowtext 1.0pt; border-right: solid windowtext 1.0pt; padding: 0 5.4pt 0 5.4pt;" valign="top" width="154"&gt;&lt;P align="center" style="margin-bottom: 0.0001pt; text-align: center;"&gt;-412.80499&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="border: solid windowtext 1.0pt; border-top: none; padding: 0 5.4pt 0 5.4pt;" valign="top" width="154"&gt;&lt;P align="center" style="margin-bottom: 0.0001pt; text-align: center;"&gt;TEST2&lt;/P&gt;&lt;/TD&gt;&lt;TD style="border-top: none; border-left: none; border-bottom: solid windowtext 1.0pt; border-right: solid windowtext 1.0pt; padding: 0 5.4pt 0 5.4pt;" valign="top" width="154"&gt;&lt;P align="center" style="margin-bottom: 0.0001pt; text-align: center;"&gt;15/03/2013&lt;/P&gt;&lt;/TD&gt;&lt;TD style="border-top: none; border-left: none; border-bottom: solid windowtext 1.0pt; border-right: solid windowtext 1.0pt; padding: 0 5.4pt 0 5.4pt;" valign="top" width="154"&gt;&lt;P align="center" style="margin-bottom: 0.0001pt; text-align: center;"&gt;P001&lt;/P&gt;&lt;/TD&gt;&lt;TD style="border-top: none; border-left: none; border-bottom: solid windowtext 1.0pt; border-right: solid windowtext 1.0pt; padding: 0 5.4pt 0 5.4pt;" valign="top" width="154"&gt;&lt;OL style="list-style-type: decimal;"&gt;&lt;LI&gt;2089.27519&lt;/LI&gt;&lt;/OL&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="border: solid windowtext 1.0pt; border-top: none; padding: 0 5.4pt 0 5.4pt;" valign="top" width="154"&gt;&lt;P align="center" style="margin-bottom: 0.0001pt; text-align: center;"&gt;TEST3&lt;/P&gt;&lt;/TD&gt;&lt;TD style="border-top: none; border-left: none; border-bottom: solid windowtext 1.0pt; border-right: solid windowtext 1.0pt; padding: 0 5.4pt 0 5.4pt;" valign="top" width="154"&gt;&lt;P align="center" style="margin-bottom: 0.0001pt; text-align: center;"&gt;10/02/2012&lt;/P&gt;&lt;/TD&gt;&lt;TD style="border-top: none; border-left: none; border-bottom: solid windowtext 1.0pt; border-right: solid windowtext 1.0pt; padding: 0 5.4pt 0 5.4pt;" valign="top" width="154"&gt;&lt;P align="center" style="margin-bottom: 0.0001pt; text-align: center;"&gt;A231&lt;/P&gt;&lt;/TD&gt;&lt;TD style="border-top: none; border-left: none; border-bottom: solid windowtext 1.0pt; border-right: solid windowtext 1.0pt; padding: 0 5.4pt 0 5.4pt;" valign="top" width="154"&gt;&lt;OL style="list-style-type: decimal;"&gt;&lt;LI&gt;238.49557&lt;/LI&gt;&lt;/OL&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="border: solid windowtext 1.0pt; border-top: none; padding: 0 5.4pt 0 5.4pt;" valign="top" width="154"&gt;&lt;P align="center" style="margin-bottom: 0.0001pt; text-align: center;"&gt;TEST4&lt;/P&gt;&lt;/TD&gt;&lt;TD style="border-top: none; border-left: none; border-bottom: solid windowtext 1.0pt; border-right: solid windowtext 1.0pt; padding: 0 5.4pt 0 5.4pt;" valign="top" width="154"&gt;&lt;P align="center" style="margin-bottom: 0.0001pt; text-align: center;"&gt;15/04/2013&lt;/P&gt;&lt;/TD&gt;&lt;TD style="border-top: none; border-left: none; border-bottom: solid windowtext 1.0pt; border-right: solid windowtext 1.0pt; padding: 0 5.4pt 0 5.4pt;" valign="top" width="154"&gt;&lt;P align="center" style="margin-bottom: 0.0001pt; text-align: center;"&gt;PXXX&lt;/P&gt;&lt;/TD&gt;&lt;TD style="border-top: none; border-left: none; border-bottom: solid windowtext 1.0pt; border-right: solid windowtext 1.0pt; padding: 0 5.4pt 0 5.4pt;" valign="top" width="154"&gt;&lt;OL style="list-style-type: decimal;"&gt;&lt;LI&gt;0.68680&lt;/LI&gt;&lt;/OL&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would like to perform some mathematic calculations on my table:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-Calculate Amount where field3(1) = A and&amp;nbsp; Amount where field3(1) = P and then display some messages regarding the result of calculations by comparing the 2 sums.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So in my case, the calculations will be as following:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="1" cellpadding="0" cellspacing="0" style="border: none;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD style="border: solid windowtext 1.0pt; background: #B8CCE4; padding: 0 5.4pt 0 5.4pt;" valign="top" width="154"&gt;&lt;P align="center" style="margin-bottom: 0.0001pt; text-align: center;"&gt;&lt;STRONG&gt;Field3&lt;/STRONG&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD style="border: solid windowtext 1.0pt; border-left: none; background: #B8CCE4; padding: 0 5.4pt 0 5.4pt;" valign="top" width="154"&gt;&lt;P align="center" style="margin-bottom: 0.0001pt; text-align: center;"&gt;&lt;STRONG&gt;Amount&lt;/STRONG&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="border: solid windowtext 1.0pt; border-top: none; padding: 0 5.4pt 0 5.4pt;" valign="top" width="154"&gt;&lt;P align="center" style="margin-bottom: 0.0001pt; text-align: center;"&gt;A001&lt;/P&gt;&lt;/TD&gt;&lt;TD style="border-style: none solid solid none; border-bottom-color: windowtext; border-bottom-width: 1pt; border-right-color: windowtext; border-right-width: 1pt; padding: 0px 5.4pt; text-align: center;" valign="top" width="154"&gt;&lt;P align="center" style="margin-bottom: 0.0001pt; text-align: center;"&gt;-412.80499&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="border-style: none solid solid; border-right-color: windowtext; border-bottom-color: windowtext; border-left-color: windowtext; border-right-width: 1pt; border-bottom-width: 1pt; border-left-width: 1pt; padding: 0px 5.4pt; text-align: center;" valign="top" width="154"&gt;&lt;P align="center" style="margin-bottom: 0.0001pt; text-align: center;"&gt;A231&lt;/P&gt;&lt;/TD&gt;&lt;TD style="border-style: none solid solid none; border-bottom-color: windowtext; border-bottom-width: 1pt; border-right-color: windowtext; border-right-width: 1pt; padding: 0px 5.4pt; text-align: center;" valign="top" width="154"&gt;&lt;P&gt;238.49557&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="border-style: none solid solid; border-right-color: windowtext; border-bottom-color: windowtext; border-left-color: windowtext; border-right-width: 1pt; border-bottom-width: 1pt; border-left-width: 1pt; background-color: rgb(214, 227, 188); padding: 0px 5.4pt; text-align: center; background-position: initial initial; background-repeat: initial initial;" valign="top" width="154"&gt;&lt;P align="center" style="margin-bottom: 0.0001pt; text-align: center;"&gt;Sum 1&lt;/P&gt;&lt;/TD&gt;&lt;TD style="border-style: none solid solid none; border-bottom-color: windowtext; border-bottom-width: 1pt; border-right-color: windowtext; border-right-width: 1pt; background-color: rgb(214, 227, 188); padding: 0px 5.4pt; text-align: center; background-position: initial initial; background-repeat: initial initial;" valign="top" width="154"&gt;&lt;P align="center" style="margin-bottom: 0.0001pt; text-align: center;"&gt;-174,30942&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="border-style: none solid solid; border-right-color: windowtext; border-bottom-color: windowtext; border-left-color: windowtext; border-right-width: 1pt; border-bottom-width: 1pt; border-left-width: 1pt; padding: 0px 5.4pt; text-align: center;" valign="top" width="154"&gt;&lt;P align="center" style="margin-bottom: 0.0001pt; text-align: center;"&gt;P001&lt;/P&gt;&lt;/TD&gt;&lt;TD style="border-style: none solid solid none; border-bottom-color: windowtext; border-bottom-width: 1pt; border-right-color: windowtext; border-right-width: 1pt; padding: 0px 5.4pt; text-align: center;" valign="top" width="154"&gt;&lt;P&gt;2089.27519&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="border-style: none solid solid; border-right-color: windowtext; border-bottom-color: windowtext; border-left-color: windowtext; border-right-width: 1pt; border-bottom-width: 1pt; border-left-width: 1pt; padding: 0px 5.4pt; text-align: center;" valign="top" width="154"&gt;&lt;P align="center" style="margin-bottom: 0.0001pt; text-align: center;"&gt;PXXX&lt;/P&gt;&lt;/TD&gt;&lt;TD style="border-style: none solid solid none; border-bottom-color: windowtext; border-bottom-width: 1pt; border-right-color: windowtext; border-right-width: 1pt; padding: 0px 5.4pt; text-align: center;" valign="top" width="154"&gt;&lt;P&gt;0.68680&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="border-style: none solid solid; border-right-color: windowtext; border-bottom-color: windowtext; border-left-color: windowtext; border-right-width: 1pt; border-bottom-width: 1pt; border-left-width: 1pt; background-color: rgb(214, 227, 188); padding: 0px 5.4pt; text-align: center; background-position: initial initial; background-repeat: initial initial;" valign="top" width="154"&gt;&lt;P align="center" style="margin-bottom: 0.0001pt; text-align: center;"&gt;Sum 2&lt;/P&gt;&lt;/TD&gt;&lt;TD style="border-style: none solid solid none; border-bottom-color: windowtext; border-bottom-width: 1pt; border-right-color: windowtext; border-right-width: 1pt; background-color: rgb(214, 227, 188); padding: 0px 5.4pt; text-align: center; background-position: initial initial; background-repeat: initial initial;" valign="top" width="154"&gt;&lt;P align="center" style="margin-bottom: 0.0001pt; text-align: center;"&gt;2089,96199&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then I have to calculate Sum1 – Sum2 and display some messages based on the result.&lt;/P&gt;&lt;P&gt;How do you advice me to calculate the sums on my internal table?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for your support.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Amine&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 21 May 2013 13:59:58 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2013-05-21T13:59:58Z</dc:date>
    <item>
      <title>Calculate sum internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/calculate-sum-internal-table/m-p/9488320#M1745707</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;At the end of an abap program, let’s say I have the following internal table:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="1" cellpadding="0" cellspacing="0" style="border: none;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD style="border: solid windowtext 1.0pt; background: #B8CCE4; padding: 0 5.4pt 0 5.4pt;" valign="top" width="154"&gt;&lt;P align="center" style="margin-bottom: 0.0001pt; text-align: center;"&gt;&lt;STRONG&gt;Field1&lt;/STRONG&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD style="border: solid windowtext 1.0pt; border-left: none; background: #B8CCE4; padding: 0 5.4pt 0 5.4pt;" valign="top" width="154"&gt;&lt;P align="center" style="margin-bottom: 0.0001pt; text-align: center;"&gt;&lt;STRONG&gt;Field2&lt;/STRONG&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD style="border: solid windowtext 1.0pt; border-left: none; background: #B8CCE4; padding: 0 5.4pt 0 5.4pt;" valign="top" width="154"&gt;&lt;P align="center" style="margin-bottom: 0.0001pt; text-align: center;"&gt;&lt;STRONG&gt;Field3&lt;/STRONG&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD style="border: solid windowtext 1.0pt; border-left: none; background: #B8CCE4; padding: 0 5.4pt 0 5.4pt;" valign="top" width="154"&gt;&lt;P align="center" style="margin-bottom: 0.0001pt; text-align: center;"&gt;&lt;STRONG&gt;Amount&lt;/STRONG&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="border: solid windowtext 1.0pt; border-top: none; padding: 0 5.4pt 0 5.4pt;" valign="top" width="154"&gt;&lt;P align="center" style="margin-bottom: 0.0001pt; text-align: center;"&gt;TEST1&lt;/P&gt;&lt;/TD&gt;&lt;TD style="border-top: none; border-left: none; border-bottom: solid windowtext 1.0pt; border-right: solid windowtext 1.0pt; padding: 0 5.4pt 0 5.4pt;" valign="top" width="154"&gt;&lt;P align="center" style="margin-bottom: 0.0001pt; text-align: center;"&gt;22/01/2013&lt;/P&gt;&lt;/TD&gt;&lt;TD style="border-top: none; border-left: none; border-bottom: solid windowtext 1.0pt; border-right: solid windowtext 1.0pt; padding: 0 5.4pt 0 5.4pt;" valign="top" width="154"&gt;&lt;P align="center" style="margin-bottom: 0.0001pt; text-align: center;"&gt;A001&lt;/P&gt;&lt;/TD&gt;&lt;TD style="border-top: none; border-left: none; border-bottom: solid windowtext 1.0pt; border-right: solid windowtext 1.0pt; padding: 0 5.4pt 0 5.4pt;" valign="top" width="154"&gt;&lt;P align="center" style="margin-bottom: 0.0001pt; text-align: center;"&gt;-412.80499&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="border: solid windowtext 1.0pt; border-top: none; padding: 0 5.4pt 0 5.4pt;" valign="top" width="154"&gt;&lt;P align="center" style="margin-bottom: 0.0001pt; text-align: center;"&gt;TEST2&lt;/P&gt;&lt;/TD&gt;&lt;TD style="border-top: none; border-left: none; border-bottom: solid windowtext 1.0pt; border-right: solid windowtext 1.0pt; padding: 0 5.4pt 0 5.4pt;" valign="top" width="154"&gt;&lt;P align="center" style="margin-bottom: 0.0001pt; text-align: center;"&gt;15/03/2013&lt;/P&gt;&lt;/TD&gt;&lt;TD style="border-top: none; border-left: none; border-bottom: solid windowtext 1.0pt; border-right: solid windowtext 1.0pt; padding: 0 5.4pt 0 5.4pt;" valign="top" width="154"&gt;&lt;P align="center" style="margin-bottom: 0.0001pt; text-align: center;"&gt;P001&lt;/P&gt;&lt;/TD&gt;&lt;TD style="border-top: none; border-left: none; border-bottom: solid windowtext 1.0pt; border-right: solid windowtext 1.0pt; padding: 0 5.4pt 0 5.4pt;" valign="top" width="154"&gt;&lt;OL style="list-style-type: decimal;"&gt;&lt;LI&gt;2089.27519&lt;/LI&gt;&lt;/OL&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="border: solid windowtext 1.0pt; border-top: none; padding: 0 5.4pt 0 5.4pt;" valign="top" width="154"&gt;&lt;P align="center" style="margin-bottom: 0.0001pt; text-align: center;"&gt;TEST3&lt;/P&gt;&lt;/TD&gt;&lt;TD style="border-top: none; border-left: none; border-bottom: solid windowtext 1.0pt; border-right: solid windowtext 1.0pt; padding: 0 5.4pt 0 5.4pt;" valign="top" width="154"&gt;&lt;P align="center" style="margin-bottom: 0.0001pt; text-align: center;"&gt;10/02/2012&lt;/P&gt;&lt;/TD&gt;&lt;TD style="border-top: none; border-left: none; border-bottom: solid windowtext 1.0pt; border-right: solid windowtext 1.0pt; padding: 0 5.4pt 0 5.4pt;" valign="top" width="154"&gt;&lt;P align="center" style="margin-bottom: 0.0001pt; text-align: center;"&gt;A231&lt;/P&gt;&lt;/TD&gt;&lt;TD style="border-top: none; border-left: none; border-bottom: solid windowtext 1.0pt; border-right: solid windowtext 1.0pt; padding: 0 5.4pt 0 5.4pt;" valign="top" width="154"&gt;&lt;OL style="list-style-type: decimal;"&gt;&lt;LI&gt;238.49557&lt;/LI&gt;&lt;/OL&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="border: solid windowtext 1.0pt; border-top: none; padding: 0 5.4pt 0 5.4pt;" valign="top" width="154"&gt;&lt;P align="center" style="margin-bottom: 0.0001pt; text-align: center;"&gt;TEST4&lt;/P&gt;&lt;/TD&gt;&lt;TD style="border-top: none; border-left: none; border-bottom: solid windowtext 1.0pt; border-right: solid windowtext 1.0pt; padding: 0 5.4pt 0 5.4pt;" valign="top" width="154"&gt;&lt;P align="center" style="margin-bottom: 0.0001pt; text-align: center;"&gt;15/04/2013&lt;/P&gt;&lt;/TD&gt;&lt;TD style="border-top: none; border-left: none; border-bottom: solid windowtext 1.0pt; border-right: solid windowtext 1.0pt; padding: 0 5.4pt 0 5.4pt;" valign="top" width="154"&gt;&lt;P align="center" style="margin-bottom: 0.0001pt; text-align: center;"&gt;PXXX&lt;/P&gt;&lt;/TD&gt;&lt;TD style="border-top: none; border-left: none; border-bottom: solid windowtext 1.0pt; border-right: solid windowtext 1.0pt; padding: 0 5.4pt 0 5.4pt;" valign="top" width="154"&gt;&lt;OL style="list-style-type: decimal;"&gt;&lt;LI&gt;0.68680&lt;/LI&gt;&lt;/OL&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would like to perform some mathematic calculations on my table:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-Calculate Amount where field3(1) = A and&amp;nbsp; Amount where field3(1) = P and then display some messages regarding the result of calculations by comparing the 2 sums.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So in my case, the calculations will be as following:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="1" cellpadding="0" cellspacing="0" style="border: none;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD style="border: solid windowtext 1.0pt; background: #B8CCE4; padding: 0 5.4pt 0 5.4pt;" valign="top" width="154"&gt;&lt;P align="center" style="margin-bottom: 0.0001pt; text-align: center;"&gt;&lt;STRONG&gt;Field3&lt;/STRONG&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD style="border: solid windowtext 1.0pt; border-left: none; background: #B8CCE4; padding: 0 5.4pt 0 5.4pt;" valign="top" width="154"&gt;&lt;P align="center" style="margin-bottom: 0.0001pt; text-align: center;"&gt;&lt;STRONG&gt;Amount&lt;/STRONG&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="border: solid windowtext 1.0pt; border-top: none; padding: 0 5.4pt 0 5.4pt;" valign="top" width="154"&gt;&lt;P align="center" style="margin-bottom: 0.0001pt; text-align: center;"&gt;A001&lt;/P&gt;&lt;/TD&gt;&lt;TD style="border-style: none solid solid none; border-bottom-color: windowtext; border-bottom-width: 1pt; border-right-color: windowtext; border-right-width: 1pt; padding: 0px 5.4pt; text-align: center;" valign="top" width="154"&gt;&lt;P align="center" style="margin-bottom: 0.0001pt; text-align: center;"&gt;-412.80499&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="border-style: none solid solid; border-right-color: windowtext; border-bottom-color: windowtext; border-left-color: windowtext; border-right-width: 1pt; border-bottom-width: 1pt; border-left-width: 1pt; padding: 0px 5.4pt; text-align: center;" valign="top" width="154"&gt;&lt;P align="center" style="margin-bottom: 0.0001pt; text-align: center;"&gt;A231&lt;/P&gt;&lt;/TD&gt;&lt;TD style="border-style: none solid solid none; border-bottom-color: windowtext; border-bottom-width: 1pt; border-right-color: windowtext; border-right-width: 1pt; padding: 0px 5.4pt; text-align: center;" valign="top" width="154"&gt;&lt;P&gt;238.49557&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="border-style: none solid solid; border-right-color: windowtext; border-bottom-color: windowtext; border-left-color: windowtext; border-right-width: 1pt; border-bottom-width: 1pt; border-left-width: 1pt; background-color: rgb(214, 227, 188); padding: 0px 5.4pt; text-align: center; background-position: initial initial; background-repeat: initial initial;" valign="top" width="154"&gt;&lt;P align="center" style="margin-bottom: 0.0001pt; text-align: center;"&gt;Sum 1&lt;/P&gt;&lt;/TD&gt;&lt;TD style="border-style: none solid solid none; border-bottom-color: windowtext; border-bottom-width: 1pt; border-right-color: windowtext; border-right-width: 1pt; background-color: rgb(214, 227, 188); padding: 0px 5.4pt; text-align: center; background-position: initial initial; background-repeat: initial initial;" valign="top" width="154"&gt;&lt;P align="center" style="margin-bottom: 0.0001pt; text-align: center;"&gt;-174,30942&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="border-style: none solid solid; border-right-color: windowtext; border-bottom-color: windowtext; border-left-color: windowtext; border-right-width: 1pt; border-bottom-width: 1pt; border-left-width: 1pt; padding: 0px 5.4pt; text-align: center;" valign="top" width="154"&gt;&lt;P align="center" style="margin-bottom: 0.0001pt; text-align: center;"&gt;P001&lt;/P&gt;&lt;/TD&gt;&lt;TD style="border-style: none solid solid none; border-bottom-color: windowtext; border-bottom-width: 1pt; border-right-color: windowtext; border-right-width: 1pt; padding: 0px 5.4pt; text-align: center;" valign="top" width="154"&gt;&lt;P&gt;2089.27519&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="border-style: none solid solid; border-right-color: windowtext; border-bottom-color: windowtext; border-left-color: windowtext; border-right-width: 1pt; border-bottom-width: 1pt; border-left-width: 1pt; padding: 0px 5.4pt; text-align: center;" valign="top" width="154"&gt;&lt;P align="center" style="margin-bottom: 0.0001pt; text-align: center;"&gt;PXXX&lt;/P&gt;&lt;/TD&gt;&lt;TD style="border-style: none solid solid none; border-bottom-color: windowtext; border-bottom-width: 1pt; border-right-color: windowtext; border-right-width: 1pt; padding: 0px 5.4pt; text-align: center;" valign="top" width="154"&gt;&lt;P&gt;0.68680&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="border-style: none solid solid; border-right-color: windowtext; border-bottom-color: windowtext; border-left-color: windowtext; border-right-width: 1pt; border-bottom-width: 1pt; border-left-width: 1pt; background-color: rgb(214, 227, 188); padding: 0px 5.4pt; text-align: center; background-position: initial initial; background-repeat: initial initial;" valign="top" width="154"&gt;&lt;P align="center" style="margin-bottom: 0.0001pt; text-align: center;"&gt;Sum 2&lt;/P&gt;&lt;/TD&gt;&lt;TD style="border-style: none solid solid none; border-bottom-color: windowtext; border-bottom-width: 1pt; border-right-color: windowtext; border-right-width: 1pt; background-color: rgb(214, 227, 188); padding: 0px 5.4pt; text-align: center; background-position: initial initial; background-repeat: initial initial;" valign="top" width="154"&gt;&lt;P align="center" style="margin-bottom: 0.0001pt; text-align: center;"&gt;2089,96199&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then I have to calculate Sum1 – Sum2 and display some messages based on the result.&lt;/P&gt;&lt;P&gt;How do you advice me to calculate the sums on my internal table?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for your support.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Amine&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 May 2013 13:59:58 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/calculate-sum-internal-table/m-p/9488320#M1745707</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2013-05-21T13:59:58Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate sum internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/calculate-sum-internal-table/m-p/9488321#M1745708</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Below 2 proposals, but I don’t know if they are good practices or not in my case…&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN lang="EN-US" style="color: #0070c0;"&gt;Loop at ITAB into structure.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN lang="EN-US" style="color: #0070c0;"&gt;at end of structure-field3.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN lang="EN-US" style="color: #0070c0;"&gt;If structure-field3(1) = ‘A’.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN lang="EN-US" style="color: #0070c0;"&gt;sum.&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN lang="EN-US" style="color: #0070c0;"&gt;Endif.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN lang="EN-US" style="color: #0070c0;"&gt;endat.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN lang="EN-US" style="color: #0070c0;"&gt;Endloop.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN lang="EN-US" style="color: #0070c0;"&gt;LOOP at itab into structure where -field3(1) = ‘A’.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN lang="EN-US" style="color: #0070c0;"&gt;COLLECT Amount.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN lang="EN-US" style="color: #0070c0;"&gt;ENDLOOP&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN lang="EN-US" style="color: #0070c0;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;P&gt;Amine&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 May 2013 14:00:40 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/calculate-sum-internal-table/m-p/9488321#M1745708</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2013-05-21T14:00:40Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate sum internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/calculate-sum-internal-table/m-p/9488322#M1745709</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;One thing you can do is create another column(&lt;STRONG&gt;FIELD4&lt;/STRONG&gt;) in your table to store an indicator of the matching sets of rows you want to calculate. Then, it's easy to loop through them&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="1" cellpadding="0" cellspacing="0" style="border: none; font-size: 12px; background-color: #ffffff; color: #333333;"&gt;&lt;TBODY style="font-style: inherit; font-family: inherit;"&gt;&lt;TR style="border: 0px; font-style: inherit; font-family: inherit;"&gt;&lt;TD style="padding: 0 5.4pt; border: 1pt solid windowtext; font-style: inherit; font-family: inherit; background-color: #b8cce4;" valign="top" width="154"&gt;&lt;P align="center" style="margin-bottom: 0.0001pt; font-style: inherit; font-family: inherit; text-align: center;"&gt;&lt;STRONG style="font-style: inherit; font-family: inherit;"&gt;Field4&lt;/STRONG&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD style="padding: 0 5.4pt; border: 1pt solid windowtext; font-style: inherit; font-family: inherit; background-color: #b8cce4;" valign="top" width="154"&gt;&lt;P align="center" style="margin-bottom: 0.0001pt; font-style: inherit; font-family: inherit; text-align: center;"&gt;&lt;STRONG style="font-style: inherit; font-family: inherit;"&gt;Field2&lt;/STRONG&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD style="padding: 0 5.4pt; border: 1pt solid windowtext; font-style: inherit; font-family: inherit; background-color: #b8cce4;" valign="top" width="154"&gt;&lt;P align="center" style="margin-bottom: 0.0001pt; font-style: inherit; font-family: inherit; text-align: center;"&gt;&lt;STRONG style="font-style: inherit; font-family: inherit;"&gt;Field3&lt;/STRONG&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD style="padding: 0 5.4pt; border: 1pt solid windowtext; font-style: inherit; font-family: inherit; background-color: #b8cce4;" valign="top" width="154"&gt;&lt;P align="center" style="margin-bottom: 0.0001pt; font-style: inherit; font-family: inherit; text-align: center;"&gt;&lt;STRONG style="font-style: inherit; font-family: inherit;"&gt;Amount&lt;/STRONG&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR style="border: 0px; font-style: inherit; font-family: inherit;"&gt;&lt;TD style="padding: 0 5.4pt; border: 1pt solid windowtext; font-style: inherit; font-family: inherit;" valign="top" width="154"&gt;&lt;P align="center" style="margin-bottom: 0.0001pt; font-style: inherit; font-family: inherit; text-align: center;"&gt;A&lt;/P&gt;&lt;/TD&gt;&lt;TD style="padding: 0 5.4pt; border-right-width: 1pt; border-bottom-width: 1pt; border-style: none solid solid none; border-right-color: windowtext; border-bottom-color: windowtext; font-style: inherit; font-family: inherit;" valign="top" width="154"&gt;&lt;P align="center" style="margin-bottom: 0.0001pt; font-style: inherit; font-family: inherit; text-align: center;"&gt;22/01/2013&lt;/P&gt;&lt;/TD&gt;&lt;TD style="padding: 0 5.4pt; border-right-width: 1pt; border-bottom-width: 1pt; border-style: none solid solid none; border-right-color: windowtext; border-bottom-color: windowtext; font-style: inherit; font-family: inherit;" valign="top" width="154"&gt;&lt;P align="center" style="margin-bottom: 0.0001pt; font-style: inherit; font-family: inherit; text-align: center;"&gt;A001&lt;/P&gt;&lt;/TD&gt;&lt;TD style="padding: 0 5.4pt; border-right-width: 1pt; border-bottom-width: 1pt; border-style: none solid solid none; border-right-color: windowtext; border-bottom-color: windowtext; font-style: inherit; font-family: inherit;" valign="top" width="154"&gt;&lt;P align="center" style="margin-bottom: 0.0001pt; font-style: inherit; font-family: inherit; text-align: center;"&gt;-412.80499&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR style="border: 0px; font-style: inherit; font-family: inherit;"&gt;&lt;TD style="padding: 0 5.4pt; border: 1pt solid windowtext; font-style: inherit; font-family: inherit;" valign="top" width="154"&gt;&lt;P align="center" style="margin-bottom: 0.0001pt; font-style: inherit; font-family: inherit; text-align: center;"&gt;P&lt;/P&gt;&lt;/TD&gt;&lt;TD style="padding: 0 5.4pt; border-right-width: 1pt; border-bottom-width: 1pt; border-style: none solid solid none; border-right-color: windowtext; border-bottom-color: windowtext; font-style: inherit; font-family: inherit;" valign="top" width="154"&gt;&lt;P align="center" style="margin-bottom: 0.0001pt; font-style: inherit; font-family: inherit; text-align: center;"&gt;15/03/2013&lt;/P&gt;&lt;/TD&gt;&lt;TD style="padding: 0 5.4pt; border-right-width: 1pt; border-bottom-width: 1pt; border-style: none solid solid none; border-right-color: windowtext; border-bottom-color: windowtext; font-style: inherit; font-family: inherit;" valign="top" width="154"&gt;&lt;P align="center" style="margin-bottom: 0.0001pt; font-style: inherit; font-family: inherit; text-align: center;"&gt;P001&lt;/P&gt;&lt;/TD&gt;&lt;TD style="padding: 0 5.4pt; border-right-width: 1pt; border-bottom-width: 1pt; border-style: none solid solid none; border-right-color: windowtext; border-bottom-color: windowtext; font-style: inherit; font-family: inherit;" valign="top" width="154"&gt;&lt;OL style="padding: 0 0 0 2em; font-style: inherit; font-family: inherit; list-style-position: initial; list-style-image: initial;"&gt;&lt;LI&gt;2089.27519&lt;/LI&gt;&lt;/OL&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR style="border: 0px; font-style: inherit; font-family: inherit;"&gt;&lt;TD style="padding: 0 5.4pt; border: 1pt solid windowtext; font-style: inherit; font-family: inherit;" valign="top" width="154"&gt;&lt;SPAN align="center" style="margin-bottom: 0.0001pt; font-style: inherit; font-family: inherit; text-align: center;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; A&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD style="padding: 0 5.4pt; border-right-width: 1pt; border-bottom-width: 1pt; border-style: none solid solid none; border-right-color: windowtext; border-bottom-color: windowtext; font-style: inherit; font-family: inherit;" valign="top" width="154"&gt;&lt;SPAN align="center" style="margin-bottom: 0.0001pt; font-style: inherit; font-family: inherit; text-align: center;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 10/02/2012&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD style="padding: 0 5.4pt; border-right-width: 1pt; border-bottom-width: 1pt; border-style: none solid solid none; border-right-color: windowtext; border-bottom-color: windowtext; font-style: inherit; font-family: inherit;" valign="top" width="154"&gt;&lt;SPAN align="center" style="margin-bottom: 0.0001pt; font-style: inherit; font-family: inherit; text-align: center;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; A231&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD style="padding: 0 5.4pt; border-right-width: 1pt; border-bottom-width: 1pt; border-style: none solid solid none; border-right-color: windowtext; border-bottom-color: windowtext; font-style: inherit; font-family: inherit;" valign="top" width="154"&gt;&lt;OL style="padding: 0 0 0 2em; font-style: inherit; font-family: inherit; list-style-position: initial; list-style-image: initial;"&gt;&lt;LI&gt;238.49557&lt;/LI&gt;&lt;/OL&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR style="border: 0px; font-style: inherit; font-family: inherit;"&gt;&lt;TD style="padding: 0 5.4pt; border: 1pt solid windowtext; font-style: inherit; font-family: inherit;" valign="top" width="154"&gt;&lt;SPAN align="center" style="margin-bottom: 0.0001pt; font-style: inherit; font-family: inherit; text-align: center;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; P&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD style="padding: 0 5.4pt; border-right-width: 1pt; border-bottom-width: 1pt; border-style: none solid solid none; border-right-color: windowtext; border-bottom-color: windowtext; font-style: inherit; font-family: inherit;" valign="top" width="154"&gt;&lt;SPAN align="center" style="margin-bottom: 0.0001pt; font-style: inherit; font-family: inherit; text-align: center;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 15/04/2013&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD style="padding: 0 5.4pt; border-right-width: 1pt; border-bottom-width: 1pt; border-style: none solid solid none; border-right-color: windowtext; border-bottom-color: windowtext; font-style: inherit; font-family: inherit;" valign="top" width="154"&gt;&lt;SPAN align="center" style="margin-bottom: 0.0001pt; font-style: inherit; font-family: inherit; text-align: center;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; PXXX&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD style="padding: 0 5.4pt; border-right-width: 1pt; border-bottom-width: 1pt; border-style: none solid solid none; border-right-color: windowtext; border-bottom-color: windowtext; font-style: inherit; font-family: inherit;" valign="top" width="154"&gt;&lt;OL style="padding: 0 0 0 2em; font-style: inherit; font-family: inherit; list-style-position: initial; list-style-image: initial;"&gt;&lt;LI&gt;0.68680&lt;/LI&gt;&lt;/OL&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I wouldn't subtotal inside your internal table. Loop through it and subtotal out into another table or onto whatever your output is going to be.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 May 2013 14:09:50 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/calculate-sum-internal-table/m-p/9488322#M1745709</guid>
      <dc:creator>robphelan</dc:creator>
      <dc:date>2013-05-21T14:09:50Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate sum internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/calculate-sum-internal-table/m-p/9488323#M1745710</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="font-size: 12.222222328186035px; background-color: #ffffff; color: #333333;"&gt;&lt;SPAN lang="EN-US" style="font-style: inherit; font-family: inherit; color: #0070c0;"&gt;Loop at ITAB into structure.&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 12.222222328186035px; background-color: #ffffff; color: #333333;"&gt;&lt;SPAN lang="EN-US" style="font-style: inherit; font-family: inherit; color: #0070c0;"&gt;at end of structure-field3.&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 12.222222328186035px; background-color: #ffffff; color: #333333;"&gt;&lt;SPAN lang="EN-US" style="font-style: inherit; font-family: inherit; color: #0070c0;"&gt;If structure-field3(1) = ‘A’.&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 12.222222328186035px; background-color: #ffffff; color: #333333;"&gt;&lt;SPAN lang="EN-US" style="font-style: inherit; font-family: inherit; color: #0070c0;"&gt;sum. &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 12.222222328186035px; background-color: #ffffff; color: #333333;"&gt;&lt;SPAN lang="EN-US" style="font-style: inherit; font-family: inherit; color: #0070c0;"&gt;Endif.&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 12.222222328186035px; background-color: #ffffff; color: #333333;"&gt;&lt;SPAN lang="EN-US" style="font-style: inherit; font-family: inherit; color: #0070c0;"&gt;endat.&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 12.222222328186035px; background-color: #ffffff; color: #333333;"&gt;&lt;SPAN lang="EN-US" style="font-style: inherit; font-family: inherit; color: #0070c0;"&gt;Endloop.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 12.222222328186035px; background-color: #ffffff; color: #333333;"&gt;&lt;SPAN lang="EN-US" style="font-style: inherit; font-family: inherit; color: #0070c0;"&gt;first option is better one..Collect statement is absolute don't use it.&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 May 2013 14:13:26 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/calculate-sum-internal-table/m-p/9488323#M1745710</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2013-05-21T14:13:26Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate sum internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/calculate-sum-internal-table/m-p/9488324#M1745711</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Amine,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. Sort the ITAB on Field3 before loop.&lt;/P&gt;&lt;P&gt;2. I guess, the LOOP -ENDLOOP code u wriiten works well, but not give the desired output u mention above.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;TABLE border="1" cellpadding="0" cellspacing="0"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD style="padding-left: 5.4pt; padding-right: 5.4pt; background: #b8cce4; border: windowtext 1pt solid;" valign="top" width="154"&gt;&lt;P align="center" style="text-align: center;"&gt;&lt;STRONG&gt;Field3&lt;/STRONG&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD style="padding-left: 5.4pt; padding-right: 5.4pt; background: #b8cce4; border: windowtext 1pt solid;" valign="top" width="154"&gt;&lt;P align="center" style="text-align: center;"&gt;&lt;STRONG&gt;Amount&lt;/STRONG&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding-left: 5.4pt; padding-right: 5.4pt; border: windowtext 1pt solid;" valign="top" width="154"&gt;&lt;P align="center" style="text-align: center;"&gt;A001&lt;/P&gt;&lt;/TD&gt;&lt;TD style="border-bottom: windowtext 1pt solid; text-align: center; border-left: medium none; padding-left: 5.4pt; padding-right: 5.4pt; border-top: medium none; border-right: windowtext 1pt solid;" valign="top" width="154"&gt;&lt;P align="center" style="text-align: center;"&gt;-412.80499&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="border-bottom: windowtext 1pt solid; text-align: center; border-left: windowtext 1pt solid; padding-left: 5.4pt; padding-right: 5.4pt; border-top: medium none; border-right: windowtext 1pt solid;" valign="top" width="154"&gt;&lt;P align="center" style="text-align: center;"&gt;A231&lt;/P&gt;&lt;/TD&gt;&lt;TD style="border-bottom: windowtext 1pt solid; text-align: center; border-left: medium none; padding-left: 5.4pt; padding-right: 5.4pt; border-top: medium none; border-right: windowtext 1pt solid;" valign="top" width="154"&gt;&lt;P&gt;238.49557&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="border-bottom: windowtext 1pt solid; text-align: center; border-left: windowtext 1pt solid; background-color: #d6e3bc; padding-left: 5.4pt; padding-right: 5.4pt; border-top: medium none; border-right: windowtext 1pt solid;" valign="top" width="154"&gt;&lt;P align="center" style="text-align: center;"&gt;Sum 1&lt;/P&gt;&lt;/TD&gt;&lt;TD style="border-bottom: windowtext 1pt solid; text-align: center; border-left: medium none; background-color: #d6e3bc; padding-left: 5.4pt; padding-right: 5.4pt; border-top: medium none; border-right: windowtext 1pt solid;" valign="top" width="154"&gt;&lt;P align="center" style="text-align: center;"&gt;-174,30942&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="border-bottom: windowtext 1pt solid; text-align: center; border-left: windowtext 1pt solid; padding-left: 5.4pt; padding-right: 5.4pt; border-top: medium none; border-right: windowtext 1pt solid;" valign="top" width="154"&gt;&lt;P align="center" style="text-align: center;"&gt;P001&lt;/P&gt;&lt;/TD&gt;&lt;TD style="border-bottom: windowtext 1pt solid; text-align: center; border-left: medium none; padding-left: 5.4pt; padding-right: 5.4pt; border-top: medium none; border-right: windowtext 1pt solid;" valign="top" width="154"&gt;&lt;P&gt;2089.27519&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="border-bottom: windowtext 1pt solid; text-align: center; border-left: windowtext 1pt solid; padding-left: 5.4pt; padding-right: 5.4pt; border-top: medium none; border-right: windowtext 1pt solid;" valign="top" width="154"&gt;&lt;P align="center" style="text-align: center;"&gt;PXXX&lt;/P&gt;&lt;/TD&gt;&lt;TD style="border-bottom: windowtext 1pt solid; text-align: center; border-left: medium none; padding-left: 5.4pt; padding-right: 5.4pt; border-top: medium none; border-right: windowtext 1pt solid;" valign="top" width="154"&gt;&lt;P&gt;0.68680&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="border-bottom: windowtext 1pt solid; text-align: center; border-left: windowtext 1pt solid; background-color: #d6e3bc; padding-left: 5.4pt; padding-right: 5.4pt; border-top: medium none; border-right: windowtext 1pt solid;" valign="top" width="154"&gt;&lt;P align="center" style="text-align: center;"&gt;Sum 2&lt;/P&gt;&lt;/TD&gt;&lt;TD style="border-bottom: windowtext 1pt solid; text-align: center; border-left: medium none; background-color: #d6e3bc; padding-left: 5.4pt; padding-right: 5.4pt; border-top: medium none; border-right: windowtext 1pt solid;" valign="top" width="154"&gt;&lt;P align="center" style="text-align: center;"&gt;2089,96199&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;the&amp;nbsp; sum amount will be added and displayed against the end of FIELD3, but another row of sum 1 is not added.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;3. please let know whether field3 will hav values only starting with A and P?&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;Azhar&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 May 2013 14:27:43 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/calculate-sum-internal-table/m-p/9488324#M1745711</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2013-05-21T14:27:43Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate sum internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/calculate-sum-internal-table/m-p/9488325#M1745712</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;Below logic may be useful in your case..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;types: begin of itype,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; field1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; type string,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; field2&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; type datum,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; field3(5) type C, "make sure field3 is of type c for alphabetic sorting.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; field4&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; type wogxxx,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; end of itype.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data : itab type table of itype,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; amt_A type wogxxx,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; amt_P type wogxxx,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; tot&amp;nbsp;&amp;nbsp; type wogxxx.&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;field-symbol: &amp;lt;fs&amp;gt; type itype.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;......fill itab table with all data..&lt;/P&gt;&lt;P&gt;.....then follow below logic for summation..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; sort itab BY field3 AS TEXT. " this will group data alphabetically&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; loop at itab assigning &amp;lt;fs&amp;gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if &amp;lt;fs&amp;gt;-field3(1) = 'A'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; amt_A = amt_A + &amp;lt;fs&amp;gt;-field4.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; elseif &amp;lt;fs&amp;gt;-field3(1) = 'P'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; amt_P = amt_P + &amp;lt;fs&amp;gt;-field4.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; tot = amt_A - amt_P.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Nandi.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 May 2013 14:33:06 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/calculate-sum-internal-table/m-p/9488325#M1745712</guid>
      <dc:creator>former_member197425</dc:creator>
      <dc:date>2013-05-21T14:33:06Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate sum internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/calculate-sum-internal-table/m-p/9488326#M1745713</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ok thanks guys.&lt;/P&gt;&lt;P&gt;And how can i do to use the obtained sums A and P in my program:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="1" cellpadding="0" cellspacing="0" style="border: none; font-size: 12px; background-color: #ffffff; color: #333333;"&gt;&lt;TBODY style="font-style: inherit; font-family: inherit;"&gt;&lt;TR style="border: 0px; font-style: inherit; font-family: inherit;"&gt;&lt;TD style="padding: 0 5.4pt; border: 1pt solid windowtext; font-style: inherit; font-family: inherit; background-color: #b8cce4;" valign="top" width="154"&gt;&lt;P align="center" style="margin-bottom: 0.0001pt; font-style: inherit; font-family: inherit; text-align: center;"&gt;&lt;STRONG style="font-style: inherit; font-family: inherit;"&gt;Field3&lt;/STRONG&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD style="padding: 0 5.4pt; border: 1pt solid windowtext; font-style: inherit; font-family: inherit; background-color: #b8cce4;" valign="top" width="154"&gt;&lt;P align="center" style="margin-bottom: 0.0001pt; font-style: inherit; font-family: inherit; text-align: center;"&gt;&lt;STRONG style="font-style: inherit; font-family: inherit;"&gt;Amount&lt;/STRONG&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR style="border: 0px; font-style: inherit; font-family: inherit;"&gt;&lt;TD style="padding: 0 5.4pt; border: 1pt solid windowtext; font-style: inherit; font-family: inherit;" valign="top" width="154"&gt;&lt;P align="center" style="margin-bottom: 0.0001pt; font-style: inherit; font-family: inherit; text-align: center;"&gt;A001&lt;/P&gt;&lt;/TD&gt;&lt;TD style="padding: 0 5.4pt; border-right-width: 1pt; border-bottom-width: 1pt; border-style: none solid solid none; border-right-color: windowtext; border-bottom-color: windowtext; font-style: inherit; font-family: inherit; text-align: center;" valign="top" width="154"&gt;&lt;P align="center" style="margin-bottom: 0.0001pt; font-style: inherit; font-family: inherit;"&gt;-412.80499&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR style="border: 0px; font-style: inherit; font-family: inherit;"&gt;&lt;TD style="padding: 0 5.4pt; border-right-width: 1pt; border-bottom-width: 1pt; border-left-width: 1pt; border-style: none solid solid; border-right-color: windowtext; border-bottom-color: windowtext; border-left-color: windowtext; font-style: inherit; font-family: inherit; text-align: center;" valign="top" width="154"&gt;&lt;P align="center" style="margin-bottom: 0.0001pt; font-style: inherit; font-family: inherit;"&gt;A231&lt;/P&gt;&lt;/TD&gt;&lt;TD style="padding: 0 5.4pt; border-right-width: 1pt; border-bottom-width: 1pt; border-style: none solid solid none; border-right-color: windowtext; border-bottom-color: windowtext; font-style: inherit; font-family: inherit; text-align: center;" valign="top" width="154"&gt;&lt;P style="font-style: inherit; font-family: inherit;"&gt;238.49557&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR style="border: 0px; font-style: inherit; font-family: inherit;"&gt;&lt;TD style="padding: 0 5.4pt; border-right-width: 1pt; border-bottom-width: 1pt; border-left-width: 1pt; border-style: none solid solid; border-right-color: windowtext; border-bottom-color: windowtext; border-left-color: windowtext; font-style: inherit; font-family: inherit; text-align: center; background-color: #d6e3bc;" valign="top" width="154"&gt;&lt;P align="center" style="margin-bottom: 0.0001pt; font-style: inherit; font-family: inherit;"&gt;Sum 1&lt;/P&gt;&lt;/TD&gt;&lt;TD style="padding: 0 5.4pt; border-right-width: 1pt; border-bottom-width: 1pt; border-style: none solid solid none; border-right-color: windowtext; border-bottom-color: windowtext; font-style: inherit; font-family: inherit; text-align: center; background-color: #d6e3bc;" valign="top" width="154"&gt;&lt;P align="center" style="margin-bottom: 0.0001pt; font-style: inherit; font-family: inherit;"&gt;-174,30942&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR style="border: 0px; font-style: inherit; font-family: inherit;"&gt;&lt;TD style="padding: 0 5.4pt; border-right-width: 1pt; border-bottom-width: 1pt; border-left-width: 1pt; border-style: none solid solid; border-right-color: windowtext; border-bottom-color: windowtext; border-left-color: windowtext; font-style: inherit; font-family: inherit; text-align: center;" valign="top" width="154"&gt;&lt;P align="center" style="margin-bottom: 0.0001pt; font-style: inherit; font-family: inherit;"&gt;P001&lt;/P&gt;&lt;/TD&gt;&lt;TD style="padding: 0 5.4pt; border-right-width: 1pt; border-bottom-width: 1pt; border-style: none solid solid none; border-right-color: windowtext; border-bottom-color: windowtext; font-style: inherit; font-family: inherit; text-align: center;" valign="top" width="154"&gt;&lt;P style="font-style: inherit; font-family: inherit;"&gt;2089.27519&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR style="border: 0px; font-style: inherit; font-family: inherit;"&gt;&lt;TD style="padding: 0 5.4pt; border-right-width: 1pt; border-bottom-width: 1pt; border-left-width: 1pt; border-style: none solid solid; border-right-color: windowtext; border-bottom-color: windowtext; border-left-color: windowtext; font-style: inherit; font-family: inherit; text-align: center;" valign="top" width="154"&gt;&lt;P align="center" style="margin-bottom: 0.0001pt; font-style: inherit; font-family: inherit;"&gt;PXXX&lt;/P&gt;&lt;/TD&gt;&lt;TD style="padding: 0 5.4pt; border-right-width: 1pt; border-bottom-width: 1pt; border-style: none solid solid none; border-right-color: windowtext; border-bottom-color: windowtext; font-style: inherit; font-family: inherit; text-align: center;" valign="top" width="154"&gt;&lt;P style="font-style: inherit; font-family: inherit;"&gt;0.68680&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR style="border: 0px; font-style: inherit; font-family: inherit;"&gt;&lt;TD style="padding: 0 5.4pt; border-right-width: 1pt; border-bottom-width: 1pt; border-left-width: 1pt; border-style: none solid solid; border-right-color: windowtext; border-bottom-color: windowtext; border-left-color: windowtext; font-style: inherit; font-family: inherit; text-align: center; background-color: #d6e3bc;" valign="top" width="154"&gt;&lt;P align="center" style="margin-bottom: 0.0001pt; font-style: inherit; font-family: inherit;"&gt;Sum 2&lt;/P&gt;&lt;/TD&gt;&lt;TD style="padding: 0 5.4pt; border-right-width: 1pt; border-bottom-width: 1pt; border-style: none solid solid none; border-right-color: windowtext; border-bottom-color: windowtext; font-style: inherit; font-family: inherit; text-align: center; background-color: #d6e3bc;" valign="top" width="154"&gt;&lt;P align="center" style="margin-bottom: 0.0001pt; font-style: inherit; font-family: inherit;"&gt;2089,96199&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Actually, i want to calculate Sum1 and Sum2 internally in my program and then use them to display some messages as following:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SUM = Sum1+Sum2&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If SUM = 0.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; write:'XXXX'&lt;/P&gt;&lt;P&gt;elseif SUM &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; write :'YYYY'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Amine&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 May 2013 14:35:23 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/calculate-sum-internal-table/m-p/9488326#M1745713</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2013-05-21T14:35:23Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate sum internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/calculate-sum-internal-table/m-p/9488327#M1745714</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Nandi.&lt;/P&gt;&lt;P&gt;I like this logic, i will test it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Amine&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 May 2013 14:37:06 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/calculate-sum-internal-table/m-p/9488327#M1745714</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2013-05-21T14:37:06Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate sum internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/calculate-sum-internal-table/m-p/9488328#M1745715</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Azhar,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I confim that field3 will have only values starting with either A or P.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Amine&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 May 2013 15:21:11 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/calculate-sum-internal-table/m-p/9488328#M1745715</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2013-05-21T15:21:11Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate sum internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/calculate-sum-internal-table/m-p/9488329#M1745716</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;If you are trying to find the SUM of A's - SUM of P's, then you can use a single variable SUM to maintain.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;the code snippet looks like this..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: sum type wogxxx.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sum = 0.&lt;/P&gt;&lt;P&gt;loop at ITAB assigning &amp;lt;FS&amp;gt;.&lt;/P&gt;&lt;P&gt;if &amp;lt;fs&amp;gt;-field3(1) = 'A'.&lt;/P&gt;&lt;P&gt;sum = sum + &amp;lt;fs&amp;gt;-field4.&lt;/P&gt;&lt;P&gt;elseif &amp;lt;fs&amp;gt;-field3(1) = 'P'.&lt;/P&gt;&lt;P&gt;sum = sum - &amp;lt;fs&amp;gt;-field4.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if sum = 0.&lt;/P&gt;&lt;P&gt;write: 'sum is zero'.&lt;/P&gt;&lt;P&gt;else.&lt;/P&gt;&lt;P&gt;write: 'sum is non zero'.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Regards,&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Karthik&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 May 2013 15:42:49 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/calculate-sum-internal-table/m-p/9488329#M1745716</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2013-05-21T15:42:49Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate sum internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/calculate-sum-internal-table/m-p/9488330#M1745717</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Karthik,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And what about if i want to show the diffeence between the sum of A and the Sum of P.&lt;/P&gt;&lt;P&gt;Let's say:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sum A = 100&lt;/P&gt;&lt;P&gt;Sum P = 150&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Difference = SUM A - SUM P&lt;/P&gt;&lt;P&gt;Difference = 100 - 150&lt;/P&gt;&lt;P&gt;Difference = (-50)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Amine&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 May 2013 16:01:16 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/calculate-sum-internal-table/m-p/9488330#M1745717</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2013-05-21T16:01:16Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate sum internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/calculate-sum-internal-table/m-p/9488331#M1745718</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Amine&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;First option is better i think&lt;SPAN __jive_emoticon_name="happy" __jive_macro_name="emoticon" class="jive_macro jive_macro_emoticon jive_emote" src="https://community.sap.com/1474/images/emoticons/happy.gif"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 12px; background-color: #ffffff; color: #333333;"&gt;&lt;SPAN lang="EN-US" style="font-style: inherit; font-family: inherit; color: #0070c0;"&gt;Loop at ITAB into structure.&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 12px; background-color: #ffffff; color: #333333;"&gt;&lt;SPAN lang="EN-US" style="font-style: inherit; font-family: inherit; color: #0070c0;"&gt;at end of structure-field3.&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 12px; background-color: #ffffff; color: #333333;"&gt;&lt;SPAN lang="EN-US" style="font-style: inherit; font-family: inherit; color: #0070c0;"&gt;If structure-field3(1) = ‘A’.&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 12px; background-color: #ffffff; color: #333333;"&gt;&lt;SPAN lang="EN-US" style="font-style: inherit; font-family: inherit; color: #0070c0;"&gt;sum. &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 12px; background-color: #ffffff; color: #333333;"&gt;&lt;SPAN lang="EN-US" style="font-style: inherit; font-family: inherit; color: #0070c0;"&gt;Endif.&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 12px; background-color: #ffffff; color: #333333;"&gt;&lt;SPAN lang="EN-US" style="font-style: inherit; font-family: inherit; color: #0070c0;"&gt;endat.&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 12px; background-color: #ffffff; color: #333333;"&gt;&lt;SPAN lang="EN-US" style="font-style: inherit; font-family: inherit; color: #0070c0;"&gt;Endloop.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&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;Bastin.G&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 May 2013 16:17:38 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/calculate-sum-internal-table/m-p/9488331#M1745718</guid>
      <dc:creator>bastinvinoth</dc:creator>
      <dc:date>2013-05-21T16:17:38Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate sum internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/calculate-sum-internal-table/m-p/9488332#M1745719</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi &lt;SPAN style="font-size: 11px; background-color: #ffffff; color: #333333;"&gt;&lt;STRONG&gt;&lt;A _jive_internal="true" class="jiveTT-hover-user jive-username-link" href="https://answers.sap.com/people/amine.lamkaissi" id="jive-6120045792602459838167" style="padding: 0 3px 0 0; font-weight: inherit; font-style: inherit; font-size: 1.1em; font-family: inherit; color: #3778c7;"&gt;amine lamkaissi&lt;/A&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 11px; background-color: #ffffff; color: #333333;"&gt;&lt;STRONG&gt;By the By ,your way of presenting the question in forum always good &lt;SPAN __jive_emoticon_name="happy" __jive_macro_name="emoticon" class="jive_macro jive_emote" src="https://community.sap.com/1474/images/emoticons/happy.gif"&gt;&lt;/SPAN&gt;&amp;nbsp; &lt;SPAN __jive_emoticon_name="cool" __jive_macro_name="emoticon" class="jive_macro jive_macro_emoticon jive_emote" src="https://community.sap.com/1474/images/emoticons/cool.gif"&gt;&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 11px; background-color: #ffffff; color: #333333;"&gt;&lt;STRONG&gt;i like it&lt;SPAN __jive_emoticon_name="happy" __jive_macro_name="emoticon" class="jive_macro jive_emote jiveImage" src="https://community.sap.com/1474/images/emoticons/happy.gif"&gt;&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 11px; background-color: #ffffff; color: #333333;"&gt;&lt;STRONG&gt;&lt;SPAN __jive_emoticon_name="wink" __jive_macro_name="emoticon" class="jive_macro jive_emote jiveImage" src="https://community.sap.com/1474/images/emoticons/wink.gif"&gt;&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 11px; background-color: #ffffff; color: #333333;"&gt;&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 May 2013 16:23:46 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/calculate-sum-internal-table/m-p/9488332#M1745719</guid>
      <dc:creator>bastinvinoth</dc:creator>
      <dc:date>2013-05-21T16:23:46Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate sum internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/calculate-sum-internal-table/m-p/9488333#M1745720</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Bastin &lt;SPAN __jive_emoticon_name="happy" __jive_macro_name="emoticon" class="jive_macro jive_emote" src="https://community.sap.com/1474/images/emoticons/happy.gif"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Amine&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 May 2013 16:27:12 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/calculate-sum-internal-table/m-p/9488333#M1745720</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2013-05-21T16:27:12Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate sum internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/calculate-sum-internal-table/m-p/9488334#M1745721</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Amine,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;the below is the simple logic that i built..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at itab into wa_itab.&lt;BR /&gt;&amp;nbsp; if wa_itab-field3+0(1) = 'A'.&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; sum_a = sum_a + wa_itab-field4.&lt;BR /&gt;&amp;nbsp; elseif wa_itab-field3+0(1) = 'P'.&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; sum_p = sum_p + wa_itab+field4&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR /&gt;endloop.&lt;/P&gt;&lt;P&gt;sum_diff = sum_a - sum_p.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if sum_diff = 0.&lt;BR /&gt;&amp;nbsp; write:/ "difference is zero".&lt;BR /&gt;else.&lt;BR /&gt;&amp;nbsp; write:/ "difference is", sum_diff.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;hope&amp;nbsp; this would do the business that u need. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Azhar&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&amp;nbsp; &lt;BR /&gt;endif.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 May 2013 16:27:58 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/calculate-sum-internal-table/m-p/9488334#M1745721</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2013-05-21T16:27:58Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate sum internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/calculate-sum-internal-table/m-p/9488335#M1745722</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Azhar,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In fact it's very simple and efficient &lt;SPAN __jive_emoticon_name="happy" __jive_macro_name="emoticon" class="jive_macro jive_emote" src="https://community.sap.com/1474/images/emoticons/happy.gif"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Amine&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 May 2013 17:23:40 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/calculate-sum-internal-table/m-p/9488335#M1745722</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2013-05-21T17:23:40Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate sum internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/calculate-sum-internal-table/m-p/9488336#M1745723</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi, &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; This logic may help you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;sum&lt;/STRONG&gt; = 0&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at itab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if itab-field3+0(1) eq&amp;nbsp; 'A'.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;sum&lt;/STRONG&gt; = &lt;STRONG&gt;sum&lt;/STRONG&gt; + itab-amount.&lt;/P&gt;&lt;P&gt;elseif itab-field3+0(1) eq&amp;nbsp; 'P'.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;sum&lt;/STRONG&gt; = &lt;STRONG&gt;sum&lt;/STRONG&gt; - itab-amount.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if &lt;STRONG&gt;sum&lt;/STRONG&gt; eq 0.&lt;/P&gt;&lt;P&gt;write / 'sum is zero'.&lt;/P&gt;&lt;P&gt;else.&lt;/P&gt;&lt;P&gt;write / 'sum is non zero'.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;* if u want to display [ sum A - sum P]&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if &lt;STRONG&gt;sum&lt;/STRONG&gt; ne 0&lt;/P&gt;&lt;P&gt;write &lt;span class="lia-unicode-emoji" title=":confused_face:"&gt;😕&lt;/span&gt; 'Difference of sumA and sumP is :' ,&lt;STRONG&gt;sum&lt;/STRONG&gt;.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 May 2013 18:50:35 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/calculate-sum-internal-table/m-p/9488336#M1745723</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2013-05-21T18:50:35Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate sum internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/calculate-sum-internal-table/m-p/9488337#M1745724</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi amine,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would do just like &lt;SPAN style="color: #333333; font-size: 12px; background-color: #ffffff;"&gt;Azhar&lt;/SPAN&gt; proposes, but instead of a new loop, can't you add this to the processing where you build your internal table? Avoiding an unnecessary loop is always good &lt;SPAN __jive_emoticon_name="wink" __jive_macro_name="emoticon" class="jive_macro jive_emote" src="https://community.sap.com/1474/images/emoticons/wink.gif"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers,&lt;/P&gt;&lt;P&gt;Custodio&lt;/P&gt;&lt;P&gt;@zcust01&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 May 2013 01:34:51 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/calculate-sum-internal-table/m-p/9488337#M1745724</guid>
      <dc:creator>custodio_deoliveira</dc:creator>
      <dc:date>2013-05-22T01:34:51Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate sum internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/calculate-sum-internal-table/m-p/9488338#M1745725</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Amine,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Try this code&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="L0S52"&gt;DATA&lt;/SPAN&gt;&lt;SPAN class="L0S55"&gt;: &lt;/SPAN&gt;lv_total_a &lt;SPAN class="L0S52"&gt;TYPE &lt;/SPAN&gt;&lt;SPAN class="L0S52"&gt;i&lt;/SPAN&gt;&lt;SPAN class="L0S55"&gt;,&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN class="L0S31"&gt;" Holds sum of field3 starting with 'A'&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; lv_total_p &lt;SPAN class="L0S52"&gt;TYPE &lt;/SPAN&gt;&lt;SPAN class="L0S52"&gt;i&lt;/SPAN&gt;&lt;SPAN class="L0S55"&gt;,&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN class="L0S31"&gt;" Holds sum of field3 starting with 'P'&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; lv_sum&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="L0S52"&gt;TYPE &lt;/SPAN&gt;&lt;SPAN class="L0S52"&gt;i&lt;/SPAN&gt;&lt;SPAN class="L0S55"&gt;.&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN class="L0S31"&gt;" Holds total sum&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; &lt;SPAN class="L0S52"&gt;LOOP &lt;/SPAN&gt;&lt;SPAN class="L0S52"&gt;AT &lt;/SPAN&gt;itab &lt;SPAN class="L0S52"&gt;INTO &lt;/SPAN&gt;wa&lt;SPAN class="L0S55"&gt;.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN class="L0S52"&gt;IF &lt;/SPAN&gt;wa&lt;SPAN class="L0S70"&gt;-&lt;/SPAN&gt;field3&lt;SPAN class="L0S55"&gt;(&lt;/SPAN&gt;&lt;SPAN class="L0S32"&gt;1&lt;/SPAN&gt;&lt;SPAN class="L0S55"&gt;) &lt;/SPAN&gt;&lt;SPAN class="L0S55"&gt;= &lt;/SPAN&gt;&lt;SPAN class="L0S33"&gt;'A'&lt;/SPAN&gt;&lt;SPAN class="L0S55"&gt;.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="L0S52"&gt;ADD &lt;/SPAN&gt;wa&lt;SPAN class="L0S70"&gt;-&lt;/SPAN&gt;amount &lt;SPAN class="L0S52"&gt;TO &lt;/SPAN&gt;lv_total_a&lt;SPAN class="L0S55"&gt;.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN class="L0S52"&gt;ELSEIF &lt;/SPAN&gt;wa&lt;SPAN class="L0S70"&gt;-&lt;/SPAN&gt;field3&lt;SPAN class="L0S55"&gt;(&lt;/SPAN&gt;&lt;SPAN class="L0S32"&gt;1&lt;/SPAN&gt;&lt;SPAN class="L0S55"&gt;) &lt;/SPAN&gt;&lt;SPAN class="L0S55"&gt;= &lt;/SPAN&gt;&lt;SPAN class="L0S33"&gt;'P'&lt;/SPAN&gt;&lt;SPAN class="L0S55"&gt;.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="L0S52"&gt;ADD &lt;/SPAN&gt;wa&lt;SPAN class="L0S70"&gt;-&lt;/SPAN&gt;amount &lt;SPAN class="L0S52"&gt;TO &lt;/SPAN&gt;lv_total_p&lt;SPAN class="L0S55"&gt;.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN class="L0S52"&gt;ENDIF&lt;/SPAN&gt;&lt;SPAN class="L0S55"&gt;.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN class="L0S52"&gt;CLEAR &lt;/SPAN&gt;wa&lt;SPAN class="L0S55"&gt;.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt; &lt;SPAN class="L0S52"&gt;ENDLOOP&lt;/SPAN&gt;&lt;SPAN class="L0S55"&gt;.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; lv_sum &lt;SPAN class="L0S55"&gt;= &lt;/SPAN&gt;lv_total_a &lt;SPAN class="L0S70"&gt;- &lt;/SPAN&gt;lv_total_p&lt;SPAN class="L0S55"&gt;.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 May 2013 05:28:12 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/calculate-sum-internal-table/m-p/9488338#M1745725</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2013-05-22T05:28:12Z</dc:date>
    </item>
  </channel>
</rss>

