TransformationRule: Precalculations tab
About Precalculations tab
Use the Precalculations tab toDefine Precalculations for use in the TransformationRule
About Precalculations
A Precalculation is a temporary data zone which contains the result of a calculation performed by evaluating a DML expression based on an InputEvent segment. All Precalculations are composed of a mapping expression and a comment.
You can use the result of the Precalculation in the mapping expressions of the TransformationRule where you created it. Use a Precalculation to:
 avoid having to repeat defining the same expression when writing the Mapping Rules for the OutputEvents generated by the given TransformationRule.
 optimize the transformation during the execution session.
Each time a dynamic decimal definition is found in a BusinessDocument, a precalculation is automatically generated. Consequently, an additional character is required in the input BusinessDocument structure to store the precalculation result.
AccountingIntegrator Rule Engine:
 assimilates the Precalculation as a supplementary field at the end of the InputEvent segment (provided that in so doing it does not exceed the maximum segment length of 4000 characters).
 AccountingIntegrator Enabler Rule Engine reinitializes the Precalculations each time it applies the TransformationRule to the a new InputEvent segment.
You can use the defined Precalculation as an expression in:
 the Mapping Rules for OutputEvent fields
 execution conditions for FinancialCases and OutputEvents
You can stipulate a condition to meet before AccountingIntegrator Enabler can run any of the Precalculations in a TransformationRule. To do this, set a Precalculation condition.
Example
The Precalculation PCC1 contains the expression: $ACCTAB (ACCOUNT;"A00001"). This expression searches the ACCOUNT Table and extracts the entry for the A0001 Table key. Now, instead of having to rewrite this expression each time you need to work with the A0001 Table entry, you simply write: @PCC1 in the Mapping Rule expression.
Syntax
Use DML functions to define a Precalculation. [FOR DETAILS Using DML Functions]
Defining Precalculations
The Precalculations tab comprises two panes illustrated schematically as follows:
Precalculation definition pane containing two subtabs: 
BusinessDocument tree structure of the InputEvent segment that the TransformationRule is processing. 

Precalculation properties subtab where you set the general properties for the Precalculation and define the actual expression. 
Precalculation condition subtab where you set the test condition which must be fulfilled before AccountingIntegrator Enabler can execute the set of Precalculations defined on this tab. 
You can define several Precalculations for one TransformationRule. A Precalculation definition is limited to the 4000 characters available in the InputEvent segment. If, for example the basic segment:
 uses all the 4000 characters, you cannot:
 Define any Precalculations.
 Use any dynamic decimal fields.
 uses 3000 characters, you can use the 1000 characters available to:
 Define and map the Precalculations.
 Use for the dynamic decimal fields that require an additional character.
The overall length is checked when the TransformationRule is controlled.
Setting Precalculation properties
Complete the following fields in the Precalculation tab.
Field  Contents 

Name (Mandatory) 
Enter a name using a maximum of ten characters. Respect the naming conventions. The Precalculation must not have the same name as an existing InputEvent segment BusinessDocument. 
Label 
Enter a freetext description of this precalculation (using a maximum of 255 characters). 
(Mandatory) 
From the dropdown list, select a data type for this Precalculation. Since the Precalculation is appended to the InputEvent segment, it is considered as a field. Therefore you must specify the data type for this field. [FOR DETAILS: Data Types] 
Length 
When you select a data type from the data type dropdown list, AccountingIntegrator Enabler automatically displays its associated length in this field. To change the default length, click in the Length field and enter a value that complies with the usage limits of the selected Data Type. 
Mapping Rule (Mandatory) 
Enter the mapping expression that this Precalculation must evaluate. The system evaluates this expression when it starts processing an InputEvent segment and stores the result in the processed segment.

Comments 
Enter freetext comment information for the Precalculation. 
Use the Precalculations toolbar to perform the following operations:
Click...  To... 


Add a new Precalculation. The new Precalculation is added below the others you have already defined. 

Delete a Precalculation. 

Use the Object Dependencies Browser to analyze dependencies for the selected Precalculation. The Browser shows the objects that use the Precalculation and objects used by the Precalculation. 
Setting a Precalculation condition
AccountingIntegrator Enabler evaluates the set of Precalculations that you define in this tab in the following circumstances:
 To apply the given TransformationRule to an InputEvent segment
 If the condition you set for the precalculations is true. If you do not set a condition, AccountingIntegrator Rule Engine executes the Precalculation without running any test criteria beforehand.
Complete the following fields in the Precalculations condition tab:
Field  Contents 

Mapping Rule (Mandatory) 
Enter the mapping expression that must return true for AccountingIntegrator Enabler to evaluate all the Precalculations you defined for this TransformationRule. Example In the Precalculation named PCC1, draganddrop the input BusinessDocument field ACCTYPE containing an account type indicator into the Mapping Rule field. Write the mapping expression: ACCTYPE="DEBIT".
[FOR DETAILS Defining a mapping expression] 
Comments 
Enter freetext comment information for the Precalculation condition. 