<?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 type casting with decimals in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/type-casting-with-decimals/m-p/2344111#M516917</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have three data objects &lt;/P&gt;&lt;P&gt;mglme length 13, decimal 3 type quan &lt;/P&gt;&lt;P&gt;kbetr   length 11, decimal 2 type curr&lt;/P&gt;&lt;P&gt;netwr   length 15, decimal 2 type curr &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I need to do kbetr = netwr / mglme &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But I never get the right value because of the difference in data lengths &lt;/P&gt;&lt;P&gt;for e.g. netwr = 150.00 and mglme = 10.000 returns kbetr = .015 &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any help on how to solve this. Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 06 Jun 2007 22:12:50 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-06-06T22:12:50Z</dc:date>
    <item>
      <title>type casting with decimals</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/type-casting-with-decimals/m-p/2344111#M516917</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have three data objects &lt;/P&gt;&lt;P&gt;mglme length 13, decimal 3 type quan &lt;/P&gt;&lt;P&gt;kbetr   length 11, decimal 2 type curr&lt;/P&gt;&lt;P&gt;netwr   length 15, decimal 2 type curr &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I need to do kbetr = netwr / mglme &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But I never get the right value because of the difference in data lengths &lt;/P&gt;&lt;P&gt;for e.g. netwr = 150.00 and mglme = 10.000 returns kbetr = .015 &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any help on how to solve this. Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 Jun 2007 22:12:50 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/type-casting-with-decimals/m-p/2344111#M516917</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-06-06T22:12:50Z</dc:date>
    </item>
    <item>
      <title>Re: type casting with decimals</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/type-casting-with-decimals/m-p/2344112#M516918</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Megan,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Round off the decimals of all the fields before you do the division.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Check this thread for round off of decimals.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A class="jive_macro jive_macro_message" href="https://community.sap.com/" __jive_macro_name="message" modifiedtitle="true" __default_attr="3511850"&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope it solves your problem.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Aneesh.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 Jun 2007 22:44:24 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/type-casting-with-decimals/m-p/2344112#M516918</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-06-06T22:44:24Z</dc:date>
    </item>
    <item>
      <title>Re: type casting with decimals</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/type-casting-with-decimals/m-p/2344113#M516919</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have three data objects &lt;/P&gt;&lt;P&gt;mglme length 13, decimal 3 type quan &lt;/P&gt;&lt;P&gt;kbetr length 11, decimal 2 type curr&lt;/P&gt;&lt;P&gt;netwr length 15, decimal 2 type curr &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;declare three variables temporary.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data : lv_kbetr like vbak-netwr.&lt;/P&gt;&lt;P&gt;data : lv_mglme like vbak-netwr.&lt;/P&gt;&lt;P&gt;data : lv_netwr like vbak-netwr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;clear : lv_kbetr,&lt;/P&gt;&lt;P&gt;         lv_mglme,&lt;/P&gt;&lt;P&gt;         lv_netwr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;move : kbetr to lv_kbetr,&lt;/P&gt;&lt;P&gt;          mglme to lv_mglme,&lt;/P&gt;&lt;P&gt;          netwr to lv_netwr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;lv_kbetr = lv_netwr / lv_mglme.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;move lv_kbetr to kbetr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now see the results.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 Jun 2007 00:00:12 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/type-casting-with-decimals/m-p/2344113#M516919</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-06-07T00:00:12Z</dc:date>
    </item>
    <item>
      <title>Re: type casting with decimals</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/type-casting-with-decimals/m-p/2344114#M516920</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;data : var1 type p decimals 3,&lt;/P&gt;&lt;P&gt;var2 type p decimals 2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;curr and quan are database data type so you can not reffer them in your abap program the abap type is type p.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;P&gt;shiba dutta&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 Jun 2007 01:15:35 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/type-casting-with-decimals/m-p/2344114#M516920</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-06-07T01:15:35Z</dc:date>
    </item>
    <item>
      <title>Re: type casting with decimals</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/type-casting-with-decimals/m-p/2344115#M516921</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I don't believe this is happening becasue of the differences in the data lengths. I think it is because you are dealing with currency fields without referencing the involved currency. Some currencies, eg japanese yen, don't have decimal places, for all I know some may have more than 2. SAP gets round this by defining the attributes of each currency. The currency related variables can only be adjusted to the appropriate number of decimal places when they refer to the currency involved. If no currency reference is provided how can SAP work out how many decimal places you want to work with?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FOR EXAMPLE, create this simple program and you'll see what I mean.&lt;/P&gt;&lt;P&gt;REPORT  ZNRW_CURRENCY                           .&lt;/P&gt;&lt;P&gt;parameters: P_curr1 type t001-waers default 'JPY',&lt;/P&gt;&lt;P&gt;            p_curr2 type t001-waers  default 'USD'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA W_VALUE TYPE marc-VKUMC VALUE 1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;          WRITE:/ W_VALUE CURRENCY P_CURR1,P_CURR1.&lt;/P&gt;&lt;P&gt;          WRITE:/ W_VALUE CURRENCY P_CURR2,P_CURR2.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 Jun 2007 01:45:52 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/type-casting-with-decimals/m-p/2344115#M516921</guid>
      <dc:creator>former_member186741</dc:creator>
      <dc:date>2007-06-07T01:45:52Z</dc:date>
    </item>
  </channel>
</rss>

