Copyright © TIBCO Software Inc. All Rights Reserved
Copyright © TIBCO Software Inc. All Rights Reserved


Chapter 1 B2B-X12 Overview : Document Structure

Document Structure
An X12 document is a file containing EDI data to be exchanged between trading partners.
There are three basic structures in an X12 document. They are:
The following sections provide a basic description of each of these structures. For more detailed information on each of these structures, please refer to the X12 standard.
Interchange
The interchange is the basic unit of electronic data transfer. Several interchanges can be bundled into a single file for data transfer.
An interchange is started by an interchange header (ISA segment) and terminated by an interchange trailer (IEA segment).
Figure 1 Structure of X12 Interchange
In X12, the interchange header (ISA) performs the following functions:
The following example of an X12 interchange contains an 850 (purchase order) transaction set:

 
ISA~00~Authorizat~00~Security I~01~123456789 ~01~987654321 ~040418~1338~U~00403~000000001~0~I~+^
GS~PO~Application Sen~Application Rec~20040418~1338~1~X~004030^
ST~850~0001^
BEG~00~CO~PO#39281~Release Number~20040418^
REF~……….
N1~…………
PO1~……….
PO1~……….
. . .
CTT~……….
SE~70~0001^
GE~1~1^
IEA~1~000000001^

 
Normally all of the data in an X12 interchange would be on one line. The example here has the data split across several lines in order to fit on the page. However it is not unusual for X12 data to be split on segment boundaries or even blocked at a particular number of characters.
Functional Group
A functional group is a group of similar transaction sets, for example, three purchase orders.
It is a group of one or more related transaction sets sharing the same functional group ID. Functional groups start with the segment GS Functional Group Header and end with the segment GE Functional Group Trailer.
The details in the Functional Group GS/GE envelope are often used to route the group's transaction sets to the appropriate department or business application within a company.
Transaction Set
A transaction set contains the data for a well defined business function. For example, there are X12 transaction sets for purchase orders, invoices, and financial statements.
A business transaction is defined by a transaction set composed of a number of segments of variable lengths. Each segment is in turn composed of a number of data elements of variable lengths. A transaction set is analogous to a business document, such as a purchase order; a segment is analogous to a line of information in that purchase order; and a data element is analogous to a unit of information in the item line. For example, in the purchase order for a book, the number of copies requested or the unit price would be represented by data elements.
Transaction Set Header and Transaction Set Trailer
Each transaction set starts with a transaction set header (ST), followed by a beginning segment that uniquely identifies the type of transaction set. The transaction set header contains the transaction set identification and transaction set control number. This is followed by other segments (which may also be found in other transaction sets) and concluded by a transaction set trailer.
The transaction set trailer (SE) is the last element in the transaction set. It defines the end of the transaction set and contains the number of segments included and the transaction set control number.

Copyright © TIBCO Software Inc. All Rights Reserved
Copyright © TIBCO Software Inc. All Rights Reserved