X12 is a flat-file type of format for exchanging documents between companies. I'm working with 204 Load tender type. This is format used by companies to send load tenders to carriers. Most questions on Stack Overflow here focus on how to parse. By parsing we talk about reading and converting into XML or object. Which is OK as a first step but I wonder what to do with this data...
Problem is - there is like 15 different versions of this document. Let's say I parse all this no problem. But what is the best practice to map this documents to fields in my database? I have specific fields and I need to map 204 into those fields. Because of differences in versions I can't cover this completely.
Another question. I'm new to EDI, correct me if I'm wrong. Each partner will send it's specs for specific type of transaction. They do have some freedom on what data and how they put there. Can they add their own elements? Or if it's version 4030 then all partners sending 204 type of version 4030 will be the same?
I know how to do mapping programmaticaly for each version but I wonder how this issue solved globally or on more generic level. Or it's common that when new trading partner added - custom development needed to map it's data properly? I wonder if it's possible to create more or less "plug and play" mapper..
A lot/most edi software indeed does have not only the 'parse' function but also the mapping. You do need both! A lot of the edi questions here are asked by 'edi starters', looking for a quick one-partner solution. If you use 'parse-only' edi software, you will need to build the mapping functionality yourself, re-building what is already available in all serious edi-software.
The guidelines of partners can indicate a different usage of the same transaction (like 204). Added elements is not allowed (but sometime they even do that:-( Some build a new mapping for every partner, some try to do this in one (complicated) mapping. I usually try to build one mapping, make it suitable for 'most' edi partners. But sometimes the usage is so different that it is better to build a specific mapping for that one partner. There is no magic formula to do what you want, I am afraid.