Sample Input and Output: 850 Purchase Order

Big Daddy's Gourmet Cocoa has hit the big time! The company is now selling to major retail grocery and discount chains, and they all want to send their orders as X12 850 Purchase Orders. Of course, they all have slightly different implementation guides, but Table 9.1 shows an abbreviated summary of a fairly representative guide. Note: The Segment Group column is empty if the segment is not part of a segment group. The BEG and a few other header level segments fall into this category.

You'll note a few things about this sample implementation. Only the N1 segment is transmitted; there isn't a full N1 loop. It is becoming increasingly common to use identifiers such as DUNS or DUNS+4 numbers to reference a location or party already in the system rather than transmitting full address information. The PO1 segment has only a single product code, though sometimes more than one is sent (I assume as a convenience and crosscheck for the vendor). Overall, this is a fairly compact implementation of the 850 Purchase Order.

The sample interchange below shows one functional group with two transaction sets.

Sample Input Interchange (PurchaseOrders.X12)
ISA*00*    *00*     *ZZ*BIGBOX     *12*
  9727839573   *030123*0600*U*00401*000000357*0*P*>~
GS*PO*BIGBOX*9727839573*20030123*0600*114*X*004010~
ST*850*0001~
BEG*00*SA*4497-0561**20030123~
DTM*001*20030206~
N1*ST*BIG BOX - STORE #97*92*001234567S097~
PO1*1*10*CA*30.36**UP*35790000122~
PID*F****Instant Hot Cocoa Mix - Mint flavor~
PO1*2*30*CA*31.08**UP*35790000724~
PID*F****Instant Hot Cocoa Mix - Vanilla flavor~
CTT*2~
SE*10*0001~
ST*850*0002~
BEG*00*SA*4445-0323**20030123~
DTM*001*20030206~
N1*ST*BIG BOX - STORE #45*92*001234567S045~
PO1*1*20*CA*30.36**UP*35790000122~
PID*F****Instant Hot Cocoa Mix - Mint flavor~
PO1*2*40*CA*31.08**UP*35790000641~
PID*F****Instant Hot Cocoa Mix - Dutch Chocolate flavor~
CTT*2~
SE*10*0002~
GE*2*114~
IEA*1*000000357~

Table 9.1. Sample X12 850 Purchase Order Implementation Guide
Segment GroupSegmentTagData Element PositionData Element or Composite Data Structure Number andNameX12 Data TypeMinimum LengthMaximum Maximum LengthDescription and Comments
 Beginning Segment for Purchase OrderBEG01353 Transaction Set Purpose CodeID2200 for original purchase order
   0292 Purchase Order Type CodeID22SA for stand-alone order
   03324 Purchase order numberAN122Buyer-assigned purchase Order Number
   05373 DateDT88Purchase order date
 Date/Time ReferenceDTM01374 Date/Time QualifierID33002 for requested delivery date or 010 for requested ship date
   02373 DateDT88 
Header N1NameN10198 Entity Identifier CodeID23One N1 loop is sent with an ST in this element
   0293 NameAN160The name of the receiving location
   0366 Identification Code QualifierID1292 for Assigned by Buyer or Buyer's Agent
   0467 Identification CodeAN280The buyer-assigned DUNS+4 number (the buyer's DUNS number followed by a four-digit receiving location code)
PO1Baseline Item DataPO101350 Assigned IdentificationAN120The line item number
   02330 Quantity OrderedR115 
   03355 Unit or Basis for Measurement CodeID22Usually EA for each or CA for case
   04212 Unit PriceR117 
   06235 Product/ Service ID QualifierID22Usually UP for UPC Consumer Package Code (1-5-5-1)
   07234 Product/ Service IDAN148The UPC code for the item
PO1Product/ Item DescriptionPID01349 Item Description TypeID11F for free-form item description
   05352 DescriptionAN180The item description
 Transaction TotalsCTT01354 Number of Line ItemsN016The total number of line items in the transaction set

The line breaks (and indentation on the continuation of the ISA segment) exist here only for readability. They would not appear in a compliant data stream.

Listed below are the two XML documents produced by the utility from this interchange. This and the XMLToX12 utility allow the user to specify the choice of names for the Elements that represent the various X12 components. I use a convention based on segment IDs and data element position. You could use more descriptive English names if you prefer.

Sample Output (X12PurchaseOrder0001.xml)
<?xml version="1.0" encoding="UTF-8"?>
<X12PurchaseOrder
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:noNamespaceSchemaLocation="X12PurchaseOrder.xsd">
  <BEG>
    <BEG01>00</BEG01>
    <BEG02>SA</BEG02>
    <BEG03>4497-0561</BEG03>
    <BEG05>2003-01-23</BEG05>
  </BEG>
  <DTM>
    <DTM01>001</DTM01>
    <DTM02>2003-02-06</DTM02>
  </DTM>
  <N1Header>
    <N1>
      <N101>ST</N101>
      <N102>BIG BOX - STORE #97</N102>
      <N103>92</N103>
      <N104>001234567S097</N104>
    </N1>
  </N1Header>
  <PO1Group>
    <PO1>
      <PO101>1</PO101>
      <PO102>10</PO102>
      <PO103>CA</PO103>
      <PO104>30.36</PO104>
      <PO106>UP</PO106>
      <PO107>35790000122</PO107>
    </PO1>
    <PID>
      <PID01>F</PID01>
      <PID05>Instant Hot Cocoa Mix - Mint flavor</PID05>
    </PID>
  </PO1Group>
  <PO1Group>
    <PO1>
      <PO101>2</PO101>
      <PO102>30</PO102>
      <PO103>CA</PO103>
      <PO104>31.08</PO104>
      <PO106>UP</PO106>
      <PO107>35790000724</PO107>
    </PO1>
    <PID>
      <PID01>F</PID01>
      <PID05>Instant Hot Cocoa Mix - Vanilla flavor</PID05>
    </PID>
  </PO1Group>
  <CTT>
    <CTT01>2</CTT01>
  </CTT>
</X12PurchaseOrder>

Sample Output (X12PurchaseOrder0002.xml)
<?xml version="1.0" encoding="UTF-8"?>
<X12PurchaseOrder
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:noNamespaceSchemaLocation="X12PurchaseOrder.xsd">
  <BEG>
    <BEG01>00</BEG01>
    <BEG02>SA</BEG02>
    <BEG03>4445-0323</BEG03>
    <BEG05>2003-01-23</BEG05>
  </BEG>
  <DTM>
    <DTM01>001</DTM01>
    <DTM02>2003-02-06</DTM02>
  </DTM>
  <N1Header>
    <N1>
      <N101>ST</N101>
      <N102>BIG BOX - STORE #45</N102>
      <N103>92</N103>
      <N104>001234567S045</N104>
    </N1>
  </N1Header>
  <PO1Group>
    <PO1>
      <PO101>1</PO101>
      <PO102>20</PO102>
      <PO103>CA</PO103>
      <PO104>30.36</PO104>
      <PO106>UP</PO106>
      <PO107>35790000122</PO107>
    </PO1>
    <PID>
      <PID01>F</PID01>
      <PID05>Instant Hot Cocoa Mix - Mint flavor</PID05>
    </PID>
  </PO1Group>
  <PO1Group>
    <PO1>
      <PO101>2</PO101>
      <PO102>40</PO102>
      <PO103>CA</PO103>
      <PO104>31.08</PO104>
      <PO106>UP</PO106>
      <PO107>35790000641</PO107>
    </PO1>
    <PID>
      <PID01>F</PID01>
      <PID05>
        Instant Hot Cocoa Mix - Dutch Chocolate flavor
      </PID05>
    </PID>
  </PO1Group>
  <CTT>
    <CTT01>2</CTT01>
  </CTT>
</X12PurchaseOrder>

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset