<?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 Wrong arithmetic calculations in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/wrong-arithmetic-calculations/m-p/8098228#M1616082</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;HI all,&lt;/P&gt;&lt;P&gt;I've got this piece of coding:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
DATA ls_static_attributes TYPE ztype.
DATA lv_amount TYPE BPREI.

ls_static_attributes-netpr = '123'.
ls_static_attributes-menge = '1'.
ls_static_attributes-bpumn = '1'.
 lv_amount =   ls_static_attributes-netpr * ls_static_attributes-menge .

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;well the value of lv_amount is different when the code above is inserted in a report rather than in a method of a class.&lt;/P&gt;&lt;P&gt;In particular, in a report it correctly contains '123,00' whilst in a class I'm getting '123.000,00'.&lt;/P&gt;&lt;P&gt;I tried to debug and I've seen that after the assignment:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
ls_static_attributes-menge = '1'.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;the variable ls_static_attributes-menge contains (1.000) in a report whilst in a class it contains (0.001). &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Could anybody shed more light on this?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 09 Jul 2011 06:38:45 GMT</pubDate>
    <dc:creator>ged_hurst</dc:creator>
    <dc:date>2011-07-09T06:38:45Z</dc:date>
    <item>
      <title>Wrong arithmetic calculations</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/wrong-arithmetic-calculations/m-p/8098228#M1616082</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;HI all,&lt;/P&gt;&lt;P&gt;I've got this piece of coding:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
DATA ls_static_attributes TYPE ztype.
DATA lv_amount TYPE BPREI.

ls_static_attributes-netpr = '123'.
ls_static_attributes-menge = '1'.
ls_static_attributes-bpumn = '1'.
 lv_amount =   ls_static_attributes-netpr * ls_static_attributes-menge .

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;well the value of lv_amount is different when the code above is inserted in a report rather than in a method of a class.&lt;/P&gt;&lt;P&gt;In particular, in a report it correctly contains '123,00' whilst in a class I'm getting '123.000,00'.&lt;/P&gt;&lt;P&gt;I tried to debug and I've seen that after the assignment:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
ls_static_attributes-menge = '1'.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;the variable ls_static_attributes-menge contains (1.000) in a report whilst in a class it contains (0.001). &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Could anybody shed more light on this?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 09 Jul 2011 06:38:45 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/wrong-arithmetic-calculations/m-p/8098228#M1616082</guid>
      <dc:creator>ged_hurst</dc:creator>
      <dc:date>2011-07-09T06:38:45Z</dc:date>
    </item>
    <item>
      <title>Re: Wrong arithmetic calculations</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/wrong-arithmetic-calculations/m-p/8098229#M1616083</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I think this is due to a different "fixed-point arithmetic" program attribute. It is set by default, which means decimals of packed fields are taken into account. When unchecked, system considers every packed field as an integer (except when it is output). More info: [SAP Library: ABAP - business calculations|http://help.sap.com/saphelp_nw70/helpdata/en/fc/eb333d358411d1829f0000e829fbfe/frameset.htm]&lt;/P&gt;&lt;P&gt;BR&lt;/P&gt;&lt;P&gt;Sandra&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 09 Jul 2011 14:39:37 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/wrong-arithmetic-calculations/m-p/8098229#M1616083</guid>
      <dc:creator>Sandra_Rossi</dc:creator>
      <dc:date>2011-07-09T14:39:37Z</dc:date>
    </item>
    <item>
      <title>Re: Wrong arithmetic calculations</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/wrong-arithmetic-calculations/m-p/8098230#M1616084</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Themis,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;probably the ztype has amount or qauntity field which are by default connected to a currency key or unit field. Check the respective currency key or unit fields.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I don't think the code behaves different in class an report context, check also Sandra's suggestion about fixed-point arithmetic flag - actually I don't know any reason to change that default.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Clemens&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 09 Jul 2011 16:58:06 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/wrong-arithmetic-calculations/m-p/8098230#M1616084</guid>
      <dc:creator>Clemenss</dc:creator>
      <dc:date>2011-07-09T16:58:06Z</dc:date>
    </item>
    <item>
      <title>Re: Wrong arithmetic calculations</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/wrong-arithmetic-calculations/m-p/8098231#M1616085</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Clemens,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;&lt;P&gt;probably the ztype has amount or qauntity field which are by default connected to a currency key or unit field. Check the respective currency key or unit fields.&lt;/P&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;quantities and units are only used for output, not for internal calculations, it's why I think the fixed-point arithmetic is the only possibility. Usually people don't change it but some standard programs are provided without this option checked, developers are usually getting screwed when they implement the "userexit" subroutines of these programs.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sandra&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 09 Jul 2011 17:55:41 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/wrong-arithmetic-calculations/m-p/8098231#M1616085</guid>
      <dc:creator>Sandra_Rossi</dc:creator>
      <dc:date>2011-07-09T17:55:41Z</dc:date>
    </item>
    <item>
      <title>Re: Wrong arithmetic calculations</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/wrong-arithmetic-calculations/m-p/8098232#M1616086</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you Sandra,&lt;/P&gt;&lt;P&gt;I've given you full points, you've solved my problem.&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 11 Jul 2011 07:57:43 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/wrong-arithmetic-calculations/m-p/8098232#M1616086</guid>
      <dc:creator>ged_hurst</dc:creator>
      <dc:date>2011-07-11T07:57:43Z</dc:date>
    </item>
  </channel>
</rss>

