on 2012 Jul 17 10:06 AM
Hi Experts,
I am replicating the pricing routines from ECC to CRM end in JAVA codes.
I wanted to know how do we get the Sales organization reference currency in JAVA code.? In ECC a standard FM 'TVKO_SINGLE_READ' is made use of. to get the currency for the sales organization.
However, I made use of APIs like:
IPricingDocumentUserExit doc = pricingItem.getUserExitDocument();
String currency = doc.getDocumentCurrencyUnit().toString();
String currency1 = doc.getLocalCurrencyUnit().toString();
I am not sure whether both of the APIs above i.e. getDocumentCurrencyUnit and getLocalCurrencyUnit returns the same or have different functionality.?
Actually I have to get the currency of the sales organization and then check it against the currency for the order document and if both are not same, then the amount is converted into local currency amount .
Also It would be highly appreciated if someone of you experts help me out in using API for converting to local currency in JAVA(pricingEngine.convertTo).?
Regards,
Mayank
Request clarification before answering.
Hi Mayank,
Both can be different.
For a company code there can be only one currency and company code currency is called local currecny.
Document currency is the currency in the PO, which then reflects in the subsequent GR & IR posted for the PO.
Please see if this code helps to fetch the value of both.
public class SetCurrencies extends PricingPrepareFormulaAdapter {
public void addAttributeBindings(IItemUserExitAccess itemUserExitAccess) {
IDocumentUserExitAccess document = itemUserExitAccess.getDocument();
if (document.getDocumentCurrency() != null) {
addAttribute(itemUserExitAccess, "DOCUMENT_CURRENCY", document.getDocumentCurrency().getUnitName());
}
if (document.getLocalCurrency() != null) {
addAttribute(itemUserExitAccess, "LOCAL_CURRENCY", document.getLocalCurrency().getUnitName());
}
}
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
16 | |
2 | |
2 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.