<?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: Issues with Decimals in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/issues-with-decimals/m-p/6843535#M1473444</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Kittu,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Yes. Marcin Got the issue.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Its bcoz of Fixed point arithmetic.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 29 Mar 2010 10:49:21 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2010-03-29T10:49:21Z</dc:date>
    <item>
      <title>Issues with Decimals</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/issues-with-decimals/m-p/6843528#M1473437</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have an issue with decimals in calculation : - &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;Data : G_SUM TYPE p DECIMALS 2.

   KOMV-KBETR = 2.00  (KBETR TYPE IS P(6) Decimal 2)
   
   WG_A650-ZZBILL_QUNT = 10.00 (ZZBILL_QUNT Type is P(7) Decimal 3)


        Loop at I_A650 into WG_A650.
             G_SUM = G_SUM + ( KOMV-KBETR * WG_A650-ZZBILL_QUNT ).
        Endloop.


           XKWERT = G_SUM. (XKWERT Type is P(7) Decimal 2)

 Form the above calculation : - G_SUM should be 20.00
         But the result is : -  20000.00
 
To aviod this i changed the declartion of G_SUM as below : - 

Data : G_SUM TYPE p DECIMALS 5.

 Now it is calculating correctly but i need to assign this value to a another field. 
      Its data type is (TYPE p DECIMALS 2)&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt; Now the result is again changed to 20000.00&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any sugesstion to fix this issue will be apprecaiated. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Kittu&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 29 Mar 2010 10:13:33 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/issues-with-decimals/m-p/6843528#M1473437</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-03-29T10:13:33Z</dc:date>
    </item>
    <item>
      <title>Re: Issues with Decimals</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/issues-with-decimals/m-p/6843529#M1473438</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;erm no, please read your code again. You assign 10 to your workarea field, and THEN you do a loop of a internal table into workarea. &lt;/P&gt;&lt;P&gt;So what you have done in is not existant anymore.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. your desired value would be 200 and not 20, if your "set"-coding would have any effect.&lt;/P&gt;&lt;P&gt;2. we dont know what is in your internal table, so we dont knwo how often this line (G_SUM = G_SUM + ( KOMV-KBETR * WG_A650-ZZBILL_QUNT ).) will get processed.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;as well as we dont know the value of WG_A650-ZZBILL_QUNT.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;so with this information we cant tell too much.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 29 Mar 2010 10:21:00 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/issues-with-decimals/m-p/6843529#M1473438</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-03-29T10:21:00Z</dc:date>
    </item>
    <item>
      <title>Re: Issues with Decimals</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/issues-with-decimals/m-p/6843530#M1473439</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;You cant declare like this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;KBETR TYPE IS P(6) Decimal 2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How did you declared?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 29 Mar 2010 10:30:44 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/issues-with-decimals/m-p/6843530#M1473439</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-03-29T10:30:44Z</dc:date>
    </item>
    <item>
      <title>Re: Issues with Decimals</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/issues-with-decimals/m-p/6843531#M1473440</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Florian Kemmer,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you for your quick response! &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It is my mistake, i could have explained in more efficient manner.  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The below values are from Internal table only and it has only 1 record. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; KOMV-KBETR = 2.00     &lt;/P&gt;&lt;P&gt;   WG_A650-ZZBILL_QUNT = 10.00 &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;(G_SUM = G_SUM + ( KOMV-KBETR * WG_A650-ZZBILL_QUNT ).)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;After the above formula is executed it shoudl display the value as 20.00&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Due to issues with the decimals it is displaying as 20000.00&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And the declaration is not exactly done as described...It is just for understanding. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;KBETR --&amp;gt; is of type  P(6) Decimal 2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any suggestion will be appreciated &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Kittu&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Kittu on Mar 29, 2010 12:34 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 29 Mar 2010 10:33:20 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/issues-with-decimals/m-p/6843531#M1473440</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-03-29T10:33:20Z</dc:date>
    </item>
    <item>
      <title>Re: Issues with Decimals</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/issues-with-decimals/m-p/6843532#M1473441</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;ah ok i see what is happening here, tho yeah i also would really like to understand it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sorry i cant help you too much, this is once again a case where i hate it to calculate with SAP. human logic cant really follow this, at least not an intuitive one.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;declaring your field with 5 decimals solves it, and i probably would have to something like &lt;/P&gt;&lt;P&gt;(G_SUM = G_SUM + ( KOMV-KBETR * WG_A650-ZZBILL_QUNT /1000), which would get us to the same. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;but yeah your question is still unanswered sorry.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 29 Mar 2010 10:42:41 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/issues-with-decimals/m-p/6843532#M1473441</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-03-29T10:42:41Z</dc:date>
    </item>
    <item>
      <title>Re: Issues with Decimals</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/issues-with-decimals/m-p/6843533#M1473442</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Kittu,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I tested with a piece of code and its working fine. &lt;/P&gt;&lt;P&gt;please check the below code and the result is 20.00.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;data : KBETR TYPE P LENGTH 6 Decimals 2 value '2.00',
       ZZBILL_QUNT Type P LENGTH 7 Decimals 3 value '10.00'.

Data : G_SUM TYPE p DECIMALS 2." VALUE '20'.

G_SUM = G_SUM + ( KBETR * ZZBILL_QUNT ).

write : g_sum.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Check your inputs.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 29 Mar 2010 10:44:35 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/issues-with-decimals/m-p/6843533#M1473442</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-03-29T10:44:35Z</dc:date>
    </item>
    <item>
      <title>Re: Issues with Decimals</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/issues-with-decimals/m-p/6843534#M1473443</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This is because you don't have &lt;STRONG&gt;fixed point arithmethic&lt;/STRONG&gt; turned on. &lt;/P&gt;&lt;P&gt;Go to programs &lt;EM&gt;attributes-&amp;gt;&lt;/EM&gt; check &lt;EM&gt;fixed point arith&lt;/EM&gt; . You will get 20.00.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Marcin&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 29 Mar 2010 10:45:14 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/issues-with-decimals/m-p/6843534#M1473443</guid>
      <dc:creator>MarcinPciak</dc:creator>
      <dc:date>2010-03-29T10:45:14Z</dc:date>
    </item>
    <item>
      <title>Re: Issues with Decimals</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/issues-with-decimals/m-p/6843535#M1473444</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Kittu,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Yes. Marcin Got the issue.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Its bcoz of Fixed point arithmetic.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 29 Mar 2010 10:49:21 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/issues-with-decimals/m-p/6843535#M1473444</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-03-29T10:49:21Z</dc:date>
    </item>
    <item>
      <title>Re: Issues with Decimals</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/issues-with-decimals/m-p/6843536#M1473445</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Check whether fixed point arithmatic check is checked or not in the program attibutes. If not checked, check it and test it.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 29 Mar 2010 10:50:21 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/issues-with-decimals/m-p/6843536#M1473445</guid>
      <dc:creator>former_member772790</dc:creator>
      <dc:date>2010-03-29T10:50:21Z</dc:date>
    </item>
    <item>
      <title>Re: Issues with Decimals</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/issues-with-decimals/m-p/6843537#M1473446</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;great now i get it. OMG that simple. Thanks a LOT.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BTW if you cannot turn on fixed poiint arithmetic for this program, you could make a new FM turn it on there and do your calculations in your new FM then.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 29 Mar 2010 11:01:40 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/issues-with-decimals/m-p/6843537#M1473446</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-03-29T11:01:40Z</dc:date>
    </item>
    <item>
      <title>Re: Issues with Decimals</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/issues-with-decimals/m-p/6843538#M1473447</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Florian Kemmer, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you all for your response! &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The issue is fixed. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; Loop at I_A650 into WG_A650.&lt;/P&gt;&lt;P&gt;        XKWERT = XKWERT + ( ( KOMV-KBETR * WG_A650-ZZBILL_QUNT ) / 1000 )."  2 dec X 3 dec&lt;/P&gt;&lt;P&gt;                                        " - This logic is  written to adjust the decimals&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;/1000...did the magic . &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;Kittu&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Kittu on Mar 29, 2010 3:27 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 29 Mar 2010 13:27:17 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/issues-with-decimals/m-p/6843538#M1473447</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-03-29T13:27:17Z</dc:date>
    </item>
  </channel>
</rss>

