MathNumericStructureConversion

MathNumeric Structure Conversion

Major Business Rule

Object Name: B0000197

Parent DLL: CALLBSFN

Location: Client/Server

Language: C

Functional Description

Purpose

When dealing with multi-currency intercompany journal entries, the entry programs require all amounts within a 

document to be of the same (base) currency.  The table triggers, however, convert the amounts to the account company's 

currency prior to storing in the Transaction Ledger table (F0911).  This business function converts an amount from base 

currency to company currency or company currency to base currency.


Setup Notes and Prerequisites


Special Logic




Technical Specification

If base currency code is the same as the company currency code or ledger type is not 'AA', copy input amount to output 

amount and return.

If company currency code is blank, use the company to determine the currency code.  Retrieve base and company 

Currency Code Decimals.

If base currency code decimals is the same as the company currency code decimals, copy input amount to output 

amount.

Change currency code of output amount to base currency code if mode is 'I'.

Change currency code of output amount to company currency code if mode is 'A' or 'U'.

If base currency code decimals is different than the company currency code decimals, copy input amount to output 

amount.

If mode is 'I' and base decimals is less than denominated decimals, mult amount by 10 x number of times (where x = 

decimal difference).  If mode is 'I'and base decimals is greater than denominated decimals' mult amount by .1 x number of 

times (where x = decimal difference).  Change currency code and currency decimals of output amount to base currency 

code and currency decimals if mode is 'I'.

If mode is 'A' or 'U' and base decimals is less than denominated decimals, mult amount by .1 x number of times (where 

x = decimal diff).  If mode is 'A' or 'U' and base decimals is greater than denominated decimals, mult amount by 10 x 

number of times (where x = decimal diff.).  Change currency code and currency decimals of output amount to denominated 

currency code and currency decimals if mode is 'A' or 'U'.

^

Data Structure

D0000197 - MathNumeric Structure Conversion

This business function is used immediately after a fetch of unposted F0911 records and immediately 
before add/update to the F0911 table.  It's use is only required if you are dealing with journal entries 

in the AA ledger that can be a multi-currency intercompany transactions.  Its' use is only required 

in G/L transaction (F0911) entry programs and the G/L Post.  You should condition the call to this 

business function with currency being turned on and multi-currency intercompany journal entries being 

turned on.  Both of these values are G/A constants found in F0009.


The purpose of this business function is to convert a MathNumeric amount to the correct currency.  

When dealing with multi-currency intercompany transactions, you need to see the amount in the entry 

programs in the base or originating currency.  But when the amount is fetched or put into the database, it 

is or needs to be in the transaction company currency.


You must pass in either the Currency Code Denominated (Transaction Company Currency Code) or the 

Transaction Company Number.  It is more effeicent if you already know the transaction company currency 

code to pass this in the Currency Code Denominated.

^

Parameter NameData ItemData TypeReq/OptI/O/Both
mnAmountInMATH01MATH_NUMERICREQINPUT

- - - Good Performance Low Value. 

szCurrencyCodeBaseBCRCcharREQINPUT

A code that represents the currency of the company for a transaction. For a foreign currency transaction, this is the currency code of the 
domestic side of the transaction.

szCurrencyCodeDenomCRCXcharOPTINPUT

A code that indicates the currency in which an amount is denominated.

szCompanyCOcharREQINPUT

A code that identifies a specific organization, fund, or other reporting entity. The company code must already exist in the Company 
Constants table (F0010) and must identify a reporting entity that has a complete balance sheet. At this level, you can have intercompany 
transactions. Note: You can use company 00000 for default values such as dates and automatic accounting instructions. You cannot use company 00000 
for transaction entries.

mnAmountOutMATH02MATH_NUMERICOPTOUTPUT

- - - Good Performance High Value. 

cModeEV01charREQINPUT

Pass an 'A' for Add Mode, 'U' for Update Mode, or 'I' for Inquiry Mode.  The default will be Inquiry 
Mode.  For most applications and UBEs, the mode should be 'I' for Inquiry.  You use the Inquiry mode 

after fetching records from the F0911 table.  The G/L Functional Server will most typically use the 'A' 

(Add) or 'U' (Update) modes when writing the record back to the F0911 table.

^

szLedgerTypeLTcharREQINPUT

A user defined code (09/LT) that specifies the type of ledger, such as AA (Actual Amounts), BA (Budget Amount), or AU (Actual Units). You 
can set up multiple, concurrent accounting ledgers within the general ledger to establish an audit trail for all transactions.

Related Functions

None

Related Tables

F0010 Company Constants
F0013 Currency Codes