Where to put the table loops in XML / text mappings
In general you need to put a table loop above / before any repeated structure in the mapping. Regarding the lines for the items, it’s quite obvious that you need to insert the loop for the EDI Document Line table above the first element of the line data. What might not be that obvious is the fact that you only need the field structure once in your mapping, no matter how many lines are transferred in the file. Anveo EDI Connect will execute the mapping lines in the table loop for all transferred lines.
This also applies for any other structure that can be repeated serveral times in the file. Another common example is the address information of customers or vendors. If you have several documents in one file, the corresponding number of EDI Document records will be created.