Currency Conversion- Urgent

Hi
Currency S_WAERS is in my selection screen.
If i enter USD For S_waers the amount should convert to USD.
If i leave blank it should  take local currency.
Any one pls give me the coding for this.
Thanks
Kumar

Hi,
First, you should judge the amount's reference currency.
I take other currency as example, that is, the amount stores as neither USD nor local currency.
Functions will be used:
get local currency's FM:
1) LOCAL_CURRENCY_GET:
(this function returns the local currency by sales organization and distribution chanel  or plant )
CALL FUNCTION 'LOCAL_CURRENCY_GET'
                   EXPORTING
                        PI_VKORG                =  ??sales organization
                        PI_VTWEG                =  ?  distribution chanel
                        PI_WERKS                =  ?  Plant
                   IMPORTING
                        PE_HWAER                = ?  local currency
                   EXCEPTIONS
                        INVALID_INPUT           = 1
                        CURRENCY_NOT_DETERMINED = 2
                        OTHERS                  = 3
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
        WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
               ENDIF.
2) FMR3_GET_LOCAL_CURRENCY:
(this function returns the local currency by company code)
CALL FUNCTION 'FMR3_GET_LOCAL_CURRENCY'
     EXPORTING
          I_BUKRS       =  ? company code
     IMPORTING
          E_HWAER       =  ? local currency
        E_FIKRS       =
        E_KOKRS       =
   EXCEPTIONS
        INVALID_WAERS = 1
        WRONG_BUKRS   = 2
        OTHERS        = 3
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
        WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
convert the amount to the target currency amont:
CONVERT_TO_LOCAL_CURRENCY
(this function returns the target amount)
      CALL FUNCTION 'CONVERT_TO_LOCAL_CURRENCY'
           EXPORTING
                DATE             = SY-DATUM
                FOREIGN_AMOUNT     =   ? amount
                FOREIGN_CURRENCY =   ? currency the amount stores
                LOCAL_CURRENCY     =   ? target currency
           IMPORTING
                LOCAL_AMOUNT         =    ? target amount
      IF SY-SUBRC <> 0.
        MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
        WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
Therefore, the logic is :
if usd,  CALL FUNCTION 'CONVERT_TO_LOCAL_CURRENCY'   set the target currency as USD then you'll get  target amount
if blank, call the  get local currency's FM  and CALL FUNCTION 'CONVERT_TO_LOCAL_CURRENCY' ,set the target currency as the local currency you get.
Hope it can help you.
regards
vincent.

Similar Messages

  • Currency Conversion using RRC1-Urgent!!

    I have a requirement where I need to create a new currency conversion type. The query displays invoices posted in a particular period and their value in USD. The conversion rate gets posted somewhere in the middle of the period.The conversion happens such that the invoices posted before the date on which the rate was posted pick the previous period's rate, which those posted after that date use the new rate.
    Business requires all invoices falling in a period to use the rate posted in that period and to use the previous month's rate only when the new rate is not available. Can someone let me know what variable time ref. I am supposed to use to acheive this.Any kind of response will be greatly appreciated as this is pretty urgent.
    Thanks
    Akhila.

    Hi Akhila,
    I did not want to say, that the currency rates have to be maintained at a certain date. What I wanted to know is, if the <b>validity date</b> could be influenced as this would be the simpliest solution.
    Nevertheless, what you need is a currency conversion type, that has a variable time reference and is based on 0CALDAY (or another appropriate time InfoObject). Check the period definiton for the time reference. Maybe, "End Month" (respectively "End of Period", ...) could solve the problem. As you probably know, all this has to be done in transaction RRC2.
    If this does not help, it could be useful to describe the currency conversion type's definition as well as a description what validity date is stored in table TCURR.
    Kind regards,
    Stefan

  • URGENT:currency conversion from oracle financials 10.7 to 11i

    Hey all, Any one has the idea about the currency conversion from oracle financials 10.7 to 11i?? how to handle it?? do we need seperate code for currency conversion or is there any software that we can use??

    <BLOCKQUOTE><font size="1" face="Verdana, Arial, Helvetica">quote:</font><HR>Originally posted by Shenba ([email protected]):
    Hey all, anyone has idea how the currency conversion is handled during upgrade of
    for oracle financials 10.7 to 11i. Is there any software available or do we need to do coding for currency conversion.
    Thanks<HR></BLOCKQUOTE>
    null

  • CONVERT_TO_LOCAL_CURRENCY currency conversion errors in Delta mode

    Hello,
    I have been working with SAP via customer messages for a month now with no resolution.  As many of you have experienced, the SAP Level 1 support is pretty useless so I would like to check here to see if I can get some help.
    I found a thread where another user has had the exact same problem as I have. 
    Problem: Exchange rate in Update rules with DELTA mode
    However, there was no answer given to him.  So, if anyone can help, I appreciate it.  Here's the problem:
    When a record comes through 2LIS_13_VDITM (for example), it had a document currency of EUR, a local currency of PLN and a statistical currency of USD.  The first time the record comes through, it comes through just fine.  The exchange rate from EUR to PLN is 3.533.  The statistical currency value is calculated by taking the document currency value and multiplying it by the exchange rate from EUR to PLN to get the local currency.  Then, this local currency is converted to USD by multiplying itself by the PLN to USD exchange rate of 1.519.
    These are the exchange rates that are coming through as key figures on the transaction data.  The problem is when a delta occurs.  The data goes into the ODS and then once the update rules to the cube get it, the signs are backwards on the exchange rates.  This makes sense so that the exchange rate key figures will cancel themselves out, but the SAP code says to calculate the local currency, it must first take the document currency and divide by the exchange rate.  It should still be multiplying because the exchange rate from EUR to PLN is still 3.533.  The negative on the key figure that is being zeroed out tells the code to divide though.
    You cannot simply set the reversal indicator because the values that do come through ok would then be erraneous as the previous poster who had the same issue encountered.  This is really causing some bad data for us.  This is SAP delivered code.  Any help would be appreciated.
    Thanks,
    Brent

    hi,
    chk out various application currency conversion  links
    Need Urgent Help on Currency Conversion Routine
    Currency conversion using transformation rule
    http://help.sap.com/saphelp_nw04/helpdata/en/bc/058f4073b2f30ee10000000a155106/frameset.htm
    http://help.sap.com/saphelp_nw04/helpdata/en/16/088f4073b2f30ee10000000a155106/frameset.htm
    Ramesh

  • BEX Currency conversion created by the business

    Hello,
      I need to convert from USD to other currencies defined by the users in R/3. So the business figures the exchange rate in R/3 and I need to take that value and use it for converting the date in BEx.  Any help?  This is a very urgent requirement so anything would be great.

    Hi,
    You can set up currency converison in the bex query by right clicking the KF and choosing the currency conversion type and a fixed currency to convert to, or providing a variable where users can decide the currency they want.
    To get the rates into BW you can schedule a job (RSIMPCURR) with daily frequency.
    See here for more:
    http://help.sap.com/saphelp_nw04/helpdata/en/ec/076f3b6c980c3be10000000a11402f/content.htm
    http://help.sap.com/saphelp_nw04/helpdata/en/80/1a682de07211d2acb80000e829fbfe/content.htm
    Re: Transfer Exchange RatesHi,
    Hope this helps...

  • End routine for Currency conversion

    Hi,
    I have a requirement in which i have to convert sales and cost into three types of currency as GBP, INR and EUR in cube. i made 3 different fields for sales as well as for cost. But i am unable to write end routine for it.
    Can anyone please help me that how can i solve this problem.
    Roma

    Hi,
    In transformation itself you can do your currency conversion.
    http://help.sap.com/saphelp_nw70/helpdata/en/de/6372426f0f9041e10000000a1550b0/content.htm
    If you want to write a routine in to do conversion, you have to go for start routine instead of end routine.
    Thanks
    BVR

  • Currency Translation Type in queries using currency conversion

    I have a question on the Currency Translation Type (EUR_VAR) that is used in all of the queries using currency conversion on the fly. (currency is maintained automatically nor in table.)
    User wants to use 2 different exchange rates in a single query. The months in 2010 (Actuals) are to
    be converted using Xchangerate-type EURO and the months in 2011 (Planned) to use Xchangerate-type USD.
    But store different rates with different starting dates. This is however not possible because the Currency Translation
    Type is set-up (1) to work with Query Key date - rather than a characteristic in the data and (2) apparently these
    currency translation types only work with time characteristics like 0fiscyear
    My idea is therefor to:
    1. Create a new variable (similar to EXC_RATE) to prompt for a 2nd Exchange Rate type when query starts
    2. Create a new Currency Translation Type (next to EUR_VAR), referencing the new variable or sticking to fixed Xrate type, fixed to EUR
    Is this possible to create Idea (2)
    Many Thanks in Advance.

    The best way would be to create two curr conversion types , one converting to EUR and other to USD .Put them in properties of coressponding KFs in query.For timref in RSCUR , variable time ref can be used individually for two conv types.

  • Currency Conversion  on Piticular date

    Dear All,
                   I have a requirement where in I have to convert the  Purchase Document Currency into USD on  PO Creation Date.
    I did the Currency Conversion in the BEX by creating a currency translation type using the tcode RSCUR. Following are the   settings I have Used for Conversion
    1. Exchange rate type  M
    2  target currency         USD.
    3 Time reference          Current Date.
    Problem is the values are not getting converted to USD on PO Creation date.
    Moreover I wanted the records whose values are more than 50,000 USD.
    Question.
    How to convert the currency from one to another on a Particular date.
    Date for each record is different from one another as stated above.
    Help me out in this case.
    Thank You All
    Regards
    Mahesh

    Dear Raj,
    Thank you for the reply.
    Iam using BI 7 and the tcode rrc1 is obselete in this version.
    So I went to the new tcode rscur and created the currency translation type with the settings below.
    1. Exchange rate type M
    2 Target currency USD.
    3 Time reference Current Date.
    Used this translation key in the Key figure properties for currency translation.
    I went to the source system and on context menu I transferred global settings.
    Do I need to maintain currency keys and exchange rates manually even after transferring global settings?
    I have set in the time reference the PO creation date
    as Special Info Object. Will this work?
    Please let me know.
    Regards,
    Mahesh

  • Help needed with Include ZXRSRU01 in relation with currency conversions

    I'm implementing how to paper: Use variable time references in currency conversions (BW 3.3). When implementing variable exit RSR00001 & write include ZXRSRU01 an issue pops up.
    The relevant code is:
    <i> DATA: l_s_var_range TYPE rrs0_s_var_range.
    IF i_s_rkb1d-infocube EQ 'RHCURCON'.
        IF i_step = '3'.
          LOOP AT i_t_var_range INTO l_s_var_range WHERE vnam EQ 'ZCURDAT'.
            ZCL_IM_CURRCONV=>currdate = l_s_var_range-low.
          ENDLOOP.
        ENDIF.
    ENDIF.</i>
    When implementing the following message pops up:
    "l_s_var_range" has already been declared.
    In another statement ' l_s_var_range ' is already used.
    Any advice how to deal with this issue?
    thanks in advance
    tom

    Hi,
      somebody already declared that workarea (l_s_var_range), so you can directly use that without any declaration (data l_s_var_range type rsr0_.....). you can remove that statement and you can work.
       Otherwise if you want to use to declare your own workarea,
      data ls_range (or any name) type rsr0_....
    DATA: l_s_var_range TYPE rrs0_s_var_range. *** this statement you can remove since somebody declared the same.
    ****or use ur own work area name and use that work area within your code.
    data ls_var_range type rrs0_s_var_range.
    IF i_s_rkb1d-infocube EQ 'RHCURCON'.
    IF i_step = '3'.
    LOOP AT i_t_var_range INTO ls_var_range WHERE vnam EQ 'ZCURDAT'.
    ZCL_IM_CURRCONV=>currdate = ls_var_range-low.
    ENDLOOP.
    ENDIF.
    ENDIF.
    rgrds,
    v.sen.
    Message was edited by:
            Senthilkumar Viswanathan
    Message was edited by:
            Senthilkumar Viswanathan

  • Currency Conversion in WebI Report

    Hi All:
    Need your help in currency conversions using WebI Report.
    Current Scenario: 
        Currency conversions are currently achieved at BEx Query Designer level where target currency is determined through a Selection Variable.
    Proposed Solution:
       As per the Business proposal, BW will be publishing the data to Terradata; a universe will be built on Terradata and a WebI report will be based on this universe.
    Question:
       How can this type of currency translation be achieved in WebI Based  Report?

    Hi,
    Current Scenario:
    Currency conversions are currently achieved at BEx Query Designer level where target currency is determined through a Selection Variable.
    Proposed Solution:
    As per the Business proposal, BW will be publishing the data to Terradata; a universe will be built on Terradata and a WebI report will be based on this universe.
    Question:
    How can this type of currency translation be achieved in WebI Based Report?
    >> You would use the same logic by using a variable in the BEx query designer and Web Intelligence would then leverage the variable from the BEx query.
    ingo

  • Issue regarding currency conversion

    Hi Experts,
    I'm having issue with currency conversion. Default report output values are displaying in 'EURO' and I had created a toolabar with currency conversion buttons. When this button is selected, values has to be changed into user select currency like INR, USD, AUD. Here im triggering with issues, all the values are converted into 0's. Total value is only converting for first time. From next time. its not converting. I'm using FM's  CONVERT_FOREIGN_TO_FOREIGN_CUR,CONVERT_TO_LOCAL_CURRENCY,READ_EXCHANGE_RATE.
    Please provide ur solutions to solve the issue.  
    Thanks and Regards,
    Bharat

    Hi ,
    You can use this block of code..It is used in our project.
      data : l_rate type ukurs_curr,           "Exchange rate
             l_rate_type type kurst_curr,      "Type of rate
             l_l_fact type i,                  "Local factor
             l_f_fact type i.                  "Foreign factor
    check local currency ,foreign currency local amount are not initial
      check foreign_currency is not initial and
            local_currency is not initial and
            local_amount is not initial.
    Calculate exchange rate
        if local_currency = 'MXN' and foreign_currency = 'USD'.
          l_rate_type = 'MXNT'.
       else.
         l_rate_type = 'M'.
       endif.
    *Call FUNCTION module to get exchange rate
      call function 'READ_EXCHANGE_RATE'
        exporting
          date                    = sy-datum
          foreign_currency        = local_currency
          local_currency          = foreign_currency
          type_of_rate            = l_rate_type
       importing
         exchange_rate           = l_rate
         foreign_factor          = l_f_fact
         local_factor            = l_l_fact
       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.
    if l_rate le 0.
      l_rate = l_rate * -1.
    endif.
    Foreign amount
      if l_rate_type = 'MXNT'.
        foreign_amount = local_amount / l_rate .
      else.
        foreign_amount = local_amount * l_rate .
    endif.
      endif.

  • Currency conversion error in SAP HANA

    Hi,
    I am new to SAP HANA and learning to create information views in HANA studio (SAP HANA SP6 on Cloudshare, HANA studio 1.0.68). I am trying to create a simple analytic view (on purchaseOrderItem table in SAP_HANA_EPM_DEMO sample database) to have GrossAmount converted to EUR.
    I added a calculated column as follows:
    When i click on "OK", i get error -
    The check box “Calculate before aggregation” has been unchecked, because the definition of the calculated column contains measures with currency conversion, restricted measures or operands with input parameters. For such a calculated column the calculation is always done after the aggregation."
    and checkbox "calculate before aggregation" get unchecked. See screenshot below:
    Please suggest what could be reason? Thanks in advance.
    Regards,
    Amit

    Hi Amit,
    If you uncheck the "Calculate before aggregation" checkbox and activate the view, you will see in the generated log that a Calc scenario is created. (a view with /olap wrapper). Due to the calc scenario, the aggregation is defined as the default behavior for the KFs and hence the calculation cannot be done before aggregation.
    By the way, I did not understand why do you need calculate before aggregation for a KF which is just a copy of another KF. If you need Gross amount in Local currency and EUR, then just perform the currency conversion without "Calculate before aggregation" checkbox. It will work.
    Regards,
    Ravi

  • Error during currency conversion and consistency check in a sales order

    Hi Experts,
    I am facing the below error in the sales order. The sales order is having so many items. The below error is coming for few items only. I have checked the currency exchange rates also. All are maintained properly.
    Please advice me how to fix this error or which class,methods are responsible for checking the above details while saving the order.
    Thanks,
    Sri

    Hi Christophe,
    FYI
    Error during currency conversion frm &1 to &2 (date &3, ref. curr. &4)
    Message Class - CRM_CUMULATED_I
    Message No     - 013
    Error during currency conversion for &1 and &2
    Message Class - CRM_CUMULATED_I
    Message No     - 008
    Consistency check: Logical key does not match
    Message Class - CRM_CUMULATED_I
    Message No     - 011
    Thanks,
    Sri

  • Credit memo request with currency conversion to EURO

    I have a requirement in which i need to create a Credit Memo Request for the newly created sales organisation using the old billing document number created for old sales organisation.New sales org will have its currency changed to EURO.I referred to a FM named 'Pricing' where the currency conversion is done.
    The requirement is to get the current price in EURO from the price list instead of currency conversion to EUR.The current price has to be extracted from new pricelist.
    Your inputs in this regard is highly appreciated.

    HI
        Am not on SAP system now, so will try to give you
    info with what i can recollect.
       You can use FM: SD_SALESDOCUMENT_CREATE for creating
    Credit Memo Request. Note that reference document and
    reference type should be passed for identifying the
    reference document as invoice. Please consider these as
    initial inputs to explore on the same. Regarding the
    pricing, it can be configured either at order type or
    copy control to carry out new pricing so it can take
    directly from condition records.
        Hope the above info can help you in exploring on the same.
    Kind Regards
    Eswar

  • Local Currency conversion in PO

    Hi
    Iam facing problem in wrong Local currency conversion while doing GR reversal for foriegn currency Subcontract PO.
    Local Currency : EUR
    PO Currency     : HUF
    User has entered wrong Exchange rate in OB08. (Indirect Quotation : HUF -> EUR) & did Goods Receipt with reference to PO. After that Exchange
    rate has been corrected immediately, but some GR documents posted with wrong exchange rate.
    To correct the wrong entries, Again Wrong exchange rate has been updated in OB08 & reversed those material document in MBST. But the strange issue is system calculating different local currency for those reversed documents. The Local currency Amount of Goods receipt document & reversed document local currency amount is not matching,Ideally both should match.
    Following observations on this,
    1. Exchange rate are same in both doucments. I have checked in document Header.
    2. GR Qty & Reversed Qty are same.
    3. PO currency (HUF) amount are same in both doucments.
    4. Finished Material & Raw material are managed in standard Price.
    5. Document date & Posting date are same in both doucments.
    Anybody can explain why the system updates wrong local currency ?
    Thanks in Advance.
    Regards,
    RRS

    I do not remember the Tcode, however it is under SPRO>>General setitings>> currency .. guess it is OB90
    And if the difference is large. check the following:
    Check the exchange rate type you use, next go to OB08 and see if the inverse translation is maintained for your currencies  EUR- HUF and HUF- EUR
    and then check OB07 and see what settings you have for the ex. rate type you have i.e Inv, fixed ...
    You might hit upon something here

Maybe you are looking for

  • Relate to Inserting Record in the Table

    Dear Expert , Records are getting inserted in a table to a perticular limit...then it stops inserting.. when i delete all the records from that table...then again it starts inserting the new records. Again stops after a perticular limit... and goes o

  • AI CS5.1 vrs AI CS6 Performance Issue MacPro

    Hi, I have been happily using AI CS 5.1 (from 5.5) and I have a series of files I created. They are 20x24, 300 DPI and have some type and drawing and a placed 300 DPI 16x20.psd file. They open in about 3 seconds on v5.1, and on v6 they take 3-5 minut

  • Changing preferred media player in Adobe Reader 8.1.2

    Hi, I'm trying to change my preferred media player in the Preferences but the drop down list only contains QT and Flash. Anyway to add another player to the list? My problem is that QT won't play an .avi movie that I want to embed in my PDF file. Tha

  • Unicode vs non-unicode

    Hi All, Can anyone please tell me what is the differenece between unicode and non-unicode SAP systems. I heard that all the new versions are unicode. What is the difference, purpose and significance of these? Thanks Cyrus

  • Upgrade Mac OS 10.5.8

    I heard that once I upgrade from 10.5.8 to snow leopard certain features like iPhoto will no longer be there. Is this true?