The views expressed on this blog are my own and do not necessarily reflect the views of Oracle.

Tuesday, 17 June 2014

Currency Control Fields in PeopleSoft

People working in Financials or Money related modules in PeopleSoft might come across situations where they need to format the amounts to the format which is more common to the transaction currency used. This might seem to be a simple task if you are always working in same currency say USD. The amounts can be formatted using PeopleCode or other methods to display in the format which is required for your client (eg. 98.53 USD). But the situation become little complicated if you are working for a firm where the PeopleSoft is implemented globally and you have many multi currency transactions. In that case, formatting the field using PeopleCode for each and every currency using an IF or Evaluate logic will become pretty cumbersome.

PeopleSoft has provided a much simpler mechanism to do the same without writing any PeopleCode. This is called as currency control field.
 
Currency Control Field in PeopleSoft
Fig 1. Record Field Properties - Currency Control Field

This property can be found on the record field property. To make this work, you should be having a field which stores the currency code (usually CURRENCY_CD field) in the same record and the multicurrency option set in the application level. Once you have the field and options set, just mention the field name which contains the currency code in the Currency Control Field option in the record field property. Setting this option will automatically take care of the currency symbol, decimal digits and the scale of the number field. This helps you avoid a lot many PeopleCode. I know this is an obvious fact for those working in financials, but may be of a lot more help to the newbie’s.

As I mentioned earlier, you might need a field in the record which contains the currency code for the corresponding amount. What if you don’t have that field and you are arriving at the amount dynamically. PeopleSoft has again extended a little bit of help in this regard with a built in function called RoundCurrencyRoundCurrency function will return the amount with decimal precision formatted to the currency code passed. The syntax of the function is as shown below.
RoundCurrency(amount,currency code,effective date);

/* The below example will return the currency in AUD format effective today. */
/* Instead of hard coding the currency, you can pass dynamic values in real scenarios. */

LEDGER.AMOUNT.Value = RoundCurrency(AP_AMOUNTS_WRK.AMOUNT.Value,”AUD”,%Date);



No comments:

Post a Comment

Followers