<?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: currency conversion in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/currency-conversion/m-p/2794318#M652093</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Shanthi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Try CONVERT_TO_FOREIGN_CURRENCY &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Have a look at the below link for an example.&lt;/P&gt;&lt;P&gt;&lt;A class="jive_macro jive_macro_thread" href="https://community.sap.com/" __jive_macro_name="thread" modifiedtitle="true" __default_attr="101751"&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Lijo Joseph&lt;/P&gt;&lt;P&gt;*Reward if useful&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: &lt;/P&gt;&lt;P&gt;        Lijo Vazhappilly&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 01 Sep 2007 11:49:19 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-09-01T11:49:19Z</dc:date>
    <item>
      <title>currency conversion</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/currency-conversion/m-p/2794317#M652092</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi experts,&lt;/P&gt;&lt;P&gt;               Can anybody give me the Function Module name to convert one currency into another currency with the mandatory parameters. I used a Function module HR_ECM_CONVERT_CURRENCY to convert amount from EUR to DEM but if i give 1, the amount in DEM comes as 0. if i give 1.0, then it returns, 2. and for 1.00, it returns 20. So for a same number with different decimal places, it returns a dfferent amount. What is the actual conversion taking place here. Using which FM will provide the correct conversion. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance,&lt;/P&gt;&lt;P&gt;Shanthi.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 01 Sep 2007 11:42:34 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/currency-conversion/m-p/2794317#M652092</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-09-01T11:42:34Z</dc:date>
    </item>
    <item>
      <title>Re: currency conversion</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/currency-conversion/m-p/2794318#M652093</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Shanthi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Try CONVERT_TO_FOREIGN_CURRENCY &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Have a look at the below link for an example.&lt;/P&gt;&lt;P&gt;&lt;A class="jive_macro jive_macro_thread" href="https://community.sap.com/" __jive_macro_name="thread" modifiedtitle="true" __default_attr="101751"&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Lijo Joseph&lt;/P&gt;&lt;P&gt;*Reward if useful&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: &lt;/P&gt;&lt;P&gt;        Lijo Vazhappilly&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 01 Sep 2007 11:49:19 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/currency-conversion/m-p/2794318#M652093</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-09-01T11:49:19Z</dc:date>
    </item>
    <item>
      <title>Re: currency conversion</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/currency-conversion/m-p/2794319#M652094</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Check the below link :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://www.sdn.sap.com/irj/sdn/wiki?path=/display/snippets/fm%2bcurrency%2bconversion" target="test_blank"&gt;https://www.sdn.sap.com/irj/sdn/wiki?path=/display/snippets/fm%2bcurrency%2bconversion&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Seshu&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 01 Sep 2007 11:54:00 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/currency-conversion/m-p/2794319#M652094</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-09-01T11:54:00Z</dc:date>
    </item>
    <item>
      <title>Re: currency conversion</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/currency-conversion/m-p/2794320#M652095</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hiii ,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; You can use the  field kursk from vbrp directly to get the rate of dollar  or dem at that date and directly multipy the rate with it .You will get the local currency amount .&lt;/P&gt;&lt;P&gt;  Or else u can use the function module  suggested by others &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;Rupa&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 01 Sep 2007 12:20:11 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/currency-conversion/m-p/2794320#M652095</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-09-01T12:20:11Z</dc:date>
    </item>
    <item>
      <title>Re: currency conversion</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/currency-conversion/m-p/2794321#M652096</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;&lt;/P&gt;&lt;P&gt;CURRENCY_AMOUNT_SAP_TO_DISPLAY &lt;/P&gt;&lt;P&gt;Convert currency value from value stored in SAP to displayed currency &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CURRENCY_AMOUNT_DISPLAY_TO_SAP &lt;/P&gt;&lt;P&gt;Convert currency value from displayed currency value to value stored in SAP &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CONVERT_TO_FOREIGN_CURRENCY&lt;/P&gt;&lt;P&gt;Convert local currency to foreign currency.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CONVERT_TO_LOCAL_CURRENCY&lt;/P&gt;&lt;P&gt;Convert from foreign currency to local currency&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;HRWPC_RFC_CURCY_TEXT_GET&lt;/P&gt;&lt;P&gt;Get text description for Currency Key&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;This is a sample report to convert EUR to GBP&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;DATA: gd_fcurr TYPE tcurr-fcurr,
      gd_tcurr TYPE tcurr-tcurr,
      gd_date  TYPE sy-datum,
      gd_value TYPE i.

gd_fcurr = 'EUR'.
gd_tcurr = 'GBP'.
gd_date  = sy-datum.
gd_value = 10.

PERFORM currency_conversion USING gd_fcurr
                                  gd_tcurr
                                  gd_date
                         CHANGING gd_value.



* Convert value to Currency value 
*&amp;amp;---------------------------------------------------------------------*
*&amp;amp;      Form  currency_conversion
*&amp;amp;---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
*      --&amp;gt;P_GD_FCURR  text
*      --&amp;gt;P_GD_TCURR  text
*      --&amp;gt;P_GD_DATE   text
*      &amp;lt;--P_GD_VALUE  text
*----------------------------------------------------------------------*
FORM currency_conversion  USING    p_fcurr
                                   p_tcurr
                                   p_date
                          CHANGING p_value.

  DATA: t_er        TYPE tcurr-ukurs,
        t_ff        TYPE tcurr-ffact,
        t_lf        TYPE tcurr-tfact,
        t_vfd       TYPE datum,
        ld_erate(12)   TYPE c.

  CALL FUNCTION 'READ_EXCHANGE_RATE'
    EXPORTING
*       CLIENT                  = SY-MANDT
      date                    = p_date
      foreign_currency        = p_fcurr
      local_currency          = p_tcurr
      TYPE_OF_RATE            = 'M'
*       EXACT_DATE              = ' '
   IMPORTING
      exchange_rate           = t_er
      foreign_factor          = t_ff
      local_factor            = t_lf
      valid_from_date         = t_vfd
*       DERIVED_RATE_TYPE       =
*       FIXED_RATE              =
*       OLDEST_RATE_FROM        =
   EXCEPTIONS
     no_rate_found           = 1
     no_factors_found        = 2
     no_spread_found         = 3
     derived_2_times         = 4
     overflow                = 5
     zero_rate               = 6
     OTHERS                  = 7
            .
  IF sy-subrc EQ 0.
    ld_erate = t_er / ( t_ff / t_lf ).
    p_value = p_value * ld_erate.
  ENDIF.
ENDFORM.                    " currency_conversion
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;This report is to convert  USD to JPY&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;data: w_dec1 like tcurx-currdec,
w_amt like ekpo-netwr,
w_rate like tcurr-ukurs,
w_fact1 like tcurr-ffact,
w_fact2 like tcurr-ffact.
 
 
parameters:
p_curr1 like tcurc-waers default 'USD',
p_amt1 like ekpo-netwr default '100',
p_curr2 like tcurc-waers default 'JPY',
pdate like sy-datum default sy-datum.
 
end-of-selection.
  write:
  / 'Entered:',
  / ' from currency:', p_amt1 currency p_curr1, p_curr1, '&amp;lt;-', p_amt1,
  / ' to currency :', p_curr2,
  / ' on :', pdate.
  CALL FUNCTION 'FWOS_CURRENCY_DECIMALS_READ'
    EXPORTING
      I_CURRENCY         = p_curr1
    IMPORTING
      E_DECIMALS         = w_dec1
    EXCEPTIONS
      I_CURRENCY_INITIAL = 1
      OTHERS             = 2.
  IF SY-SUBRC &amp;lt;&amp;gt; 0.
    w_dec1 = 2.
  ENDIF.
  p_amt1 = p_amt1 * 10 ** ( w_dec1 - 2 ).
  write:
  / 'after adjusting using currency decimals:',
  / ' from currency', p_amt1 currency p_curr1, p_curr1,
  '&amp;lt;-', p_amt1, '(', w_dec1, ')'.
 
  CALL FUNCTION 'CONVERT_TO_FOREIGN_CURRENCY'
  EXPORTING
* CLIENT = SY-MANDT
  DATE = pdate
  FOREIGN_CURRENCY = p_curr2
  LOCAL_AMOUNT = p_amt1
  LOCAL_CURRENCY = p_curr1
* RATE = 0
* TYPE_OF_RATE = 'M'
* READ_TCURR = 'X'
  IMPORTING
  EXCHANGE_RATE = w_rate
  FOREIGN_AMOUNT = w_amt
  FOREIGN_FACTOR = w_fact1
  LOCAL_FACTOR = w_fact2
* EXCHANGE_RATEX =
* DERIVED_RATE_TYPE =
* FIXED_RATE =
  EXCEPTIONS
  NO_RATE_FOUND = 1
  OVERFLOW = 2
  NO_FACTORS_FOUND = 3
  NO_SPREAD_FOUND = 4
  DERIVED_2_TIMES = 5
  OTHERS = 6.
  IF SY-SUBRC &amp;lt;&amp;gt; 0.
    write: / 'Conversion to for.curr. failed:',
    p_curr1, '-&amp;gt;', p_curr2, 'err.code=', sy-subrc.
  ELSE.
    write: / 'to For.curr:', p_amt1 currency p_curr1, p_curr1, '-&amp;gt;',
    w_amt currency p_curr2, p_curr2,
    '(', w_rate, ')', w_fact1, w_fact2.
  ENDIF.
 
  CALL FUNCTION 'CONVERT_TO_LOCAL_CURRENCY'
  EXPORTING
* CLIENT = SY-MANDT
  DATE = pdate
  FOREIGN_AMOUNT = p_amt1
  FOREIGN_CURRENCY = p_curr1
  LOCAL_CURRENCY = p_curr2
* RATE = 0
* TYPE_OF_RATE = 'M'
* READ_TCURR = 'X'
  IMPORTING
  EXCHANGE_RATE = w_rate
  FOREIGN_FACTOR = w_fact1
  LOCAL_AMOUNT = w_amt
  LOCAL_FACTOR = w_fact2
* EXCHANGE_RATEX =
* FIXED_RATE =
* DERIVED_RATE_TYPE =
  EXCEPTIONS
  NO_RATE_FOUND = 1
  OVERFLOW = 2
  NO_FACTORS_FOUND = 3
  NO_SPREAD_FOUND = 4
  DERIVED_2_TIMES = 5
  OTHERS = 6.
  IF SY-SUBRC &amp;lt;&amp;gt; 0.
    write: / 'Conversion to loc.curr. failed:',
    p_curr1, '-&amp;gt;', p_curr2, 'err.code=', sy-subrc.
  ELSE.
    write: / 'to Loc.curr:', p_amt1 currency p_curr1, p_curr1, '-&amp;gt;',
    w_amt currency p_curr2, p_curr2,
    '(', w_rate, ')', w_fact1, w_fact2.
  ENDIF.

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Check this link&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.sapdevelopment.co.uk/fmodules/curr_distosap.htm" target="test_blank"&gt;http://www.sapdevelopment.co.uk/fmodules/curr_distosap.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Reward all helpfull answers&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Pavan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 01 Sep 2007 12:45:17 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/currency-conversion/m-p/2794321#M652096</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-09-01T12:45:17Z</dc:date>
    </item>
  </channel>
</rss>

