I have a need to parse and split an X12 810 document. The GS envelope contains many ST envelopes. I have a need to split those ST documents into single EDI transactions within Trading Networks. The first thought that comes to mind is “hey…just use the WmEDI module for TN and set the configuration to split the document at the ST!”. I agree, that would be an easy approach. That’s worked for me at other places flawlessly. However, my employer uses GXS AI Server and Trade Guide for EDI translation. The webMethods platform is simply the communication method. They have no desire to switch their translation platform to webMethods, at this time. So…I’m stuck with just the FlatFile Adapter.
Now, having some history, and the knowledge the the EDI Module isn’t an option for me, let me pose to the group my problem. I’ve successfully created a Flat File Dict. and Schema that identify the segments and fields for a trading partners 810 implementation. It parses the 810 data perfectly fine. I can use convertToValues to create the IData object necessary to split the document. However, when I use the convertToString service to reassemble my single 810 document (I loop over the GS and then the ST nodes of the afore mentioned IData object) into a flat file, the Record IDs (GS, ST, etc…) all overwrite 2-3 characters of the first field for that record (GS01, ST01, etc…). I’ve configured the extractor to pull the record ID at field 0 and all the record’s constituent fields begin at field 1 and go outward from that point. I’ve even tried using composite field definitions, however, I may not have done those correctly. The flat file schema is a nested schema. That is to say that the following nesting is true:
ISA
-GS
----ST
------BIG
------REF
------N1
--------N3
--------N4
------IT1
------PID
------PO4
------TDS
------CTT
------SE
----GE
-IEA
Curiously, it appears as if the record ID is being overlaid the first 2-3 characters of the segment’s first field. It depends on how large the record ID is (2 or 3 characters). Any idea how or if it is even possible to keep the convertToString service from overwriting the first field? I do want the recordID to show. I just do not want it to overwrite the field contents.