<?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 Caluculation in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/caluculation/m-p/3139392#M746043</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 have internal table field of type vbdpr-ntgew.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The value of that variable at run time is 1,143.060 now what I need to do I need to display only integer part in my smart form.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I mean in above if decimal part is greater than 500 I need to display next rounded value in my smart form I mean 1144 in above example other wise I need to display 1143. And the value I need to display in system user setting format.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And my internal table contains one more field that is for total and I am calculating total  based on  the below formula&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Total = above value (1143) * price.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Price contains value 100,00&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So my output coming 114300,000&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But I want to display only two decimals in total but I am taking brgew as reference to that internal table field. I can not change the reference fields in my internal table fields.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please help me. I will give points. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks a lot in advance.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 20 Dec 2007 11:20:21 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-12-20T11:20:21Z</dc:date>
    <item>
      <title>Caluculation</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/caluculation/m-p/3139392#M746043</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 have internal table field of type vbdpr-ntgew.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The value of that variable at run time is 1,143.060 now what I need to do I need to display only integer part in my smart form.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I mean in above if decimal part is greater than 500 I need to display next rounded value in my smart form I mean 1144 in above example other wise I need to display 1143. And the value I need to display in system user setting format.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And my internal table contains one more field that is for total and I am calculating total  based on  the below formula&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Total = above value (1143) * price.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Price contains value 100,00&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So my output coming 114300,000&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But I want to display only two decimals in total but I am taking brgew as reference to that internal table field. I can not change the reference fields in my internal table fields.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please help me. I will give points. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks a lot in advance.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 20 Dec 2007 11:20:21 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/caluculation/m-p/3139392#M746043</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-12-20T11:20:21Z</dc:date>
    </item>
    <item>
      <title>Re: Caluculation</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/caluculation/m-p/3139393#M746044</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;For rounding off you can move vbdpr-ntgew field value to a numeric field. &lt;/P&gt;&lt;P&gt;Declare a field &lt;/P&gt;&lt;P&gt;Data: ntgew(13) type n.&lt;/P&gt;&lt;P&gt;Move vbdpr-ntgew to ntgew. "rounded off value. &lt;/P&gt;&lt;P&gt;For removing an extra decimal:&lt;/P&gt;&lt;P&gt;Write Total to Itab-total decimals 2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Lokesh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 20 Dec 2007 11:29:19 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/caluculation/m-p/3139393#M746044</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-12-20T11:29:19Z</dc:date>
    </item>
    <item>
      <title>Re: Caluculation</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/caluculation/m-p/3139394#M746045</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 can use floor and ceil in your program for rounding off the decimals. Below is the example code you can use :&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
DATA: I TYPE I, 
      P TYPE P DECIMALS 2, 
      M TYPE F            VALUE '-3.5', 
      D TYPE P DECIMALS 1. 
P = ABS( M ).   " 3,5 
I = P.          "  4 - business rounding 
I = M.          " -4 
I = CEIL( P ).  "  4 - next largest whole number 
I = CEIL( M ).  " -3 
I = FLOOR( P ). "  3 - next smallest whole number 
I = FLOOR( M ). " -4 
I = TRUNC( P ). "  3 - integer part 
I = TRUNC( M ). " -3 
D = FRAC( P ).  "  0.5 - decimal part 
D = FRAC( M ).  " -0.5 
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Sriram Ponna.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 20 Dec 2007 11:35:41 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/caluculation/m-p/3139394#M746045</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-12-20T11:35:41Z</dc:date>
    </item>
    <item>
      <title>Re: Caluculation</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/caluculation/m-p/3139395#M746046</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;  U have declare the variable as &lt;STRONG&gt;type p&lt;/STRONG&gt;(for ur numeric variable)&lt;/P&gt;&lt;P&gt; To get only two decimals after the numbers&lt;/P&gt;&lt;P&gt;  give as &lt;/P&gt;&lt;P&gt;Type: ...........decimals 2&lt;/P&gt;&lt;P&gt;To remove commas use the statement NO-GROUPING...it will remove the commas,,&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;Ari&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 20 Dec 2007 11:37:53 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/caluculation/m-p/3139395#M746046</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-12-20T11:37:53Z</dc:date>
    </item>
    <item>
      <title>Re: Caluculation</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/caluculation/m-p/3139396#M746047</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Use the command Ceil or Floor based on the decimal value .....if it is less than 5 ie .5 use ceil or else floor ...so that u can round off.............&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 20 Dec 2007 11:38:10 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/caluculation/m-p/3139396#M746047</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-12-20T11:38:10Z</dc:date>
    </item>
  </channel>
</rss>

