<?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: function that converts an amount in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/function-that-converts-an-amount/m-p/6857756#M1475217</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;DEL&gt;You have to use the BAPI: BAPI_CURRENCY_GETDECIMALS to get how many decimals are defined for the currency&lt;/DEL&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;U&gt;Edited by: Suhas Saha on Apr 29, 2010 4:53 PM&lt;/U&gt;: &lt;/P&gt;&lt;P&gt;If it is a report output or a form you have to use the Reference Currency field. It will automatically format your output based on the currency code. Else you have the BAPI_CURRENCY_CONV_TO_EXTERNAL to convert to external format.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 29 Apr 2010 11:19:41 GMT</pubDate>
    <dc:creator>SuhaSaha</dc:creator>
    <dc:date>2010-04-29T11:19:41Z</dc:date>
    <item>
      <title>function that converts an amount</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/function-that-converts-an-amount/m-p/6857754#M1475215</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;There is a function that converts an amount in accordance with WAERS input.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;example&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;amount 100234&lt;/P&gt;&lt;P&gt;input waers with 2 decimal&lt;/P&gt;&lt;P&gt;output 1002,34&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;amount 1002,34&lt;/P&gt;&lt;P&gt;input waers with 3 decimal&lt;/P&gt;&lt;P&gt;output 100,234&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: francesco aiello on Apr 29, 2010 1:10 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Apr 2010 11:02:15 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/function-that-converts-an-amount/m-p/6857754#M1475215</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-04-29T11:02:15Z</dc:date>
    </item>
    <item>
      <title>Re: function that converts an amount</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/function-that-converts-an-amount/m-p/6857755#M1475216</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi francesco,&lt;/P&gt;&lt;P&gt;if anyway you catch the number of decimal places inot a number through string manipulation,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;say you get the number of decimal places as n,

what you can do is,

divisor = '1'.
amount = '10094'.

do n times. " say 2
divisor = divisor * 10.  
enddo.
** now your divisor becomes 100!

now divide your amount--
amount = amount / divisor.  " now amount = 10094 / 100 = 100.94&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;Just a suggestion, you may have more efficient ways to do it.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sumit&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Apr 2010 11:14:57 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/function-that-converts-an-amount/m-p/6857755#M1475216</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-04-29T11:14:57Z</dc:date>
    </item>
    <item>
      <title>Re: function that converts an amount</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/function-that-converts-an-amount/m-p/6857756#M1475217</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;DEL&gt;You have to use the BAPI: BAPI_CURRENCY_GETDECIMALS to get how many decimals are defined for the currency&lt;/DEL&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;U&gt;Edited by: Suhas Saha on Apr 29, 2010 4:53 PM&lt;/U&gt;: &lt;/P&gt;&lt;P&gt;If it is a report output or a form you have to use the Reference Currency field. It will automatically format your output based on the currency code. Else you have the BAPI_CURRENCY_CONV_TO_EXTERNAL to convert to external format.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Apr 2010 11:19:41 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/function-that-converts-an-amount/m-p/6857756#M1475217</guid>
      <dc:creator>SuhaSaha</dc:creator>
      <dc:date>2010-04-29T11:19:41Z</dc:date>
    </item>
    <item>
      <title>Re: function that converts an amount</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/function-that-converts-an-amount/m-p/6857757#M1475218</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;There are two FM that can help you:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. BAPI_CURRENCY_CONV_TO_EXTERNAL :  This converts currency amounts from SAP internal data formats into external data formats.&lt;/P&gt;&lt;P&gt;2.BAPI_CURRENCY_CONV_TO_INTERNAL : This converts currency amounts from SAP external data formats into internal data formats.&lt;/P&gt;&lt;P&gt;&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;Sana.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Apr 2010 11:20:29 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/function-that-converts-an-amount/m-p/6857757#M1475218</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-04-29T11:20:29Z</dc:date>
    </item>
    <item>
      <title>Re: function that converts an amount</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/function-that-converts-an-amount/m-p/6857758#M1475219</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;   How about as follows.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;       WRITE int  CURRENCY 'USD'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;          USD has 2 decimal&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;   Gaito&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Apr 2010 11:22:20 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/function-that-converts-an-amount/m-p/6857758#M1475219</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-04-29T11:22:20Z</dc:date>
    </item>
  </channel>
</rss>

