When a Condition is attached to an element in an outbound map, the program checks to see whether data was mapped to that EDI element and if so, maps a specified constant value to one or two other related EDI elements. The Condition option is generally used in conjunction with a Conditional Variable and is sometimes used with the Repeat Map function.
The EDI element into which the constant value is stored is specified as the Conditional Variable, a special memory variable to which ECMap gives the name XXXNNSS, where:
XXX – the current segment ID
NN – a sequence number that gives the position of the field name in the segment
SS – the sub-element
When you make an element a conditional variable, ECMap checks to see if the name already exists for this element, and creates one if it does not exist. The Condition is attached to the EDI element that will be checked for the presence of data, or which is mapped to a field that will be checked for the presence of data. The two EDI elements are generally related and follow one another in a segment – such as a qualifier and its associated data - and there can be the possibility of multiple pairs occurring.
When multiple pairs are possible, you use the Repeat Map function to copy the mapping of the first pair to as many additional pairs as might exist in the application data.
During mapping, the program keeps track of whether a prior pair has been mapped, and if so, adjusts the mapping position for the next pair accordingly. The value of this option is that qualifiers that have no data are not mapped.
You can set up one or two conditional mappings that specify the conditional variable that is mapped if the element contains data and the constant value that is stored in the conditional variable.
Attaching a condition to an element
Do one of the following:
Highlight the element and choose Condition from the Element menu
Right-click the element and choose Condition from the drop-down list that displays.
The Element Conditions window displays.
For each condition you want to set:
Select the top up arrow and the Memory Variables window displays. Double-click a conditional variable. (Remember that a conditional variable is a special type of memory variable.). You return to the Element Conditions window, and the program enters MEMVAR and the name of the conditional variable into the top two text boxes.
Select the middle up arrow and the program enters EQ in the middle text box on the Element Conditions window. This is an “equals” operator.
Select the bottom up arrow and the Constant window displays. Enter a character string in the text box and, and select OK. The program enters STRVAR and the constant value into the bottom two text boxes on the Element Conditions window.