Outbound conditional element mapping allows you to conditionally map constant values to EDI elements based on the presence or absence of data in a specific application field or memory variable. If data is present in the record/field or memory variable, then a specified constant value will be mapped into a specified element.
You can fill two other elements on each mapped element. The element into which the constant value is to be stored must first be defined as a special type of memory variable known as 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. When you choose Conditional Variable, ECMap will check for the existence of the memory variable name and create it if it does not exist.
Making an element a conditional variable
Right-click the element and select Conditional Variable from the submenu.
You will 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 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 will see a mapping icon and the name of the conditional variable that was created. The memory variable also displays in the Source: Memory Variable pane of the Mapping window.
After you have created the conditional variable, you specify what will happen if the program finds data in an application field or memory variable.
Map the element, right-click it, and select Condition from the submenu.
You can also highlight the element after it has been
mapped and choose Condition from the Element menu.
The Element Conditions window displays, already populated with the identifier and description of the element whose mapping depends on the condition.
Under Options, you may assign values to two conditional variables – under Store Into 1 and Store Into 2.
CLick the top up arrow to display the Memory Variables window.
Remember, a conditional variable is a special type of memory variable.
Double-click a memory variable to select it, and the program automatically enters MEMVAR into the top text box and the name of the memory variable into the next text box.
Click the middle up arrow and EQ is entered into the text box.
Equal is the only operator that can be used, since you can only assign a value here.
Click the bottom up arrow to display the Constant window.
Enter the value that you want to assign to the memory variable.
Click OK and the constant value is entered in the bottom text box.
Select OK again to return to the Mapping window.