<?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: Problem when doing mathematical operation in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-when-doing-mathematical-operation/m-p/1477933#M223953</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Johnson,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I don't think this is with the Conversion problem.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Declare variable where u r storing the result as &amp;lt;b&amp;gt;PACKED NUMBER&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: RESULT TYPE P DECIMALS 2.&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;Reward if helps.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Vasanth&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 17 Aug 2006 11:20:50 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2006-08-17T11:20:50Z</dc:date>
    <item>
      <title>Problem when doing mathematical operation</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-when-doing-mathematical-operation/m-p/1477931#M223951</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Everyone,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Am faced with a problem when dividing two values.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The numerator is field vbrp-cmpre, Domain: WERTV6, Value: 139.20&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The denominator is field vbrp-fkimg, Domain: MENG13, Value: 5.000&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Am taking the result into a variable LIKE vbrp-cmpre. The value I am getting is 0.03, which is incorrect.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I understand that this may be a conversion problem. Could someone please explain how to solve this?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you very much.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Johnson&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 17 Aug 2006 11:18:03 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-when-doing-mathematical-operation/m-p/1477931#M223951</guid>
      <dc:creator>former_member215243</dc:creator>
      <dc:date>2006-08-17T11:18:03Z</dc:date>
    </item>
    <item>
      <title>Re: Problem when doing mathematical operation</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-when-doing-mathematical-operation/m-p/1477932#M223952</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;See if the attribute for Fixed Point- Arithmetic is checked in your program.&lt;/P&gt;&lt;P&gt;se38.&lt;/P&gt;&lt;P&gt;Give Program name.&lt;/P&gt;&lt;P&gt;Choose Attributes radio-button.&lt;/P&gt;&lt;P&gt;Click Display.&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Ravi&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 17 Aug 2006 11:20:29 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-when-doing-mathematical-operation/m-p/1477932#M223952</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-08-17T11:20:29Z</dc:date>
    </item>
    <item>
      <title>Re: Problem when doing mathematical operation</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-when-doing-mathematical-operation/m-p/1477933#M223953</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Johnson,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I don't think this is with the Conversion problem.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Declare variable where u r storing the result as &amp;lt;b&amp;gt;PACKED NUMBER&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: RESULT TYPE P DECIMALS 2.&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;Reward if helps.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Vasanth&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 17 Aug 2006 11:20:50 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-when-doing-mathematical-operation/m-p/1477933#M223953</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-08-17T11:20:50Z</dc:date>
    </item>
    <item>
      <title>Re: Problem when doing mathematical operation</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-when-doing-mathematical-operation/m-p/1477934#M223954</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;its because in the program attributes, the Check box  FIXED POINT ARITHMETIC field is not selected.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;because  of this you are getting  0.03&lt;/P&gt;&lt;P&gt;if you select that and do that you will get  27.84.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Srikanth&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 17 Aug 2006 11:27:47 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-when-doing-mathematical-operation/m-p/1477934#M223954</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-08-17T11:27:47Z</dc:date>
    </item>
    <item>
      <title>Re: Problem when doing mathematical operation</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-when-doing-mathematical-operation/m-p/1477935#M223955</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 drafted a sample code as follows and executed:&lt;/P&gt;&lt;P&gt;data: a1 like vbrp-cmpre value '139.20',&lt;/P&gt;&lt;P&gt;      a2 like vbrp-fkimg value '5.000'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: a3 like vbrp-cmpre.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;a3 = a1 / a2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;write:/ a1,&lt;/P&gt;&lt;P&gt;      / a2,&lt;/P&gt;&lt;P&gt;      / a3.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I get the result:&lt;/P&gt;&lt;P&gt;139.20&lt;/P&gt;&lt;P&gt;  5.000&lt;/P&gt;&lt;P&gt; 27.84&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I don't think there's any conversion problem. Pls check ur code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Subbu&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 17 Aug 2006 11:35:27 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-when-doing-mathematical-operation/m-p/1477935#M223955</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-08-17T11:35:27Z</dc:date>
    </item>
    <item>
      <title>Re: Problem when doing mathematical operation</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-when-doing-mathematical-operation/m-p/1477936#M223956</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;Immaterial of whether the fixed point arithmetic is ON or NOT, you are bound to get a truncated value in the sum because you are target field can hold only 2 decimals. So, the denomenator will be rounded off to 2 decimals value.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;First thing is you have to check 'FIXED POINT ARITHMETIC' on the attributes of the program, and then you have to choose your target field after division to refer a domain having 3 decimal places so that any truncation can be avoided.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data : l_tot type vbrp-cmpre value '139.20'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data : l_den type vbrp-fkimg value '5.010'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data : l_fin type vbrp-fkimg.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;l_fin = l_tot / l_den.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;write: l_fin.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 17 Aug 2006 12:00:18 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-when-doing-mathematical-operation/m-p/1477936#M223956</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-08-17T12:00:18Z</dc:date>
    </item>
  </channel>
</rss>

