<?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: performing calculations from internal table in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/performing-calculations-from-internal-table/m-p/939281#M62813</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE&gt;&lt;CODE&gt;

  clear zbalanceamount.
  loop balfwitab into bwa.
    add bwa-wrbtr to zbalanceamount.
  endloop.
  
  
*  zbalanceamount now has the total and can be added
*  to your new internal table.

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Rich Heilman&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 19 Jul 2005 19:04:53 GMT</pubDate>
    <dc:creator>RichHeilman</dc:creator>
    <dc:date>2005-07-19T19:04:53Z</dc:date>
    <item>
      <title>performing calculations from internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performing-calculations-from-internal-table/m-p/939279#M62811</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi folks,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have the question. Here is the code..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;types: begin of balfw,&lt;/P&gt;&lt;P&gt;             kunnr type bseg-kunnr,&lt;/P&gt;&lt;P&gt;              zuonr type bseg-zuonr,&lt;/P&gt;&lt;P&gt;               wrbtr type bseg-wrbtr,&lt;/P&gt;&lt;P&gt;types: end of balfw.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  data: balfwitab  type standard table of balfw &lt;/P&gt;&lt;P&gt;        with header line.&lt;/P&gt;&lt;P&gt;        zbalanceamount type bseg-wrbtr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    select kunnr zuonr wrbtr into table balfwitab &lt;/P&gt;&lt;P&gt;          where bseg-kunnr = p_custid.&lt;/P&gt;&lt;P&gt;         if bseg-kunnr = bseg-zuonr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;         loop balfwitab into bwa&lt;/P&gt;&lt;P&gt;         move bwa-wrbtr into zbalanceamount.&lt;/P&gt;&lt;P&gt;....&lt;/P&gt;&lt;P&gt;I will have to read the data from the field 'wrbtr' -amount field(currency data type) from the itab&lt;/P&gt;&lt;P&gt;and need to add each value as I loop each time and store it in a separate variable .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then I need to save that data into a separate variable of char type because I need to insert this data into another itable where this field is of character data type.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How can I do this?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Santhosh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 Jul 2005 18:57:45 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performing-calculations-from-internal-table/m-p/939279#M62811</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-07-19T18:57:45Z</dc:date>
    </item>
    <item>
      <title>Re: performing calculations from internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performing-calculations-from-internal-table/m-p/939280#M62812</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;loop balfwitab into bwa&lt;/P&gt;&lt;P&gt;zbalanceamount = zbalanceamount + bwa-wrbtr .&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;data: charamount(20) type c .&lt;/P&gt;&lt;P&gt;write zbalanceamount to charamount .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Raja&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 Jul 2005 19:04:44 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performing-calculations-from-internal-table/m-p/939280#M62812</guid>
      <dc:creator>athavanraja</dc:creator>
      <dc:date>2005-07-19T19:04:44Z</dc:date>
    </item>
    <item>
      <title>Re: performing calculations from internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performing-calculations-from-internal-table/m-p/939281#M62813</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE&gt;&lt;CODE&gt;

  clear zbalanceamount.
  loop balfwitab into bwa.
    add bwa-wrbtr to zbalanceamount.
  endloop.
  
  
*  zbalanceamount now has the total and can be added
*  to your new internal table.

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Rich Heilman&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 Jul 2005 19:04:53 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performing-calculations-from-internal-table/m-p/939281#M62813</guid>
      <dc:creator>RichHeilman</dc:creator>
      <dc:date>2005-07-19T19:04:53Z</dc:date>
    </item>
    <item>
      <title>Re: performing calculations from internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performing-calculations-from-internal-table/m-p/939282#M62814</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Bear in mind that bseg-wrbtr is unsigned. You have to check the debit/credit indicator bseg-shkzg.&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
if bseg-shkzg = 'H'.
* process credit
else.
* process debit
endif.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Add or subtract depending on how you show debits/credits.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rob&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And you shouldn't select BSEG on anything but the key fields. For customers, use BSID and BSAD instead, depending on whether you want open and/or closed items.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: Rob Burbank&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 Jul 2005 19:14:08 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performing-calculations-from-internal-table/m-p/939282#M62814</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-07-19T19:14:08Z</dc:date>
    </item>
    <item>
      <title>Re: performing calculations from internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performing-calculations-from-internal-table/m-p/939283#M62815</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;thanks a lot it really helped.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 Jul 2005 20:57:37 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performing-calculations-from-internal-table/m-p/939283#M62815</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-07-19T20:57:37Z</dc:date>
    </item>
  </channel>
</rss>

