Expression

An expression is an important component of IGFC that is used by rules to provide value during generation of an output business document. For accounting framework integration, an expression is also used by journal entry templates.

Expressions are created per type of input business document that are processed.

There are four types of expressions, a formula, a search template, a text, and REST API.

Formula-type expression

A formula expression is an arithmetic computation that uses the addition, subtraction, multiplication, or division operations.

The types of operands available are:

  • Fixed numeric value
  • Attribute of a master data or transactional document with a numeric data type
  • An expression that returns a numeric value, excluding expressions of type REST API.
Note: You can use operands of different types in a formula expression. Parentheses are used to specify the order of computation.
Example

A formula expression for a sales order business document to get the total amount in a sales order line:

SOLineTotalAmount = SOLine.unitPrice * SOLine.quantity
Name of the expression SOLineTotalAmount

Operand 1

UnitPrice attribute of the SalesOrderLine BOD registration

SOLine.unitPrice
Arithmetic operator *

Operand 2

Quantity attribute of the SalesOrderLine BOD registration

SOLine.quantity

Search template-type expression

This type of expression is created to return master data or custom master data information.

See Search template.

These details are required in defining an expression that uses a search template:

  • Source master data - This is the search name of the registered master data document or custom master data.
  • Source search template - This is the name of the particular search template of the selected master data document or custom master data that will return the desired information.
  • Source entity - This is the entity to which the source master data is associated. This detail is required only for search template-type expressions with master data business document as the source master data
  • Arguments - A value should be assigned to each parameter defined in the search template. The data types of the value and the parameter should match.

The types of values that can be assigned as an argument are:

  • Fixed value - A numeric or text value.
  • Attribute of a master data or transactional document - The value is determined from the input business document.
  • Rule setup value - Value of a parameter from the rule being executed.

    See Defining output generation rules.

  • Another expression, excluding expressions of type REST API - See section on Nested Expression.
  • For expression of system-defined search-template, these arguments are available:
Argument System-defined search template Variable Value
Transactional Document

getDimensionCodeList

getDimensionCodeListByTransType

getJournalHeaderUserField

getJournalLineUserField

xsdName All registered transactional documents
Transaction Type getDimensionCodeListByTransType transType Transaction Types used in Dimension Code Assignments
Journal User Field

getJournalHeaderUserField

getJournalLineUserField

userFieldSetName Name of Journal User Fields sets
Accounting Book

getDimensionCodeList

getDimensionCodeListByTransType

getAcquirerAccountNumber

getAcquirerAccountNumberList

getAcquirerAcctChart

getCurrencyRateType

getTargetAccountNumberBySourceAcctChart

getTargetAccountNumbeListBySourceAcctChart

getTargetAccChartBySourceAcctChart

getTargetCurrencyRateTypeBySourceAcctChart

accBook, acquireeAccBook or acquirerAccBook ID of AccountingBook documents
Accounting Chart

getDimensionCodeListByTransType

getDimensionCodeList

getTargetAccountNumberBySourceAcctChart

getTargetAccountNumberListBySourceAcctChart

getTargetAccChartBySourceAcctChart

getTargetCurrencyRateTypeBySourceAcctChart

accChart or acquireeAcctChart ID of AccountingChart documents
Account

getDimensionCodeList

getDimensionCodeListByTransType

getAcquirerAccountNumber

getTargetAccountNumberBySourceAcctChart

getTargetAccountNumbeListBySourceAcctChart

accNumber or acquireeAcctNum ID of ChartOfAccounts documents
Accounting Journal

getCurrencyRateType

getTargetCurrencyRateTypeBySourceAcctChart

acquireeAcJourn ID of Accounting Journal documents
Example

An expression for a sales order business document that uses a FinancialCalendar search template in retrieving the appropriate PeriodID attribute value:

Name of the expression SOAcctgPeriodId

Source master data

FinancialCalendar BOD registration name

FinCal

Source search template

getAcctgPeriod is the search template that returns a PeriodID.Parameters are transaction date and accounting entity.

getAcctgPeriod(p_transDate ,p_acctgEntity

Arguments

SalesOrder.dateTime is used as the transaction date and SalesOrder.soAcctgEntity is used as the accounting entity.

SalesOrder.dateTime

SalesOrder.soAcctgEntity

Text type-expression

A text type expression performs string operations to split or concatenate operand values. This type of expression is used to derive the values of an output document attribute.

The types of operands available are:

  • Fixed alphanumeric value
  • Attribute of master data or transactional document
  • An expression of type text
  • An expression of type search template with single return value.
Example

The example illustrates text expressions to derive the Year and Organization Code values. The input transaction is SourceSystemJournalEntry business document.

In the first example, Year is the value to be returned. This is derived from the vehicle registration code which is a dimension attribute of the input transaction. The vehicle registration code consists of 10 characters, where the first four digits is the transaction Year, and the next six digits is the registration ID.

Name of the expression TransYr
Text Function Split

Operand

Input transaction’s dimension attribute for vehicle registration

JeLine.veReg

Starting character 1
Ending character 4

The second example is another text expression to join the cost center and department code to return the Organization Code value:

Name of the expression OrgCd

Operand 1

Input transaction’s dimension attribute for cost center

JeLine.costCtr

Text Function &

Operand 2

Input transaction’s dimension attribute for department code

JeLine.deptCd

REST API-type expression

This type of expression is created to directly retrieve information from an enterprise application by sending out REST API requests.

These details are required in defining an expression that uses REST API:

  • API Definition – This is the name of the imported API definition that is used for retrieving information.
  • Parameters – A value should be assigned to each parameter key defined for the API to obtain the corresponding result key or keys.

The type of values that can be assigned to a parameter are:

  • Fixed value – A numeric or text value
  • Attribute of a master data or transactional document – The value is determined from the input business document.
Example

An expression for a SourceSystemJournalEntry document that uses a Forex API named “convert” in translating the transaction amount currency to the functional amount currency of the receiving general ledger entity.

Name of the expression ApiConvertAmt

API Definition

convert

Parameters

Key

from, to
Value

JeLine.lnAmount is used as the input amount for conversion, with USD as the target currency.

JeLine, InAmt, "USD"

Nested expression

A formula expression can have another expression as one of its operands.

Example

A formula expression for an invoice business document that returns the total amount of an invoice line. The total amount is the sum of the invoice line amount and tax amount. This expression uses another formula expression that computes the tax amount of the invoice line:

InvLineTotAmt = InvLine.amt + InvLineTaxAmt
Name of the expression InvLineTotAmt

Operand 1

Amount attribute of the InvoiceLine BOD registration

InvLine.amt

Arithmetic operator +

Operand 2

Formula expression of the invoice business document that multiplies the invoice line amount with the tax rate

InvLineTaxAmt
The formula expression that computes the invoice line tax amount should be defined with these details:
InvLineTaxAmt = InvLine.amt * InvLine.taxRate
Name of the expression InvLineTotAmt

Operand 1

Amount attribute of the InvoiceLine BOD registration

InvLine.amt

Arithmetic operator *

Operand 2

Tax rate attribute of the InvoiceLine BOD registration

InvLineTaxAmt
Example
A formula expression for an invoice business document that uses a search template expression in converting the invoice amount to the Euro currency:
InvTotAmtToEuro = Invoice.totAmt * InvToEuroCurrXRate
Name of the expression InvTotAmtToEuro

Operand 1

Total amount attribute of the Invoice BOD registration

Invoice.totAmt

Arithmetic operator *

Operand 2

A search template expression of the invoice business document that returns the exchange rate between the invoice amount’s currency and Euro currency.

InvToEuroCurrXRate

The InvToEuroCurrXRate search template expression should be defined with these:

Name of the expression InvTotAmtToEuro

Source master data

CurrencyExchangeRateMaster BOD registration name

CurrXchgeRateMaster

Source search template

getCurrencyRate is the search template that returns an exchange rate between two currencies during a specific period of time. Parameters are source currency, target currency and transaction date

getCurrencyRate(p_sourceCurr,p_targetCurr, p_startDate)

Arguments

A search template expression of the invoice business document that returns the exchange rate between the invoice amount’s currency and Euro currency.

Invoice.totAmtCurr

‘EUR’

Invoice.dateTime