cancel
Showing results for 
Search instead for 
Did you mean: 

HELP NEEDED IN CRM IPC JAVA ROUTINE URGENT

Former Member
0 Kudos
141

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

View Entire Topic
ARJUN
Explorer
0 Kudos

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());
        }
    }
}