<?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 currrency conversion in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/currrency-conversion/m-p/2328144#M511882</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Friends,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;   i want to convert CAD in to USD Dollar,but if use this function module ,its converting,but slight difference is coming in the values ,this is becoz the exchange rate is not updatd in this FM.&lt;/P&gt;&lt;P&gt;EG: 1 dollar equalt to 40.2 now &lt;/P&gt;&lt;P&gt;    but this function module is showing 45.&lt;/P&gt;&lt;P&gt;can any one please tell how to rectify it.or any other function module is der for this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA : L_NETWR TYPE VBAP-NETWR.&lt;/P&gt;&lt;P&gt;CALL FUNCTION 'CONVERT_TO_LOCAL_CURRENCY'&lt;/P&gt;&lt;P&gt;     EXPORTING&lt;/P&gt;&lt;P&gt;          DATE             = SY-DATUM&lt;/P&gt;&lt;P&gt;          FOREIGN_AMOUNT   = '10.00'&lt;/P&gt;&lt;P&gt;          FOREIGN_CURRENCY = 'CAD'&lt;/P&gt;&lt;P&gt;          LOCAL_CURRENCY   = 'USD'&lt;/P&gt;&lt;P&gt;     IMPORTING&lt;/P&gt;&lt;P&gt;          LOCAL_AMOUNT     = L_NETWR&lt;/P&gt;&lt;P&gt;     EXCEPTIONS&lt;/P&gt;&lt;P&gt;          NO_RATE_FOUND    = 1&lt;/P&gt;&lt;P&gt;          OVERFLOW         = 2&lt;/P&gt;&lt;P&gt;          NO_FACTORS_FOUND = 3&lt;/P&gt;&lt;P&gt;          NO_SPREAD_FOUND  = 4&lt;/P&gt;&lt;P&gt;          DERIVED_2_TIMES  = 5&lt;/P&gt;&lt;P&gt;          OTHERS           = 6.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;WRITE: L_NETWR.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 08 Jun 2007 05:31:21 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-06-08T05:31:21Z</dc:date>
    <item>
      <title>currrency conversion</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/currrency-conversion/m-p/2328144#M511882</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Friends,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;   i want to convert CAD in to USD Dollar,but if use this function module ,its converting,but slight difference is coming in the values ,this is becoz the exchange rate is not updatd in this FM.&lt;/P&gt;&lt;P&gt;EG: 1 dollar equalt to 40.2 now &lt;/P&gt;&lt;P&gt;    but this function module is showing 45.&lt;/P&gt;&lt;P&gt;can any one please tell how to rectify it.or any other function module is der for this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA : L_NETWR TYPE VBAP-NETWR.&lt;/P&gt;&lt;P&gt;CALL FUNCTION 'CONVERT_TO_LOCAL_CURRENCY'&lt;/P&gt;&lt;P&gt;     EXPORTING&lt;/P&gt;&lt;P&gt;          DATE             = SY-DATUM&lt;/P&gt;&lt;P&gt;          FOREIGN_AMOUNT   = '10.00'&lt;/P&gt;&lt;P&gt;          FOREIGN_CURRENCY = 'CAD'&lt;/P&gt;&lt;P&gt;          LOCAL_CURRENCY   = 'USD'&lt;/P&gt;&lt;P&gt;     IMPORTING&lt;/P&gt;&lt;P&gt;          LOCAL_AMOUNT     = L_NETWR&lt;/P&gt;&lt;P&gt;     EXCEPTIONS&lt;/P&gt;&lt;P&gt;          NO_RATE_FOUND    = 1&lt;/P&gt;&lt;P&gt;          OVERFLOW         = 2&lt;/P&gt;&lt;P&gt;          NO_FACTORS_FOUND = 3&lt;/P&gt;&lt;P&gt;          NO_SPREAD_FOUND  = 4&lt;/P&gt;&lt;P&gt;          DERIVED_2_TIMES  = 5&lt;/P&gt;&lt;P&gt;          OTHERS           = 6.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;WRITE: L_NETWR.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 08 Jun 2007 05:31:21 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/currrency-conversion/m-p/2328144#M511882</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-06-08T05:31:21Z</dc:date>
    </item>
    <item>
      <title>Re: currrency conversion</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/currrency-conversion/m-p/2328145#M511883</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;HI,&lt;/P&gt;&lt;P&gt;Here is the Example program &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;Regards&lt;/P&gt;&lt;P&gt; Sudheer&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 08 Jun 2007 05:34:10 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/currrency-conversion/m-p/2328145#M511883</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-06-08T05:34:10Z</dc:date>
    </item>
    <item>
      <title>Re: currrency conversion</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/currrency-conversion/m-p/2328146#M511884</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi&lt;/P&gt;&lt;P&gt;good&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if you look at table TCURX, the # of decimals for LUF is 0. This means that the value that is stored in the DB and the value that you work with in your program should actually be 100 times smaller than the actual value. TCURX is used to adjust the value when you WRITE it out using the CURRENCY attribute,so check your value that you are passing,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;mrutyun^&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 08 Jun 2007 05:36:36 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/currrency-conversion/m-p/2328146#M511884</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-06-08T05:36:36Z</dc:date>
    </item>
  </channel>
</rss>

