When the number of functional groups is dependent on the data
If the number of functional groups you want to generate depends on the input data, use a functional map to generate the functional groups.
For example, the Header might include data from different applications, purchase orders and purchase order acknowledgments and ship notices. It might be advisable to map the different kinds of application data to different functional groups. Use a functional map for each of the different functional groups in the output.
If more than one functional group is generated within the same interchange, the control numbers must be sequenced.
Using the following example,
GroupCtrl# Element [Last] IN Interchange + 1
The expression evaluates to 1 if it is the first 810 functional produced; it evaluates to 2 for the second 810 functional group. This technique assumes you want to generate group control numbers relative to the current interchange control number. For example, the first group's control number is 1, the second is 2.
To use an absolute numbering scheme (similar in concept to how interchange control numbers are maintained by partner), you could select the next available control number from the partner profile.