<?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: Decimals Calculation Problem in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/decimals-calculation-problem/m-p/1073483#M95565</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Nitin!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Something of topic: tax is not calculate on line level, but on header level and afterwards distributed. There can be rounding differences based on the different procedures - just in case you will compare with standard documents.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Christian&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 09 Dec 2005 13:57:17 GMT</pubDate>
    <dc:creator>christian_wohlfahrt</dc:creator>
    <dc:date>2005-12-09T13:57:17Z</dc:date>
    <item>
      <title>Decimals Calculation Problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/decimals-calculation-problem/m-p/1073478#M95560</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;I am calculating this formula&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;w_tax_amt = ( v_tot * konp-kbetr ) / 100&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Following are the values&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;v_tot = 329284.57     &lt;/P&gt;&lt;P&gt;konp-kbetr = 5.00       &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This yields w_tax_amt =  16464.23&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am expecting this value to be 16464.22 as using calci it comes 16464.2284&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I dont want rounding to happen. How should I go about it ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What type should I use. Currently all the tyes are of bseg-wrbtr type&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 09 Dec 2005 13:35:31 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/decimals-calculation-problem/m-p/1073478#M95560</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-12-09T13:35:31Z</dc:date>
    </item>
    <item>
      <title>Re: Decimals Calculation Problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/decimals-calculation-problem/m-p/1073479#M95561</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;In the editor see the setting for fixed point arithmetic.&lt;/P&gt;&lt;P&gt;Go to attributes in se38 and see if the check box for fixed point arithmetic is checked or not.&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Vamsi.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 09 Dec 2005 13:39:00 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/decimals-calculation-problem/m-p/1073479#M95561</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-12-09T13:39:00Z</dc:date>
    </item>
    <item>
      <title>Re: Decimals Calculation Problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/decimals-calculation-problem/m-p/1073480#M95562</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Declare the variable w_tax_amt with 3 or 4 decimals and then use the truncate function.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 09 Dec 2005 13:39:14 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/decimals-calculation-problem/m-p/1073480#M95562</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-12-09T13:39:14Z</dc:date>
    </item>
    <item>
      <title>Re: Decimals Calculation Problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/decimals-calculation-problem/m-p/1073481#M95563</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;You should use 'DECIMALS' OR 'ROUND' depending on what you need.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Effect of different DECIMALS specifications: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: X TYPE P DECIMALS 3 VALUE '1.267', &lt;/P&gt;&lt;P&gt;      Y TYPE F            VALUE '125.456E2'. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;WRITE: /X DECIMALS 0,  "output: 1 &lt;/P&gt;&lt;P&gt;       /X DECIMALS 2,  "output: 1.27 &lt;/P&gt;&lt;P&gt;       /X DECIMALS 5,  "output: 1.26700 &lt;/P&gt;&lt;P&gt;       /Y DECIMALS 1,  "output: 1.3E+04 &lt;/P&gt;&lt;P&gt;       /Y DECIMALS 5,  "output: 1.25456E+04 &lt;/P&gt;&lt;P&gt;       /Y DECIMALS 20. "output: 1.25456000000000E+04 &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Effect of different ROUND specifications: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: X TYPE P DECIMALS 2 VALUE '12493.97'. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;WRITE: /X ROUND -2,   "output: 1,249,397.00 &lt;/P&gt;&lt;P&gt;       /X ROUND  0,   "output:    12,493.97 &lt;/P&gt;&lt;P&gt;       /X ROUND  2,   "output:       124.94 &lt;/P&gt;&lt;P&gt;       /X ROUND  5,   "output:         0.12 &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps, please dont forget to reward if this was helpful,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Gabriel P,&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 09 Dec 2005 13:41:42 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/decimals-calculation-problem/m-p/1073481#M95563</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-12-09T13:41:42Z</dc:date>
    </item>
    <item>
      <title>Re: Decimals Calculation Problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/decimals-calculation-problem/m-p/1073482#M95564</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Please try this.  Using FLOOR will always round down.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;

REPORT ZRICH_0002 .

data: v_tot type p decimals 2.
data: konp-kbetr type konp-kbetr.
data: w_tax_amt type p decimals 2.


v_tot = '329284.57' .
konp-kbetr = '5.00' .


&amp;lt;b&amp;gt;w_tax_amt = ( floor( v_tot * konp-kbetr ) ) / 100.&amp;lt;/b&amp;gt;




write:/ w_tax_amt.

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Welcome to SDN.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please make sure to award points for helpful answers and mark your posts as solved when solved completely.  Thanks.&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;Rich Heilman&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 09 Dec 2005 13:42:19 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/decimals-calculation-problem/m-p/1073482#M95564</guid>
      <dc:creator>RichHeilman</dc:creator>
      <dc:date>2005-12-09T13:42:19Z</dc:date>
    </item>
    <item>
      <title>Re: Decimals Calculation Problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/decimals-calculation-problem/m-p/1073483#M95565</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Nitin!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Something of topic: tax is not calculate on line level, but on header level and afterwards distributed. There can be rounding differences based on the different procedures - just in case you will compare with standard documents.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Christian&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 09 Dec 2005 13:57:17 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/decimals-calculation-problem/m-p/1073483#M95565</guid>
      <dc:creator>christian_wohlfahrt</dc:creator>
      <dc:date>2005-12-09T13:57:17Z</dc:date>
    </item>
  </channel>
</rss>

