There are times when the mapping of one EDI element depends upon the value in another (generally related) EDI element. The EDI element whose value determines the mapping of the other EDI element is called a conditional variable. The EDI element whose mapping is determined by the conditional variable has a “condition” or conditions” placed on it.
A conditional variable is a special type of memory variable that is used in conditional mapping. When you specify that an element is a conditional variable, ECMap creates a special memory variable field name of XXXNNSS, where XXX is the current Segment ID, NN is a sequence number that gives the position of the element in the segment, and SS is the sub-element. ECMap first checks for the existence of the variable name and then creates it if it does not already exist. All field names are case sensitive - a lower case beg01 is not the same variable as an upper case BEG01.
Mapping an element to a conditional variable
Right-click the element containing the data that will be evaluated, and select Conditional Variable from the drop-down menu.
The results of your selection displays in all three sections of the Mapping window:
In the Mapping section at the bottom of the window on the line containing the element you selected, CNDVAR displays under Record, and the name of the conditional variable under Field Name.
If you double-click the element in the standards section of the window, you see a mapping icon and the name of the conditional variable that was created. The memory variable created appears in the Destination: Memory Variable pane of the Mapping window.