Cal script question to calculate exchange rate

Hi All expert,
I'm new in Essbase, can anyone help and tell me what's wrong with the following cal script?
I got 10 dimension
- Account
- Month
- Year
- Market
- Product
- Cost center
- Currency
- Version
- Currency type - USDvalue, EURvalue, etc.
For data upload, we'll upload only either USD or EUR value, then based on exchange rate for the month (also loaded as data), try to calculate the value in other currency
/* GET EXCHANGE RATE */
     FIX(@LEVMBRS("3000000000",0),@LEVMBRS("Company",0), @LEVMBRS(Market,0),
          @LEVMBRS(Product,0),@LEVMBRS("Cost Centre",0),@LEVMBRS(Month,0),
          @LEVMBRS(Year,0),@LEVMBRS("Version",0),@LEVMBRS(Currency,0))
          "USDValue" (
          IF (@ISMBR("USD"))
               USDValue;
          ELSE
          EURValue / (@CURRMBR("Year"))->(@CURRMBR("Month"))->(@CURRMBR("Version"))
          ->(@CURRMBR("Currency"))->"CTR_ACC"->"MKT_HK"->"PROD_TRY"->"999999"->"COM_1010"->
          "RPT to EUR ex rate";
          ENDIF;
ENDFIX;
CALC All;
I got stuck after running this script, thanks for all your help in advace.

/* GET EXCHANGE RATE */
     FIX(@LEVMBRS("3000000000",0),@LEVMBRS("Company",0), @LEVMBRS(Market,0),
          @LEVMBRS(Product,0),@LEVMBRS("Cost Centre",0),@LEVMBRS(Month,0),
          @LEVMBRS(Year,0),@LEVMBRS("Version",0),@LEVMBRS(Currency,0))
          "USDValue" (
          IF (@ISMBR("USD"))
               USDValue;
          ELSE
          EURValue / (@CURRMBR("Year"))->(@CURRMBR("Month"))->(@CURRMBR("Version"))
          ->(@CURRMBR("Currency"))->"CTR_ACC"->"MKT_HK"->"PROD_TRY"->"999999"->"COM_1010"->
          "RPT to EUR ex rate";
          ENDIF;
ENDFIX;
CALC All;
I got stuck after running this script, thanks for all your help in advace.I'm not sure what you mean by you got stuck after running the script, can you eloborate? I will point out that there are some things in your script that are a bit odd.
(@CURRMBR("Year"))->(@CURRMBR("Month"))->(@CURRMBR("Version"))->(@CURRMBR("Currency"))
is unnecessary as the fix statement above it will set that all for you.
I think I would rewrite this as
     FIX(@LEVMBRS("3000000000",0),@LEVMBRS("Company",0), @LEVMBRS(Market,0),
          @LEVMBRS(Product,0),@LEVMBRS("Cost Centre",0),@LEVMBRS(Month,0),
          @LEVMBRS(Year,0),@LEVMBRS("Version",0),@LEVMBRS(Currency,0))
          "USDValue" (
          IF ( @ISMBR("USD"))
          "USDValue" = EURValue / "CTR_ACC"->"MKT_HK"->"PROD_TRY"->"999999"->"COM_1010"->"RPT to EUR ex rate";
Else
          "EURValue" = USDValue * "CTR_ACC"->"MKT_HK"->"PROD_TRY"->"999999"->"COM_1010"->"RPT to EUR ex rate";
          ENDIF;
ENDFIX;

Similar Messages

  • How system calculate exchange rate for two currency vise versa automaticaly

    Dear All, i have maintain exchange rate type M with USD to PKR with different time interval. When i run Project System report the system show transaction figures in Controlling Area currency is PKR. However, when i switch to USD currency with translation key (Mean rate as of today) . System do not allow to show the result.
    I know if i maintain exchange rate type M with PKR to USD then system display the result. But my concern is that system should automatically calculate exchange rate from PKR to USD for exchange rate M if as i have already maintained exchange rate m with USD to PKR.
    How system can do it?
    regards
    Saqib Usman

    Hi SAQIB USMAN ,
    Please set  the indicator for INV in OB07 for the exchange rate type M.
    This indicator might not be set in your case.
    Then system calculates using inverse ratio.
    Please read it for your reference and easy understanding
    Indicator: Calculation allowed with inverted exchange rate ?
        Indicator that in the case of a missing exchange rate entry in the system
        for the required translation from one currency into another, the inverted
        exchange rate relationship may also be used.
    Example
        If an entry is missing for the translation of USD into DEM in the system,
        then the translation takes place by means of the entry for the
        tranlsation of DEM into USD, providing the indicator is set.

  • How system calculate Exchange Rate for material?

    I have some doubt how system calculate exchange rate for material when doing GR.
    For example, standard price of material is 0.01 USD per ea. PO is created in foreign currency (THB) with qty: 40,000 ea (THB 2,852.00)
    Actually when I do GR ea then accounting doc is:
    Dr. Inventory 400 USD (12,800 THB)
       Cr. GR/IR    88.64- USD (2,852.00- THB)
       Cr. Variant 311.36- USD (9,948.00- THB)
    for 2nd and 3rd line item, exchange rate M (THB -> USD) is 0.03108 which is correct.
    Could anyone advise where system get exchange rate for 1st line item?

    Hi
    First of all, as mentioned by you, the exchange rate for Item 2 and 3 is not 0.03108.. It is as below, based on the figures given by you...
    Dr. Inventory 400 USD (12,800 THB)........ Exch rate is 0.03125
    Cr. GR/IR 88.64- USD (2,852.00- THB)....... Exch rate is 0.03108
    Cr. Variant 311.36- USD (9,948.00- THB).... Exch rate is 0.0313
    I guess the item 3 is just a derivation from Items 1 and 2.. The Price diff results as a difference between std cost and purchase price...
    I believe, the exchange rate would have been 0.03125 at the time of GR... You need to check this in your system... For sure, it uses  exch rate type M in the standard... Check if 0.03125 (USD -> THB) or 32 THB -> USD exists in your system at all
    Item 2 is based on your PO negotiated rate...
    Regards
    Ajay M

  • Exchange rate EURX not calculate exchange rates between USD and GBP

    We have set ExRt as following:
    Exrt          Usage       Ref. crcy
    EURX     EMU      EUR
    we have "EMU" flag checked also.
    We are maintaining exchange rates (EURX) for EUR with all others currencies.
    We expected that, if we have a CoCode set in GBP and we post a document in USD, SAP will calculate GBP <->USD from exchange rates EURX(USD/EUR) and EURX(GBP/EUR). It seems to be incorrect because the system is ignoring EURX exchange rates and using "M" GBP-USD exchange rate and this was not expected by us.
    Could you please tell me if it is correct to expect SAP calculates USD-GBP Exchange rates from EURX(USD/GBP) Exrate or I am wrong and I need to maintain "M" exchange rates for USD-GBP.
    Thanks in advance

    Hi,
    Please check the following settings :
    Go to IMG --> General Settings ---> Currencies ---> Check Exchange Rate types
    Select the Exchange Rate Euro and check mark the EMU check box . Save it
    Rgds,
    Suresh

  • Calculate realized exchange rate differencies

    During the clearing open items in different currency, system calculate realized exchange rate differencies and post it on GL account , in cleared document there is field  : :Realized exch. rate differencesu201D u201CBSEG-RDIFFu201D and this field should be filled with amount of exchange rate diiferecies but this field is empty. How to customize system to fill this field automatically during the clearing .

    Hi Santosh.
    Thanks for your reply.
    I verified setting in KDF: all reconciliation accounts have  got proper P&L
    GL account-assignments. During clearing open items with payment, system
    calculate exchange rate diff. in proper way but amount of exchange rate
    differences is not entered in field  BSEG-RDIFF. I compare two different
    system and I noticed that in one system amount of exchange rate differences
    is transferred to field BSEG-RDIFF but in second system not. I dont know ,
    why?
    Regards

  • Exchange rate difference while posting ME21N MIGO and MIRO

    Hi All,
    I am facing one problem with exchange rate type between M and EURX  and EURX is maintanined in the SPRO>SAP Netweaver>General Settings>currencies>Check Exchange rate types
    EXRT :  EURX
    Usage    :  EMU Reg,fixed                       
    Ref.Curr    : EUR  
    Buy.ra.at   
    Sall .Rat.At    
    Inv   
    EMU   :X
    FIXED
    Scenario:
    Company(USD) is maintaning Exchange rate type: M and no exchange rates are maintained for USD:EUR or EUR:USD.
    Eur is maintaing in Exchange rate type EURX.
    1) PO (ME21N) is posting for the Vendor on posting date 01/01/2008. Transaction currency is EUR and company code currency is USD and Quantity : 25000
    --> Exchange rate 'M' is not maintained for EUR and values are picking from the EURX Type. In the PO, Exchange rate is picking correctly from the EURX table entries on 01/01/2008.
    2) MIGO: GR  is posted on 01/25/2008 and with 15000 Quantity. Exchange rate is getting currecly from the table on 01/25/2008.
    3) MIRO: IR is posted on 02/15/2008 and Vendor Account is picking correct exchange rate from the table but GR/IR account is caluculations EUR:USD is differntly .
    Note: It is not GR based IR.
    Ex:
    PK AC                DESCRIPTION                    Tran Curr (EUR)    Local Curr  USD
    31 5004789     Vendor Account                       24,718.48-            38,777.12- USD
    86 2525000      A/P-GR/IR NON-INV                24,718.48            38,883.73  USD
    91 6584785      SERV-OTHER O/S                    0.00                 106.61- USD
    Here GR/IR account is cal dirrently.
    4) Credit Memo posted against IR on 03/25/2008. Exchange rate is given while posting CM same as Invoice. But system rate is different. Here also how the GR/IR is calculating is question is it not taking from Table or from any other rate types . Same problem like IR for GR/IR account.
    Entry is posted like
    PK  ACC         Description                            Tran curr(EUR)  Local curr(USD)
    21 5004789     Vendor                                   24,718.48        38,777.13  USD
    96 2525000     /P-GR/IR NON-INV                   24,718.48-      38,892.22- USD
    81 6584785     SERV-OTHER O/S                     0.00            115.09  USD
    This problem is same like GR and also SPL document is posting differenly for ZG and ZL ledger.
    ZL ledger is posting same like Accounting CM document ZG is posting with the different amount . This different amount is nothing but the exchange rate as per the posting date 03/25/2008. Exchange rate on 03/25/2008 is differe from IR date 02/15/2008 .
    ZL ledger is calculating based on the 02/15/2008 date and ZG ledger is calculating based on the 03/25/2008 . Difference between Exchange rate entered in the CM and 03/25/2008 table entry rate is showing exchange rate difference field in the Addtional field in the document display.
    Thanks in Advance.

    Dear Friends,
    Thanks for your helpful answers, actually we are in big export business. So we have to clear 100s of invoice lines with payments at one go, (which obviously being booked at different dates) so it would be very difficult for the user to go one by one invoice.
    My concern is, why system does not calculate exchange rate difference based on actual documents, i.e. Invoice to payments only. I think there might be some configuration needed to implement this functionality.
    Please help.
    Regards

  • How to change exchange rate type for specific pricing condition type

    Hello every one,
    I have a requirement for billing ie VF01.
    currently  all the exchange rate are being calculated with exchange rate type 'M' by default.
    but now client want it should calculate exchange rate with type 'E' for two pricing condition type for all others it should calculate with type 'M'
    Please any body can help me with the exit and code which i can use.
    I have checked exits SDVFX008.
    but how to change exchange rate with type 'E' only for two conditions.
    as changing exchange rate at document header will change exchange rate for all condition type.

    You need to assign KOMK-KURST = 'E', for those two condition types. If it had been item number specific, you could have used USEREXIT_PRICING_PREPARE_TKOMK(RV60AFZZ).
    Do one thing, put a breakpoint on FM 'PRICING' and then do selective runtime analysis.
    Check whether any user exit/BADI/ explicit enhancement are available when condition types are processed in a loop. If nothing is available, try implicit enhancement.
    Link to refer for selective runtime analysis - Runtime Analysis for VOFM
    Also try with VOFM requirements ( not sure whether changing KOMK-KURST is permissable in requirement as normally  we only set sy-subrc values to suppress/allow condition types ). Don't forget to assign requirements against condition types in pricing procedure.

  • Exchange rate calculation in case of partial payment.

    Dear All,
    I have a case in which I need to calculate Exchange rate fluctuation on partial payment.
    Example
    Exchange Rate
    01.04.2011   1USD = 40 INR
    10.04.2011   1USD = 45 INR 
    01.05.2011   1USD = 50 INR
    31.05.2011 1USD = 55 INR
    Invoice Date = 01.04.2011 (1USD = 40 INR)
    Purchase Ac Dr  100 USD
       To Vendor               100 USD
    Partial Payment on 10.04.2011 of 20 USD
    (10.04.2011   1USD = 45 INR  )
    Vendor Ac Dr  20 USD
        To Bank  Cr 20  USD
    Partial Payment on 01.05.2011 of 60 USD
    (10.04.2011   1USD = 50 INR  )
    Vendor Ac Dr  60 USD
        To Bank  Cr 60  USD
    On 31.05.2011 (Month end Revaluation FAGL_FG_VAL)
    (31.05.2011   1USD = 55 INR  )
    If we do the valuation you will find that system create Fluctuation on the basis of Rate maintain on 31.05.2011 .i.e 1 USD = 55 INR.
    Ideally system should generate fluctuation at the time of partial payment only so in that case fluctuation will be less. And this is as per accounting standard also.
    ( I know partial payment  is open item and system will not calculate exchange fluctuation in that case. But then this will be wrong practice.)
    (If I go for residual payment in that case system will clear full invoice amount then and there and create exchange rate fluctuation of full amount which is also wrong).
    Kindly Suggest
    Bittu

    Thanks Atif.
    It mean that we have to show excess loss in our report, which is not actual.
    SAP might be having some solution on this Issue as we cant show wrong B/S.
    This is not a correct practice ,  hope you agree with me.
    bittu

  • Exchange rate accounting (FI) in header of billing invoice

    Hello.
    I have got a question about the exchange rate accounting (FI) in the header of the billing invoice.
    Situation:
    When creating the billing document: on item level the exchange rate type B is correctly taken for the date of billing as determined in the customer master data and the copy control.
    BUT what can I do to fix in the header of the billing invoice the exchange rate accounting M from the month of the sells document (usually they issue the sells document one month and the billing document a month later)??
    I tried to put the correct exchange rate accounting in the sells document VBKD-KURRF, but the value is not taken automatically in the header of the billing document.
    Pressing F1 I get the message: Exchange rate for FI postings
    The exchange rate that the system applies when you create an invoice.
    Use
    Your system is configured in such a way that it expects:
    No prefix (leading sign) for direct rates
    No prefix for indirect rates
    Can anyone help please??
    Thank you.
    Regards,
    Maike

    If you are maintaining the exchange rate in sale order in the field VBKD-KURSK (Exch.rate-acct. in header accounting tab) then this rate will be passed on to the billing document header Exchange rate-accntg field.
    Check whether the PricingExchRate type field is maintained as blank in the copy controls from delivery to billing.
    Regards,
    GSL.

  • Why exchange rate is not displayed correctly when I create the PO in SRM?

    Hi Gurus,
    Yesterday I insert a new row at OB08 tx. at backend system (R/3) for exchange rate of May 17,2010, the value was 10.00. Then I run the BBP_GET_EXRATE program to replicate the info to SRM.
    But when I created a purchase order (PO) the value was 12.24 for exchange rate (this value 12.24 is the value for the previous day May 16, 2010).
    Today morning (May 18, 2010), I inserted another row at R/3 and replicated to SRM, the new value for May 18 was 11. I create another PO and the value was 10 for exchange rate (the value for yesterday).
    But when the PO is transmitted to R/3, the exchange rate is the correct.
    My question is: Why exchange rate is not displayed correctly when I create the PO in SRM? Exists an aspect of memory in SRM that it has to be refreshed? Why SRM is getting the exchange rate for yesterday? Is an issue for time zone?

    Hi Muthu,
    I'm in Extended classic.
    I already discovered what is happening. At the time of being creating the purchase order (PO), it takes the exchange rate of the delivery date of the shopping cart (SC). But when the order is authorized and tries to transmit it to R/3, it takes the exchange rate of the date of creation of the PO.
    Two checks of budget exist:
    1.- When creating PO (exchange rate date of delivery date of the SC's item)
    2.- When authorized and tries to transmit it to R/3 (exchange rate date of creation date of the PO)
    If exchange rate of delivery date of the SC is lower than exchange rate date of creation of the PO, there are cases in which it is marking budget error.
    Now my question is: It is a standard behavior? (to take different exchange rate)

  • Exchange Rate Differences

    Hi experts,
    i understand the general concept of exchange rate differences ie Rate at which one currency may be converted into another. The exchange rate is used when simply converting one currency to another
    but i need to know where it will affect in SAP and what is the use in SAP?
    regards
    anand

    Hi Anand......
    Please read teh following para......
    Exchange Rate Differences
    Use
    When you maintain a foreign currency (FC) business partner and/or accounts, all related bookkeeping is conducted in the FC. As the bookkeeping system must also be conducted in local currency (LC), every FC transaction of this nature also is expressed in LC according to the FC exchange rate on the date of transaction. The daily fluctuations in the FC exchange rates create a situation whereby the balances in LC and FC do not match. The automatic exchange rate differences are designed to periodically recalculate the LC and FC balances, according to the exchange rate on the day the differences are calculated.
    SAP Business One can provide recommendations for executing automatic journal transactions for exchange rate differences in FC business partners and accounts, correct to a given date. The function of the program that calculates exchange rate differences is to reconcile between the FC card balance and the LC balance, considering the fluctuation in the FC exchange rate.
    To access the Exchange Rate Differences function, choose: Financials ® Exchange Rate Differences.
    Hope this may help you to understand the concept of Exchange Rate Difference....
    Also check this Thread.....
    Regards,
    Rahul

  • Exchange rate differences whne clearing documents in local currency

    Hello,
    While clearing customer documents in local currency , the system calculates exchange rate differences in the clearing document. Even if the amount in local currency is 0, the amount in second local currency will have a value. The same is happening also when we clear GR/IR account. In the case of customer clearing, becuse for the exachange rate differences account  are maintaied default values in OKB9, the system cannot split, since there are 2 different account assignments when tolerances are also involved.
    I think that, if the exchange rate differences account wont be popluated while clearing, i will be able to post clearing with tolerance amounts.
    Any idea about how to make the exchange rate differences not to be caulculated for clearing in local currency?
    Thank you,
    S.

    Hi,
    Go to OBY6 and choose your company code.
    For your company code, the check box No forex rate diff. when clearing in LC should have been checked in case if you dont want to calculate the exch rate diff when clearing open items in LC.
    This will solve your issue.
    Thanks,
    Srinu

  • Exchange Rate is stored in field..... ?  (PO Document)

    Hi guys,
    Im using SRM 4.0sp8 with ECS.
    THE PROBLEM:
    I have a PO document that was created in MXN (locally), then the purchaser guy changed to USD and SRM  converted the amount of money succesfuly.     However, the PO document was replicated to R3 with a different amount !
    Im stucked and I dont know how to solve this problem.  
    THE QUESTION:
    - Is the exchange rate stored in some field in the PO document ?
    Thanks for your help !!!
    Regards from Mexico,
    Diego

    Hi Jagdish,
    Finally I found the problem, but I dont know how to solve it!
    The problem:
    1. The purchaser guy creates a Local PO in SRM using MXN as currency
    2. The PO is replicated to R3.  
    3. The purchaser update the PO currency in SRM (he change it from MXN to USD)
    4. The PO update is replicated to R3, at this moment... all the position prices are wrong, it seems that something happened with the exchange rate used !
    Do you have any idea about how to solve it ?
    Thank you !
    BR,
    >Diego

  • User exit for calculating exchange rate in MRER,MRKO,MRNB,MIRO

    Hi All,
    For the transactions MRER,MRKO,MRNB,MIRO I want to change the exchange rate type(tcurv-kurst) which is used to calculate exchange rate .
    For example, exchange rate type 'M' is used to calculate the exchange rate but now i want to use the type 'ITAD' to calculate the exchange rate.Could you suggest some user exit or BADI for achieving this.

    Hi Subasree,
    The user exits for respective tcodes are mentioned below,
    MRER
    Exit Name           Description
    MRER0001            Automotive Evaluated Receipt Settlement (ERS)
    MRKO
    Exit Name           Description
    RMVKON00            Enhancements to report "Settle consignment liabilities"
    MM08R001            User exits for ERS
    MM08R002            User exit for tolerance checks
    MRNB
    Exit Name           Description
    LMR1M001            User exits in Logistics Invoice Verification
    LMR1M002            Account grouping for GR/IR account maintenance
    LMR1M003            Number assignment in Logistics Invoice Verification
    LMR1M004            Logistics Invoice Verification: item text for follow-on docs
    LMR1M005            Logistics Inv. Verification: Release Parked Doc. for Posting
    LMR1M006            Logistics Invoice Verification: Process XML Invoice
    MRMH0001            Logistics Invoice Verification: ERS procedure
    MRMH0002            Logistics Invoice Verification: EDI inbound
    MRMH0003            Logistics Invoice Verification: Revaluation/RAP
    MRMN0001            Message output and creation: Logistics Invoice Verification
    MIRO
    Exit Name           Description
    LMR1M001            User exits in Logistics Invoice Verification
    LMR1M002            Account grouping for GR/IR account maintenance
    LMR1M003            Number assignment in Logistics Invoice Verification
    LMR1M004            Logistics Invoice Verification: item text for follow-on docs
    LMR1M005            Logistics Inv. Verification: Release Parked Doc. for Posting
    LMR1M006            Logistics Invoice Verification: Process XML Invoice
    MRMH0001            Logistics Invoice Verification: ERS procedure
    MRMH0002            Logistics Invoice Verification: EDI inbound
    MRMH0003            Logistics Invoice Verification: Revaluation/RAP
    MRMN0001            Message output and creation: Logistics Invoice Verification
    Hope you will find the required amongst this,
    Regards,
    Soundarya.

  • Exchange rate questions...

    Hi,
    This is not exactly a ABAO question but a general SAP question.
    What is the differnerce between average exchange rate 'M', buying exchange rate and selling exchange rate ?
    Why do we need to use translation ration for exchange rates ?
    What is the use of using direct versus indirect quotationwhile doing general settings for currencies ?
    Regards.
    Rajesh.

    But what is the difference between average exchange rate, buying rate and selling exchange rate.
    Does system has a way to calculate those exchange rate if we specifiy the exchange rate type or we have to input the figures in SPRO tables in that exchange rate type ?
    Regards,
    Rajesh.

Maybe you are looking for

  • Problem in Rough Cut Plan while displaying Date & the nbre of columns

    Hi Expert, During the creation of Rough Cut plan for material Trx MC87, the system display only one Column and the displayed date  is 2012. I Tried to extend the period by using the the button "page Right" and "page left" but there is no  chance. you

  • [JS CS3] ScriptUI button wants to be clicked twice

    Hi I created a sample scriptUI dlg with three buttons: res = ]"dialog { \ ]s: StaticText { text:'Chosissez une période:' }\ ]]period: DropDownList { alignment:'center' }, \ ]]s: StaticText { text:'Chosissez un fichier:' }\ ]]files: DropDownList { ali

  • .Mac Outgoing Server Greyed Out in Mail

    I'm trying to use my original .mac account and all the information goes through fine when using the Mail wizard but when .mac appears in the mail preferences, the Incoming Mail Server is greyed out and hasn't carried over the information I originally

  • Authorization and De-authorization for PC

    If I got rid of old PCs before de-authorizing itunes, what are options to add a new PC since I get error message that I am over 5 PC limit

  • Applikation in NWBC -  wrong environment determination

    Hi all, at the moment im trying to run an SAP application (eRecruiting 604) using the NWBC. At the first sight everything seems to be fine. But as soons as I try to navigate in the POWL (using the action buttons) errors occur or simply nothing happen