Technical Functions

Searching and checking entries in an external reference table or external repository

Setting conditions in Mapping-rule expressions

Extracting portions of a Business-Document field

Assigning exception status to a failed Input-Event

Setting null values to target fields

About Technical Functions

You use Technical Functions and instructions to perform the following operations:

  • search and check entries in an external reference table or external repository
  • set conditions in Mapping-rule expressions
  • extract portions of a Business-Document field
  • assign exception status to a failed Input-Event
  • set null values to target fields

The syntax of the function or instruction depends on the type of operation.

$CHECK

Description

$CHECK activates an external call to check a value in a repository external to AccountingIntegrator Enabler.

  • AccountingIntegrator Rule Engine Exits and External Calls

Syntax

$CHECK("entry point";table key)

The parentheses, double quotes and semicolon are mandatory.

Return

When you create an external call, you can use a return code and an associated error message for each call.

If a check is unsuccessful (the return code is not "0"), the processed Input-Event fails and AccountingIntegrator Rule Engine combines the rejection notice with your customized error message.

If the check is successful, AccountingIntegrator Rule Engine returns the value of the access table key.

The Target field must be compatible with the length and data type of the table key parameter.

Parameter

entry point

is the name of the entry point in the external call and is defined using two alphanumeric characters.

The entry point you use determines the type of function, as summarized in the following table:

 

Entry point

Corresponds to

79-99

parameters reserved for AXWAY

77,78

pre-programmed modules for accessing data stored in an Oracle database. [FOR DETAILS Checking data in Oracle databases].

 

table key

is the table key used to access the external call. It is a constant that you can take from any expression that returns a value with a data type compatible with Alphanumeric.

The maximum length of table key is 256 characters including spaces and punctuation.

Example

[FOR DETAILS Examples of Oracle Database $CHECK functions]

$ERR

Description

$ERR sets the Input-Event in progress to the anomaly status with an error message that you define.

Use it in the Mapping Rule or generation conditions to set the Input Event to the exception status if certain conditions encountered during execution necessitate.

Syntax

$ERR(expression)

The parentheses are mandatory.

Return

Alphanumeric

The result of expression is used to define the error message associated with the failed Input-Event.
The error message that is generated cannot have more than fifty characters. If this limit is exceeded, the error message is truncated.

Parameters

expression
Enter an expression that returns an Alphanumeric value.

Examples

Target field

Mapping Rule

REFOUTEV1

IF REFCRE3 = $ACCTAB (TABLEREF; ZONEINPEV1) THEN REFCRE3&ZONEINPEV1 ELSE $ERR ("REFERENCE DOES NOT EXIST: "&REFINPEV3)

In the event of the value of REFINPEV3 not being referenced in the TABLEREF Table, the Input-Event fails and the "REFERENCE DOES NOT EXIST:" message concatenated with the value of REFINPEV3 is issued.

This error message is stored in the REFOUTEV1 target field.

FIELDOUTEV2

IF ((NB_VERIF > NB_REF) AND (MT_VERIF <> 0))THEN (NB_VERIF * MT_VERIF)ELSE $ERR (REFINPEV2&$ACCTAB (LIBERR; REFINPEV2))

IF the value of the NB_VERIF field is greater than the value stored in NB_REF and the value of the MT_VERIF field is not zero, then multiply the contents of NB_VERIF and MT_VERIF. Otherwise store an error message in the FIELDOUTEV2 target field. This error message is the concatenation of the values of the REFINPEV1 field and the REFINPEV2 key in the LIBERR Table.

 

FIELD

Description

The FIELD instruction returns a subset of characters in an Input-Event segment field, starting from the position that you specify.

Syntax

FIELD("pppplllt")

The parentheses and the double quotes are mandatory.

Return

String

The data type of the target field must be compatible with the lll and t parameters.

Parameters

FIELD is an Input-Event segment field

Note: Field is both the instruction name and a parameter.

pppplllt specifies the position, length and data type of the portion of the Input segment field you want to extract. The value is composed of the following:

pppp

position in the field from which the value (four numeric characters) is to be extracted. The first character in the String is in position 1

lll

length of the part of the field (three numeric characters) to be extracted

t

data type of the part to be extracted from the field (A, N, D)

 

Examples

The following example extracts the a set of five numeric characters starting from the first character in the ADR_TOWN string. This subset of characters is written to the CODEPOST Business-Document field to represent the postal code.

Target field

Mapping Rule

CODEPOST

ADR_TOWN  ("0001005N")

 

$NULL

The $NULL function does not perform any actual processing. It is used in mapping rule nesting when no action is necessary, but a written instruction is nevertheless required, to obtain the same number of IF or ELSE statements in the expression.

Description

$NULL sets the target field as a set of blank spaces irrespective of the data type associated with this field.

Syntax

$NULL

Return

Blank spaces

Parameters

None

Example

In the following example the value of the Business-Document field REFOUTEV1 depends on the outcome of the IF-THEN-ELSE instruction. The contents of REFOUTEV1 are as follows:

  • The concatenation of the values of Business-Document fields REFINPEV3 and REFER_RATE, if REFINPEV3 corresponds to the value of the ZONEINPEV1 key in the TABLEREF Table and is greater than the value of the REFRATE key in the TBLRATE Table.
  • Set to NULL if the above conditions are not met.

Target field

Mapping Rule

REFOUTEV1

IF REFINPEV3 = $ACCTAB (TABLEREF; ZONEINPEV1)

    THEN IF REFINPEV3 >$ACCTAB (TBLRATE; REFRATE)

      THEN REFINPEV3 & REFER_RATE

   ELSE $NULL

ELSE REFINPEV3 & ZONEINPEV1.

 

IF-THEN-ELSE

Use the If-Then-Else DML Instruction to specify the generation conditions in the following objects:

Description

The If-Then-Else instruction sets conditions that must be fulfilled for AccountingIntegrator Rule Engine to execute processing instructions.

Syntax

If condition Then expression1

[Else expression2]

Parameters

condition

is a DML expression that uses a Business-Document field and comparison and logical operators.
If condition is a DML expression that returns the value null, then AccountingIntegrator Rule Engine generates an error.

expression1

includes one or more expressions that AccountingIntegrator Rule Engine executes when condition returns true.

The number of then conditions must be the same as the number of if conditions. You can use the $NULL function to create empty then conditions if required.

expression2

is optional and includes one or more expressions that AccountingIntegrator Rule Engine executes when condition returns false.
The number of else conditions must be either:

  • the same as the number of if conditions
  • the number of if conditions minus one. In this instance, the missing else corresponds to the case where the if-then instruction returns the value null. AccountingIntegrator Rule Engine does not verify any condition and inserts spaces into the target field, irrespective of the data type defining this field.

Linking

You can combine several if - then instructions into linked statements.

Linking conditions

You can link the following conditions:

if condition1 then expression1 else if condition2 then expression2 else expression3

The conditions are simulated one after the other:

  • expression1 is executed if condition1 is True
  • condition2 is simulated only if  condition1 is False
  • expression2 is executed if  condition1 is False and condition2 is True
  • expression3 is executed if  condition1 and condition2 are False

 

$SEARCH

Description

$SEARCH activates an external call to search for a value in an external reference table.

Syntax

$SEARCH ("lllt";"entry point";table key)

The parentheses, double quotes and semicolon are mandatory.

Return

When you create an external call you can use a return code and an associated error message for each call.

If a search is unsuccessful (the return code is not "0"), the processed Input-Event fails and AccountingIntegrator Rule Engine combines the rejection notice with your customized error message.

The target field must be compatible with the lllt parameter.

Parameter

lllt

  • lllt represents the length of the value returned by the call (the maximum length varies depending on the data type)
  • t represents the data type of the value returned by the call

entry point

is the name of the entry point in the external call and is defined using two alphanumeric characters.

The entry point you use determines the type of function, as summarized in the following table:

 

Entry point

Corresponds to

79-99

parameters reserved for AXWAY

75, 76

pre-programmed modules for accessing data stored in an Oracle database.

[FOR DETAILS Oracle database access functions]

71

a pre-programmed module for activating the field formatting functions [FOR DETAILS Formatting Functions]

70

a pre-programmed module for accessing the EuroConverter conversion functions

[FOR DETAILS Conversion Functions]

 

table key

Use the table key parameter to access the external call. It is an expression that returns a value with a data type compatible with Alphanumeric.

The maximum length of the table key is 256 characters including spaces and punctuation.

Examples

Refer to the relevant link for each $SEARCH Function entry point:

Back to top

Related Links