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 placed on it.
A conditional variable is a special memory variable to which ECMap gives the name XXXNNSS, where XXX is the correct segment ID, NN is a sequence number that gives the position of the field name in the segment, and SS is the sub-element (if it exists). 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. (All field names are case sensitive - a lower case beg01 is not the same variable as an upper case BEG01.)
The program checks to see whether data was mapped to an EDI element to which a Condition is attached and if so, maps a specified constant value to one or two related EDI elements that have been specified as Conditional Variables.
Mapping an element to a conditional variable
Right-click the element containing the data to will be evaluated and select Conditional Variable from the drop-down list.
You see the results of your selection 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 is displayed 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.