<?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 selection in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/currency-selection/m-p/3595087#M865692</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;ok this is how to do it:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Code:&lt;/P&gt;&lt;P&gt;-&lt;/P&gt;&lt;HR originaltext="---------------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Calculate_currency - convert currency to local * &lt;/P&gt;&lt;P&gt;-&lt;/P&gt;&lt;HR originaltext="---------------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FORM calculate_currency&lt;/P&gt;&lt;P&gt;USING&lt;/P&gt;&lt;P&gt;lv_date LIKE wa_data-fldate "date is needed as on current date should be set exchange rate (be carefull with type i left my original)&lt;/P&gt;&lt;P&gt;lv_foreign_amount LIKE lv_totalprice "number&lt;/P&gt;&lt;P&gt;lv_foreign_currency LIKE wa_data-currency "currency identificator&lt;/P&gt;&lt;P&gt;lv_local_currency TYPE c "currency identificator&lt;/P&gt;&lt;P&gt;CHANGING&lt;/P&gt;&lt;P&gt;lv_local_amount TYPE p. "number&lt;/P&gt;&lt;P&gt;&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;&lt;/P&gt;&lt;P&gt;CLIENT = SY-MANDT &lt;/P&gt;&lt;P&gt;date = lv_date&lt;/P&gt;&lt;P&gt;foreign_amount = lv_foreign_amount&lt;/P&gt;&lt;P&gt;foreign_currency = lv_foreign_currency&lt;/P&gt;&lt;P&gt;local_currency = lv_local_currency&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;RATE = 0 &lt;/P&gt;&lt;P&gt;TYPE_OF_RATE = 'M' &lt;/P&gt;&lt;P&gt;READ_TCURR = 'X' &lt;/P&gt;&lt;P&gt;IMPORTING&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;EXCHANGE_RATE = &lt;/P&gt;&lt;P&gt;FOREIGN_FACTOR = &lt;/P&gt;&lt;P&gt;local_amount = gv_local_amount&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOCAL_FACTOR = &lt;/P&gt;&lt;P&gt;EXCHANGE_RATEX = &lt;/P&gt;&lt;P&gt;FIXED_RATE = &lt;/P&gt;&lt;P&gt;DERIVED_RATE_TYPE = &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;IF sy-subrc 0.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO &lt;/P&gt;&lt;P&gt;WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4. &lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDFORM. "Calculate_currencytake a look on exceptions which you get after, it might be helpfull&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 18 Mar 2008 13:31:05 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-03-18T13:31:05Z</dc:date>
    <item>
      <title>currency selection</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/currency-selection/m-p/3595086#M865691</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;I am working on conversion of currency into local currency and USD. I have two put radio buttons &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. Radio button for USD (it will display the total value in USD)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;suggest me the function module to convert the given currency into USD along with the total value here the input is currency and date to the FM. Please provide me the sample code to this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2. Radio buttonLocal currency (Which display the total value in local currency)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am finding the currency from T001 based on company code.I need to convert this currency into local currency.&lt;/P&gt;&lt;P&gt;suggest me the function module to do this and how to use the function module means, what are the parameters we need to (currency and date as input parameters) pass and in what parameters the required value is returned. Please provide me the sample code to this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please provide me the solution ASAP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks and Regards,&lt;/P&gt;&lt;P&gt;Latha.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 18 Mar 2008 13:28:20 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/currency-selection/m-p/3595086#M865691</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-03-18T13:28:20Z</dc:date>
    </item>
    <item>
      <title>Re: currency selection</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/currency-selection/m-p/3595087#M865692</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;ok this is how to do it:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Code:&lt;/P&gt;&lt;P&gt;-&lt;/P&gt;&lt;HR originaltext="---------------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Calculate_currency - convert currency to local * &lt;/P&gt;&lt;P&gt;-&lt;/P&gt;&lt;HR originaltext="---------------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FORM calculate_currency&lt;/P&gt;&lt;P&gt;USING&lt;/P&gt;&lt;P&gt;lv_date LIKE wa_data-fldate "date is needed as on current date should be set exchange rate (be carefull with type i left my original)&lt;/P&gt;&lt;P&gt;lv_foreign_amount LIKE lv_totalprice "number&lt;/P&gt;&lt;P&gt;lv_foreign_currency LIKE wa_data-currency "currency identificator&lt;/P&gt;&lt;P&gt;lv_local_currency TYPE c "currency identificator&lt;/P&gt;&lt;P&gt;CHANGING&lt;/P&gt;&lt;P&gt;lv_local_amount TYPE p. "number&lt;/P&gt;&lt;P&gt;&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;&lt;/P&gt;&lt;P&gt;CLIENT = SY-MANDT &lt;/P&gt;&lt;P&gt;date = lv_date&lt;/P&gt;&lt;P&gt;foreign_amount = lv_foreign_amount&lt;/P&gt;&lt;P&gt;foreign_currency = lv_foreign_currency&lt;/P&gt;&lt;P&gt;local_currency = lv_local_currency&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;RATE = 0 &lt;/P&gt;&lt;P&gt;TYPE_OF_RATE = 'M' &lt;/P&gt;&lt;P&gt;READ_TCURR = 'X' &lt;/P&gt;&lt;P&gt;IMPORTING&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;EXCHANGE_RATE = &lt;/P&gt;&lt;P&gt;FOREIGN_FACTOR = &lt;/P&gt;&lt;P&gt;local_amount = gv_local_amount&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOCAL_FACTOR = &lt;/P&gt;&lt;P&gt;EXCHANGE_RATEX = &lt;/P&gt;&lt;P&gt;FIXED_RATE = &lt;/P&gt;&lt;P&gt;DERIVED_RATE_TYPE = &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;IF sy-subrc 0.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO &lt;/P&gt;&lt;P&gt;WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4. &lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDFORM. "Calculate_currencytake a look on exceptions which you get after, it might be helpfull&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 18 Mar 2008 13:31:05 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/currency-selection/m-p/3595087#M865692</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-03-18T13:31:05Z</dc:date>
    </item>
    <item>
      <title>Re: currency selection</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/currency-selection/m-p/3595088#M865693</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;For both cases, you can use FM CONVERT_TO_LOCAL_CURRENCY.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For the first option, pass LOCAL_CURRENCY as 'USD'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For the second option, pass LOCAL_CURRENCY as T001-WAERS.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As per SAP documentation on 'CONVERT_TO_LOCAL_CURRENCY'&lt;/P&gt;&lt;P&gt;An amount in local currency is calculated from a specified foreign currency amount. For this, you may either specify the translation rate manually (Parameter RATE) or have the system determine it from table TCURR on the basis of the rate type, date and currency key. Because the ratios for the units of the currencies involved in the translation are significant for this translation, table TCURF is always read by the program, and there must be a valid entry there for the data specified. IF exchange rate fixing is defined for the exchange rate type TYPE_OF_RATE or an alternative exchange rate is defined for the currency pair, this information is transferred to the calling program.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When table TCURR is read, the foreign currency key is always taken as the first part of the key and the local currency as the second part.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sample call-up:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
  CALL FUNCTION 'CONVERT_TO_LOCAL_CURRENCY'
    EXPORTING   DATE             = BKPF-WWERT
                FOREIGN_CURRENCY = BKPF-WAERS
               LOCAL_CURRENCY   = T001-WAERS
                FOREIGN_AMOUNT   = BSEG-WRBTR
                 RATE             = BKPF-KURSF
                 TYPE_OF_RATE     = 'M'
    IMPORTING   EXCHANGE_RATE    = KURS
                 LOCAL_AMOUNT     = BSEG-DMBTR
                FOREIGN_FACTOR   = FAKTOR-F
                 LOCAL_FACTOR     = FAKTOR-L
                 FIXED_RATE       = FIXKURS
    EXCEPTIONS  NO_RATE_FOUND    = 4
                NO_FACTORS_FOUND = 8.

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Balaji&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 18 Mar 2008 13:39:56 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/currency-selection/m-p/3595088#M865693</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-03-18T13:39:56Z</dc:date>
    </item>
    <item>
      <title>Re: currency selection</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/currency-selection/m-p/3595089#M865694</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi try this code here int_display is internal table which i used...u have to use ur internal table and field....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOOP AT int_display WHERE  pstdat &amp;lt;&amp;gt; '00000000' AND waers &amp;lt;&amp;gt; ''.&lt;/P&gt;&lt;P&gt;    CALL FUNCTION 'READ_EXCHANGE_RATE'&lt;/P&gt;&lt;P&gt;      EXPORTING&lt;/P&gt;&lt;P&gt;       client                  = sy-mandt&lt;/P&gt;&lt;P&gt;        date                   = int_display-pstdat&lt;/P&gt;&lt;P&gt;        foreign_currency       = int_display-waers&lt;/P&gt;&lt;P&gt;        local_currency         = 'EUR'&lt;/P&gt;&lt;P&gt;        type_of_rate           = 'M'&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;      EXACT_DATE             = ' '&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;     IMPORTING&lt;/P&gt;&lt;P&gt;       exchange_rate           =  int_display-ukurs&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;      FOREIGN_FACTOR          =&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;      LOCAL_FACTOR            =&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;      VALID_FROM_DATE         =&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;      DERIVED_RATE_TYPE       =&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;      FIXED_RATE              =&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;      OLDEST_RATE_FROM        =&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;     EXCEPTIONS&lt;/P&gt;&lt;P&gt;       no_rate_found           = 1&lt;/P&gt;&lt;P&gt;       no_factors_found        = 2&lt;/P&gt;&lt;P&gt;       no_spread_found         = 3&lt;/P&gt;&lt;P&gt;       derived_2_times         = 4&lt;/P&gt;&lt;P&gt;       overflow                = 5&lt;/P&gt;&lt;P&gt;       zero_rate               = 6&lt;/P&gt;&lt;P&gt;       OTHERS                  = 7.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    IF sy-subrc &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;        WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    ENDIF.&lt;/P&gt;&lt;P&gt;    int_display-lcamount = int_display-ukurs * int_display-amount.&lt;/P&gt;&lt;P&gt;      ltot_hdr = ltot_hdr + int_display-LCamount.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;lt;REMOVED BY MODERATOR&amp;gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;thanks Amit&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Alvaro Tejada Galindo on Mar 18, 2008 6:19 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 18 Mar 2008 13:46:22 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/currency-selection/m-p/3595089#M865694</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-03-18T13:46:22Z</dc:date>
    </item>
  </channel>
</rss>

