Creating an EDI document is easy with the EDIDocument component. Simply create an instance of the EDIDocument, set its loops, and call its GenerateFile() procedure. EDIDocument is based on a loop hierarchy. Loops contain segments and other loops. Segments contain elements. Elements contain data and composite elements.
// Instantiate an instance of EDIDocument and set the name of the file to be created
EDIDocument sampleEDIFile = new EDIDocument(“C:\\My837EDIFile.txt”);
// Create an interchange loop. This loop will contain all other loops in the EDI structure
Loop interchangeHeaderLoop = new Loop(“Interchange Header”);
// Add the interchange loop to the EDI document
// Generate the EDI file