<?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 problem after calculation in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/decimals-problem-after-calculation/m-p/5816911#M1314302</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Thanks for the responce.&lt;/P&gt;&lt;P&gt;I have solved the problem on own as below.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      l_sales_amt_round =  ( lwa_post_data-cccur_sale *&lt;/P&gt;&lt;P&gt;                             wa_post_data-taxper ).&lt;/P&gt;&lt;P&gt;      CLEAR l_tax_amt.&lt;/P&gt;&lt;P&gt;      MOVE l_sales_amt_round TO l_tax_amt.&lt;/P&gt;&lt;P&gt;      SHIFT l_tax_amt RIGHT.&lt;/P&gt;&lt;P&gt;      SHIFT l_tax_amt RIGHT.&lt;/P&gt;&lt;P&gt;      MOVE l_tax_amt TO l_sales_amt_round.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here l_tax_amt is char field.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Vinod.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 26 Jun 2009 15:32:56 GMT</pubDate>
    <dc:creator>vinod_vemuru2</dc:creator>
    <dc:date>2009-06-26T15:32:56Z</dc:date>
    <item>
      <title>decimals problem after calculation</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/decimals-problem-after-calculation/m-p/5816908#M1314299</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 am facing an issue with decimals after calculation.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Below is my calculation.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;l_sales_amt_round = lwa_post_data-cccur_sale +&lt;/P&gt;&lt;P&gt;                    ( lwa_post_data-cccur_sale *&lt;/P&gt;&lt;P&gt;                      wa_post_data-taxper ).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here lwa_post_data-cccur_sale has 2 decimals&lt;/P&gt;&lt;P&gt;       wa_post_data-taxper  has 3 decimals.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Result variable l_sales_amt_round of type f. ( Tried with TYPE P DECIMALS 3).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there any way to extract only the first 2 decimals into &lt;STRONG&gt;an amount field&lt;/STRONG&gt;. I dont want this in character field.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;eg: lwa_post_data-cccur_sale  = 4854.00&lt;/P&gt;&lt;P&gt;      wa_post_data-taxper  = 0.175&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then l_sales_amt_round =    5.7034499999999998E+03&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But when i move this to TYPE P DECIMALS 2 it is rounding to          5703.45.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But my requirement is to get          5703.44.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there any way to achieve this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Vinod.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 26 Jun 2009 13:11:00 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/decimals-problem-after-calculation/m-p/5816908#M1314299</guid>
      <dc:creator>vinod_vemuru2</dc:creator>
      <dc:date>2009-06-26T13:11:00Z</dc:date>
    </item>
    <item>
      <title>Re: decimals problem after calculation</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/decimals-problem-after-calculation/m-p/5816909#M1314300</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Isn't that what the DIV operand is for?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Check the online help for more info and examples, because I have never used it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kind regards, Rob Dielemans&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 26 Jun 2009 13:49:31 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/decimals-problem-after-calculation/m-p/5816909#M1314300</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-06-26T13:49:31Z</dc:date>
    </item>
    <item>
      <title>Re: decimals problem after calculation</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/decimals-problem-after-calculation/m-p/5816910#M1314301</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Vinod,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;maybe the following code snippet is helpful:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;data: result type p decimals 2,
result = round( val = l_sales_amt_round dec = 2 mode = CL_ABAP_MATH=&amp;gt;ROUND_DOWN ).
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;  Andreas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 26 Jun 2009 13:59:23 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/decimals-problem-after-calculation/m-p/5816910#M1314301</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-06-26T13:59:23Z</dc:date>
    </item>
    <item>
      <title>Re: decimals problem after calculation</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/decimals-problem-after-calculation/m-p/5816911#M1314302</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Thanks for the responce.&lt;/P&gt;&lt;P&gt;I have solved the problem on own as below.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      l_sales_amt_round =  ( lwa_post_data-cccur_sale *&lt;/P&gt;&lt;P&gt;                             wa_post_data-taxper ).&lt;/P&gt;&lt;P&gt;      CLEAR l_tax_amt.&lt;/P&gt;&lt;P&gt;      MOVE l_sales_amt_round TO l_tax_amt.&lt;/P&gt;&lt;P&gt;      SHIFT l_tax_amt RIGHT.&lt;/P&gt;&lt;P&gt;      SHIFT l_tax_amt RIGHT.&lt;/P&gt;&lt;P&gt;      MOVE l_tax_amt TO l_sales_amt_round.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here l_tax_amt is char field.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Vinod.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 26 Jun 2009 15:32:56 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/decimals-problem-after-calculation/m-p/5816911#M1314302</guid>
      <dc:creator>vinod_vemuru2</dc:creator>
      <dc:date>2009-06-26T15:32:56Z</dc:date>
    </item>
  </channel>
</rss>

