on 11-30-2011 5:36 PM
Hello,
I need some help with currency conversions. I am working on a workflow process. One of the steps in the workflow is conditional, based on whether the total value is greater that a certain amount. The ranges are maintained in USD, so I need to convert from the document currency to USD.
Here is what I have tried so far.
fromCcyBean=doc.getCurrency();
toCcyBean=IBeanHomeLocator.lookup(session, CurrencyIBeanHomeIfc.sHOME_NAME).findUnique("USD");
convSRFCost=IBeanHomeLocator.lookup(session, CurrencyConversionIBeanHomeIfc.sHOME_NAME).findUnique(fromCcyBean,toCcyBean);
the findUnique method of CurrencyConversionIBeanHomeIfc takes SimpleObjectReferenceIfc as the input
findUnique(SimpleObjectReferenceIfc from, SimpleObjectReferenceIfc to)
so the error I am getting is
reflection error: bsh.ReflectError: Method findUnique( com.sap.odp.common.db.LocalizedObjectReference, com.sap.odp.api.doccommon.masterdata.CurrencyIBeanImpl ) not found in class'com.sap.odp.api.doccommon.masterdata.CurrencyConversionIBeanHomeImpl'
I tried using getObjectReference() but that did not work either.
Can anyone please advise me on how to get the CurrencyConversionBean, so I can get the conversion rates.
Please let me know if I my approach is incorrect.
Thanks,
MP
Hi
getObjectReference() is working fine for me. try the below code
fromCcyBeandoc=doc.getCurrency();
fromCcyBeanHome=IBeanHomeLocator.lookup(session, com.frictionless.api.doccommon.masterdata.CurrencyIBeanHomeIfc.sHOME_NAME
);
fromCcyBean = fromCcyBeanHome.find(fromCcyBeandoc);
fromCcyBeanName = fromCcyBean.getObjectReference();
toCcyBeanHome=IBeanHomeLocator.lookup(session, com.frictionless.api.doccommon.masterdata.CurrencyIBeanHomeIfc.sHOME_NAME
);
toCcyBean = toCcyBeanHome.findUnique("USD");
toCcyBeanName = toCcyBean.getObjectReference();
convSRFCost=IBeanHomeLocator.lookup(session, com.frictionless.api.doccommon.masterdata.CurrencyConversionIBeanHomeIfc.sHOME_NAME).findUnique(fromCcyBeanName,toCcyBeanName);
CurrencyRate = convSRFCost.getRate();
Regards
Mudit Saini
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.