<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>The Integration Engineer &#187; Segments</title>
	<atom:link href="http://www.theintegrationengineer.com/category/edi/segments/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.theintegrationengineer.com</link>
	<description>When it just has to work.</description>
	<lastBuildDate>Tue, 27 Jul 2010 17:33:47 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=abc</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>The EDI Primer</title>
		<link>http://www.theintegrationengineer.com/the-edi-primer/</link>
		<comments>http://www.theintegrationengineer.com/the-edi-primer/#comments</comments>
		<pubDate>Thu, 07 Aug 2008 19:32:20 +0000</pubDate>
		<dc:creator>Roy</dc:creator>
				<category><![CDATA[Delimiters]]></category>
		<category><![CDATA[EDI]]></category>
		<category><![CDATA[EDI Primer]]></category>
		<category><![CDATA[Elements]]></category>
		<category><![CDATA[Envelope]]></category>
		<category><![CDATA[GS]]></category>
		<category><![CDATA[ISA]]></category>
		<category><![CDATA[ST]]></category>
		<category><![CDATA[Segments]]></category>
		<category><![CDATA[b2b]]></category>
		<category><![CDATA[convention]]></category>
		<category><![CDATA[Element Notation]]></category>
		<category><![CDATA[encoding]]></category>
		<category><![CDATA[Enveloping]]></category>
		<category><![CDATA[form]]></category>
		<category><![CDATA[Good Form]]></category>
		<category><![CDATA[hierarchial]]></category>
		<category><![CDATA[loops]]></category>
		<category><![CDATA[notation]]></category>
		<category><![CDATA[Specification]]></category>
		<category><![CDATA[Unwrapped]]></category>
		<category><![CDATA[usage]]></category>
		<category><![CDATA[values]]></category>
		<category><![CDATA[version]]></category>
		<category><![CDATA[Wrapped]]></category>

		<guid isPermaLink="false">http://www.theintegrationengineer.com/?p=6</guid>
		<description><![CDATA[For those who may be unfamiliar with the EDI standard, and those who may have used EDI but have encountered a new, unfamiliar question.
This introduction aims at addressing the basic questions of convention and implementation of the EDI technology.  I have a list of topics, and hope that over time I can cover all of [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignleft size-medium wp-image-18" title="pipes" src="http://www.theintegrationengineer.com/wp-content/uploads/2008/08/pipes.gif" alt="pipes The EDI Primer" width="76" height="95" />For those who may be unfamiliar with the EDI standard, and those who may have used EDI but have encountered a new, unfamiliar question.</p>
<p>This introduction aims at addressing the basic questions of convention and implementation of the EDI technology.  I have a list of topics, and hope that over time I can cover all of them.  I also hope that people reading here may have questions that I haven&#8217;t thought to write about.  Please let  me know what your questions are and I will see what I can do about providing answers.<span id="more-6"></span></p>
<ul>
<li><a href="http://www.theintegrationengineer.com/what-is-edi/">What is EDI?</a></li>
<li><a href="http://www.theintegrationengineer.com/the-parts-of-edi/">Parts of EDI</a></li>
<li><a href="http://www.theintegrationengineer.com/edi-segments/">Segments</a></li>
<li><a href="http://www.theintegrationengineer.com/edi-delimiters/">Delimiters</a></li>
<li>Conventions of EDI</li>
<li><a href="http://www.theintegrationengineer.com/why-are-there-more-than-one-version-of-edi/">Why are there more than one version of EDI?</a></li>
<li><a href="http://www.theintegrationengineer.com/usage-of-edi-specifications/">Standards and Usage</a></li>
<li>Encoded Values</li>
<li><a href="http://www.theintegrationengineer.com/edi-in-good-form/">EDI in Good Form</a></li>
<li><a href="http://www.theintegrationengineer.com/edi-elements/">Element Notation</a></li>
<li><a href=" http://www.theintegrationengineer.com/edi-wrapped-and-unwrapped/">Wrapped and Unwrapped EDI</a></li>
<li><a href="http://www.theintegrationengineer.com/edi-enveloping-part-one/">Enveloping Part One</a></li>
<li><a href="http://www.theintegrationengineer.com/edi-enveloping-part-two-the-isa/">Enveloping Part Two &#8211; ISA<br />
</a></li>
<li><a href="http://www.theintegrationengineer.com/edi-enveloping-part-three-the-gs">Enveloping Part Three &#8211; GS</a></li>
<li><a href="http://www.theintegrationengineer.com/edi-enveloping…rt-four-the-st/">Enveloping Part Four &#8211; ST</a></li>
<li><a href="http://www.theintegrationengineer.com/edi-repeated-segments/">Loops in EDI</a></li>
<li>Hierarchical Levels</li>
</ul>
<p>Of course understanding how EDI presents and represents data is the first step.  From here we may want to go to our Data Mapping Guide, or if we are familiar with mapping there are some examples in our mapping case studies of EDI to and from other formats.  Again, if you have an interesting problem or solution, I would love to here about it.  Please send it to<br />
<a href="mailto:roy@TheIntegrationEngineer.com">roy@TheIntegrationEngineer.com</a> and I will see what I can do.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.theintegrationengineer.com/the-edi-primer/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>EDI Line Item Data</title>
		<link>http://www.theintegrationengineer.com/edi-line-item-data/</link>
		<comments>http://www.theintegrationengineer.com/edi-line-item-data/#comments</comments>
		<pubDate>Thu, 01 Apr 2010 15:21:41 +0000</pubDate>
		<dc:creator>Roy</dc:creator>
				<category><![CDATA[EDI]]></category>
		<category><![CDATA[Line Item]]></category>
		<category><![CDATA[b2b]]></category>
		<category><![CDATA[HL]]></category>
		<category><![CDATA[IT1]]></category>
		<category><![CDATA[Order]]></category>
		<category><![CDATA[PO1]]></category>

		<guid isPermaLink="false">http://www.theintegrationengineer.com/?p=724</guid>
		<description><![CDATA[What is a line item?
A line item is a group of data and its structure that is or can be repeated multiple times in its document.  It holds the data that is the focus of the document, and a part of a document or transaction that contains distinct part that can stand alone.  For instance, [...]]]></description>
			<content:encoded><![CDATA[<p><strong><a href="http://www.theintegrationengineer.com/wp-content/uploads/2008/11/edi_standard.jpg"><img class="alignleft size-thumbnail wp-image-52" title="EDI STandard" src="http://www.theintegrationengineer.com/wp-content/uploads/2008/11/edi_standard-150x150.jpg" alt="edi standard 150x150 EDI Line Item Data " width="150" height="150" /></a>What is a line item?</strong></p>
<p>A line item is a group of data and its structure that is or can be repeated multiple times in its document.  It holds the data that is the focus of the document, and a part of a document or transaction that contains distinct part that can stand alone.  For instance, an order that has two line items could be split into two orders that would be able to be filled separately.  It does not necessarily contain information that can be applied to a group of items, although sometimes this information is included.  This feeds into what type of data that a line item contains.</p>
<p><span id="more-724"></span></p>
<p><strong>What type of data does a line item contain contain?</strong></p>
<p>In a purchase order, or other commerce related document these pieces of data will be found in the line item:</p>
<ol>
<li>Purpose of line</li>
<li>Product or Service ID</li>
<li>Quantity</li>
<li>Unit of Measure</li>
<li>Price or Fee</li>
<li>Taxes</li>
<li>Special Handling</li>
<li>Descriptions</li>
</ol>
<p>Some additional data can be aggregated to the document level or published at the line item level;</p>
<ol>
<li>Ship to or Deliver to data.</li>
<li>Discounts</li>
<li>Shipping methods or tracking information</li>
</ol>
<p><strong>Where in EDI does this data go?</strong></p>
<p>For the most part, the PO1 segment and group contain the line item data.  There are a few transactions that use another segment.  The invoice for instance uses the IT1 segment.  Depending on the scope of our definition, an HL group could be a line item in some documents.</p>
<p>Line items are at the center of our transactions.  Purchase Orders, Invoices, and Catalogs would not be worth creating without the line items they contain.<br />
<object id="Player_b2b49725-0564-4e90-a2d5-2f349cb25499" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="400px" height="150px" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="quality" value="high" /><param name="bgcolor" value="#FFFFFF" /><param name="allowscriptaccess" value="always" /><param name="src" value="http://ws.amazon.com/widgets/q?ServiceVersion=20070822&amp;MarketPlace=US&amp;ID=V20070822%2FUS%2Ftheinteengi-20%2F8010%2Fb2b49725-0564-4e90-a2d5-2f349cb25499&amp;Operation=GetDisplayTemplate" /><param name="name" value="Player_b2b49725-0564-4e90-a2d5-2f349cb25499" /><param name="align" value="middle" /><embed id="Player_b2b49725-0564-4e90-a2d5-2f349cb25499" type="application/x-shockwave-flash" width="400px" height="150px" src="http://ws.amazon.com/widgets/q?ServiceVersion=20070822&amp;MarketPlace=US&amp;ID=V20070822%2FUS%2Ftheinteengi-20%2F8010%2Fb2b49725-0564-4e90-a2d5-2f349cb25499&amp;Operation=GetDisplayTemplate" align="middle" name="Player_b2b49725-0564-4e90-a2d5-2f349cb25499" allowscriptaccess="always" bgcolor="#FFFFFF" quality="high"></embed></object> <noscript><A HREF="http://ws.amazon.com/widgets/q?ServiceVersion=20070822&#038;MarketPlace=US&#038;ID=V20070822%2FUS%2Ftheinteengi-20%2F8010%2Fb2b49725-0564-4e90-a2d5-2f349cb25499&#038;Operation=NoScript" mce_HREF="http://ws.amazon.com/widgets/q?ServiceVersion=20070822&amp;MarketPlace=US&amp;ID=V20070822%2FUS%2Ftheinteengi-20%2F8010%2Fb2b49725-0564-4e90-a2d5-2f349cb25499&amp;Operation=NoScript">Amazon.com Widgets</A></noscript></p>
]]></content:encoded>
			<wfw:commentRss>http://www.theintegrationengineer.com/edi-line-item-data/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Line Item Part Three, The ACK</title>
		<link>http://www.theintegrationengineer.com/line-item-part-three-the-ack/</link>
		<comments>http://www.theintegrationengineer.com/line-item-part-three-the-ack/#comments</comments>
		<pubDate>Fri, 23 Oct 2009 17:03:57 +0000</pubDate>
		<dc:creator>Roy</dc:creator>
				<category><![CDATA[EDI]]></category>
		<category><![CDATA[Line Item]]></category>
		<category><![CDATA[Segments]]></category>
		<category><![CDATA[b2b]]></category>
		<category><![CDATA[ACK]]></category>
		<category><![CDATA[PO1]]></category>
		<category><![CDATA[Segment]]></category>

		<guid isPermaLink="false">http://www.theintegrationengineer.com/?p=831</guid>
		<description><![CDATA[ACK is an Acknowledgment segment.  It is commonly found on response transactions to Purchase Orders or 855.  It is one of the lines found in the PO1 loop or group.  As this line modifies the PO1 line data from the Purchase Order, what it can contain and how that data is handled is [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignleft size-full wp-image-840" title="ACK_Block" src="http://www.theintegrationengineer.com/wp-content/uploads/2009/10/ACK_Block.png" alt="ACK Block Line Item Part Three, The ACK" width="120" height="40" />ACK is an Acknowledgment segment.  It is commonly found on response transactions to Purchase Orders or 855.  It is one of the lines found in the PO1 loop or group.  As this line modifies the PO1 line data from the Purchase Order, what it can contain and how that data is handled is important for the stability of the supply chain integration.  For clarity, we are going to use the 4010 x12 standard.</p>
<p><span id="more-831"></span></p>
<p><strong>Parts of ACK</strong></p>
<p>Here is a diagram of a sample ACK segment:</p>
<p><strong><img class="alignnone size-full wp-image-844" title="ACK_Diagram" src="http://www.theintegrationengineer.com/wp-content/uploads/2009/10/ACK_Diagram.png" alt="ACK Diagram Line Item Part Three, The ACK" width="629" height="304" /><br />
</strong></p>
<p>Like any other segment in EDI, the ACK segment is composed of elements.  Here is a list, element by element and what it contains.</p>
<table border="1" cellspacing="0" cellpadding="5" width="100%">
<tbody>
<tr>
<td width="10%" align="left" valign="top"><em>ACK_01</em></td>
<td>This is the Line Item Status Code.  This code can be the entire purpose of the ACK line if it indicates that the line is cancelled, or it can indicate that something has changed.  The Diagram above has a Status Code of &#8220;IP&#8221; indicating that the price from the Order has changed.  The ACK should then reflect the changed price here.  In the case of an 855 that indicates the part number has changed or substituted the status will be &#8220;IS&#8221; and the new part number will be listed in the Product or Service ID element.  The PO1 line that this ACK is a part of should contain the original part number, price, quantity, or whatever was on the order, and the ACK will contain the modification.</td>
</tr>
<tr>
<td width="10%" align="left" valign="top"><em>ACK_02 </em></td>
<td>This is the quantity modified.  This is not required, but is very important.  If the order was for 10 items, and there is a change, substitution or delay in 5 of them, a PO1 group should contain 2 ACK lines one with the accepted status on the 5 that are ok, and another for the 5 that are</td>
</tr>
<tr>
<td width="10%" align="left" valign="top"><em>ACK_03 </em></td>
<td>This is the Unit of Measure.  It is a 2 character, Alpha-Numeric value.  It is also an encoded value.  Being “encoded” means that there is a list of acceptable values for this element, any value outside of that set is invalid and will cause an exception.When the ACK_02 and ACK_03 are used together, we can tell how much of something is being modified or acknowledged</td>
</tr>
<tr>
<td width="10%" align="left" valign="top"><em>ACK_04 </em></td>
<td>This is the date Qualifier.  This is not required, even if ACK_05 is present, this element may be empty.  When it is present, it is an encoded value that identifies what type of data is in the ACK_05.  In the case of our example, it is the PO date.</td>
</tr>
<tr>
<td width="10%" align="left" valign="top"><em>ACK_05 </em></td>
<td>This is a Date element.  It is required if ACK_04 is populated.  The format is CCYYMMDD.  This element is always 8 characters long when it is populated.</td>
</tr>
<tr>
<td width="10%" align="left" valign="top"><em>ACK_06 </em></td>
<td>This is a reference number.  I have never seen this used, but if you have a use for it, go ahead.</td>
</tr>
<tr>
<td width="10%" align="left" valign="top"><em>ACK_07 </em></td>
<td>This is a Product or Service Qualifier.  This element is a 2 character, encoded value.  All of the “Qualifier” defined elements are encoded values.  This, again, means that there is a list of acceptable values for this element, any value outside of that set is invalid and will cause an exception.This qualifier defines what type of value is found in the next element, the ACK_08.  So if the ACK_07 has a “VC”, then the ACK_08 contains a Vendor’s Catalog Number.  (This means it is a part number as found in the Vendor Catalog.)</td>
</tr>
<tr>
<td width="10%" align="left" valign="top"><em>ACK_08 </em></td>
<td>This is a Product or Service ID.  It is Alpha-Numeric, and can be from 1 to 48 characters in length.  It is conditional with the ACK_07, if one is present, the other must be present.  This value is an identifier like a part number or other type of line item data.</td>
</tr>
<tr>
<td width="10%" align="left" valign="top"><em>ACK_09 to ACK_26 </em></td>
<td>This pattern continues all way to <em>ACK_25 </em>and <em>ACK_26. </em>All of the segment pairs from ACK_07 to ACK_26 that have the same potential values for each pair.</td>
</tr>
<tr>
<td width="10%" align="left" valign="top">ACK_27</td>
<td>This is Agency Qualifier Code.  It is an 2 character encoded value to designate what agency, state or entity is being referenced.  It is not required and I have never seen this used.</td>
</tr>
<tr>
<td width="10%" align="left" valign="top">ACK_28</td>
<td>This is Source SubQualifier.  It is an 15 character Alpha-Numeric value that references the source table being used.  It is not required and I have never seen this used.</td>
</tr>
<tr>
<td width="10%" align="left" valign="top">ACK_29</td>
<td>This is Industry Code.  It is an 30 character Alpha-Numeric value that references an industry code list.  It is not required and I have never seen this used.</td>
</tr>
</tbody>
</table>
<p><strong>Best Practices</strong></p>
<p>With the ACK the best practices are more in how to implement and what to expect.  So here are some things to remember when implementing this segment.</p>
<ol>
<li>An ACK is part of a PO1 line for a response to another PO1 line transaction.  This segment supplies a status, and can modify the line item contents.</li>
<li>There can be more than one ACK segment for a line item.  (4010 855s allow 104 repetitions of the ACK)</li>
<li>When an ACK explicitly changes the line item it can only change that one type.</li>
<li>There is a status called Accepted With Changes.  &#8220;AC&#8221;  For this, you will need to parse the ACK and see if any of the values have changed.</li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://www.theintegrationengineer.com/line-item-part-three-the-ack/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Line Item part two, IT1</title>
		<link>http://www.theintegrationengineer.com/line-item-part-two-it1/</link>
		<comments>http://www.theintegrationengineer.com/line-item-part-two-it1/#comments</comments>
		<pubDate>Thu, 15 Oct 2009 14:56:23 +0000</pubDate>
		<dc:creator>Roy</dc:creator>
				<category><![CDATA[EDI]]></category>
		<category><![CDATA[Segments]]></category>
		<category><![CDATA[b2b]]></category>
		<category><![CDATA[best practice]]></category>
		<category><![CDATA[content]]></category>
		<category><![CDATA[IT1]]></category>
		<category><![CDATA[Line Item]]></category>
		<category><![CDATA[PO1]]></category>
		<category><![CDATA[Segment]]></category>
		<category><![CDATA[usage]]></category>

		<guid isPermaLink="false">http://www.theintegrationengineer.com/?p=726</guid>
		<description><![CDATA[Like the PO1 segment, IT1 is another line item segment used in the supply chain.  This is the line item segment found in invoices.  And since invoices make up an important part of a supply chain, I wanted to spend another article on this segment.  (IT1 is a group or loop so it is more [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignleft size-full wp-image-820" title="IT1_Block" src="http://www.theintegrationengineer.com/wp-content/uploads/2009/10/IT1_Block.png" alt="IT1 Block Line Item part two, IT1" width="100" height="75" />Like the PO1 segment, IT1 is another line item segment used in the supply chain.  This is the line item segment found in invoices.  And since invoices make up an important part of a supply chain, I wanted to spend another article on this segment.  (IT1 is a <a href="../edi-repeated-segments/">group or loop</a> so it is more than just a segment.)  In this article we will discuss what data is found on the IT1 segment, and how it should be handled on both inbound and outbound document.  For clarity, we are going to use the 4010 x12 standard.</p>
<p><span id="more-726"></span></p>
<p><strong>Parts of IT1</strong></p>
<p>Here is a diagram of a sample IT1 segment.<strong><br />
</strong></p>
<p><strong><img class="alignnone size-full wp-image-825" title="IT1_Diagram" src="http://www.theintegrationengineer.com/wp-content/uploads/2009/10/IT1_Diagram1.png" alt="IT1 Diagram1 Line Item part two, IT1" width="563" height="329" /><br />
</strong></p>
<p>Like any other segment in EDI, the IT1 segment is composed of elements.  Here is a list, element by element and what it contains.</p>
<table border="1" cellspacing="0" cellpadding="5" width="100%">
<tbody>
<tr>
<td width="10%" align="left" valign="top"><em>IT1_01</em></td>
<td>This is the Line Identifier, or Line Number.  This is a value that must be unique among the lines or IT1 segments of a Invoice.  There is no rule that these must be incrementing integers starting at 1.  But it is normal for these to be Numeric even if the type is Alpha-Numeric.  And it is general practice to have them reflect the Line Number of the Purchase Order they are invoicing.  Because this is some times not possible, the IT101 is optional.  All effort should be made to include it, but for lines that have no number from the PO associated with them, it is sometimes a good practice to just leave this blank.  When handling IT1 lines in invoices produced by others, it is essential that you verify the line item with a secondary value other than just the line number.  Using a part number or &#8220;Product or Service ID Value&#8221; to match against the line is a good best practice.</td>
</tr>
<tr>
<td width="10%" align="left" valign="top"><em>IT1_02 </em></td>
<td>This is the quantity invoiced.  Most of the time people will just call this the quantity, but there are places and times, (like in an invoices) that quantity ordered and other quantities have a distinction.  The quantity is Numeric integers only.  Invoicing fractions of something is not supported.  The IT1_02 is conditional with the IT1_03 and IT1_04, if one exists all others are required.</td>
</tr>
<tr>
<td width="10%" align="left" valign="top"><em>IT1_03 </em></td>
<td>This is the Unit of Measure.  It is a 2 character, Alpha-Numeric value.  It is also an encoded value.  Being “encoded” means that there is a list of acceptable values for this element, any value outside of that set is invalid and will cause an exception.When the IT1_02 and IT1_03 are used together, we can tell how much of something is being Invoiced.  1 CA (1 case) is not the same as Invoicing 1 EA (1 each) of an item.</td>
</tr>
<tr>
<td width="10%" align="left" valign="top"><em>IT1_04 </em></td>
<td>This is the Price.  This is a Numeric, but can be decimal it is not strictly currency formatted, so it is possible to have item prices precise past $0.01.  This is the price of a single item, so we would multiply the IT1_02 and the IT1_04 to arrive at the cost of the line item.  (We might also have a additional charges or tax on a line item in another segment within the IT1 loop.  If this is the case, that cost would also be included in the cost total of the line item but not multiplied by the quantity.)</td>
</tr>
<tr>
<td width="10%" align="left" valign="top"><em>IT1_05 </em></td>
<td>This is the Price Basis Code.  This is optional, and most of the time is not used.  If it is used, it denotes where the IT1_04 price was derived from.</td>
</tr>
<tr>
<td width="10%" align="left" valign="top"><em>IT1_06 </em></td>
<td>Is a Product or Service Qualifier.  This element is a 2 character, encoded value.  All of the “Qualifier” defined elements are encoded values.  This, again, means that there is a list of acceptable values for this element, any value outside of that set is invalid and will cause an exception.This qualifier defines what type of value is found in the next element, the IT1_07.  So if the IT1_06 has a “VC”, then the IT1_07 contains a Vendor’s Catalog Number.  (This means it is a part number as found in the Vendor Catalog.)</td>
</tr>
<tr>
<td width="10%" align="left" valign="top"><em>IT1_07 </em></td>
<td>This is a Product or Service ID.  It is Alpha-Numeric, and can be from 1 to 48 characters in length.  It is conditional with the IT1_06, if one is present, the other must be present.  This value is an identifier like a part number or other type of line item data.</td>
</tr>
<tr>
<td width="10%" align="left" valign="top"><em>IT1_08 </em></td>
<td>The IT1_08 has the exact same definition as the IT1_06 with the exception that it defines the type of value is found in the IT1_09.</td>
</tr>
<tr>
<td width="10%" align="left" valign="top"><em>IT1_09 </em></td>
<td>The IT1_09 has the exact same definition as the IT1_07.  This is a Product or Service ID.  It is Alpha-Numeric, and can be from 1 to 48 characters in length.  It is conditional with the IT1_08, if one is present, the other must be present.  This value is an identifier like a part number or other type of line item data.</td>
</tr>
<tr>
<td width="10%" align="left" valign="top"><em>IT1_06 to IT1_25</em></td>
<td>This pattern continues all way to <em>IT1_24 </em>and <em>IT1_25. </em>All of the segment pairs from IT1_06 to IT1_25 that have the same potential values for each pair.  In earlier version of EDI, like 3010, the IT1 segment only had 23 elements.  Or in other words it was one Product or Service pair shorter that what we have in  4010.</td>
</tr>
</tbody>
</table>
<p>I wrote a section on Line Item Good Form and Best Practices in the article about <a href="http://www.theintegrationengineer.com/line-item-part-one-po1/">PO1 Line Items</a>.  Instead of repeating that I will just let you hop over there are read it.</p>
<p><strong>IT1 Loop Segments</strong></p>
<p>As we said in the beginning, the IT1 is a segment, and a <a href="../edi-repeated-segments/">loop/group.</a> And as you may have noticed, there is data that you may need that is not covered in the elements available in the IT1 Segment that belong to the line item.  Values like Tax information, found in the TAX and TXI segments.  These and other values are found on the line item, but are not on the IT1 segment.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.theintegrationengineer.com/line-item-part-two-it1/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Line Item Part one, PO1</title>
		<link>http://www.theintegrationengineer.com/line-item-part-one-po1/</link>
		<comments>http://www.theintegrationengineer.com/line-item-part-one-po1/#comments</comments>
		<pubDate>Fri, 02 Oct 2009 16:40:28 +0000</pubDate>
		<dc:creator>Roy</dc:creator>
				<category><![CDATA[EDI]]></category>
		<category><![CDATA[Elements]]></category>
		<category><![CDATA[Segments]]></category>
		<category><![CDATA[b2b]]></category>
		<category><![CDATA[850]]></category>
		<category><![CDATA[E-Commerce]]></category>
		<category><![CDATA[Line Item]]></category>
		<category><![CDATA[PO]]></category>
		<category><![CDATA[Purchase Order]]></category>
		<category><![CDATA[Segment]]></category>

		<guid isPermaLink="false">http://www.theintegrationengineer.com/?p=725</guid>
		<description><![CDATA[When we are dealing with supply chain or e-commerce related EDI, we probably will deal with line item data.  On a Purchase Order, (PO) or 850, the line item data is contained on the PO1 segment or the PO1 group.  (PO1 is a group or loop so it is more than just a segment.)  In [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignleft size-full wp-image-761" title="PO1_Block" src="http://www.theintegrationengineer.com/wp-content/uploads/2009/10/PO1_Block.png" alt="PO1 Block Line Item Part one, PO1" width="101" height="54" />When we are dealing with supply chain or e-commerce related EDI, we probably will deal with line item data.  On a Purchase Order, (PO) or 850, the line item data is contained on the PO1 segment or the PO1 group.  (PO1 is a <a href="http://www.theintegrationengineer.com/edi-repeated-segments/">group or loop</a> so it is more than just a segment.)  In this article we will discuss what data is found on the PO1 segment, and how it should be handled on both inbound and outbound document.  For clarity, we are going to use the 4010 x12 standard.  The PO1 hasn&#8217;t changed in content for a while, but it has gotten longer, (you will see how this works when we talk about the PO1 elements).<span id="more-725"></span></p>
<p><strong>Parts of the PO1</strong></p>
<p>Here is a diagram of a sample PO1 segment:</p>
<p style="text-align: center;">
<p><img class="size-full wp-image-757 aligncenter" title="PO1_Diagram" src="http://www.theintegrationengineer.com/wp-content/uploads/2009/10/PO1_Diagram.png" alt="PO1 Diagram Line Item Part one, PO1" width="566" height="319" /></p>
<p>Like any other segment in EDI, the PO1 segment is composed of elements.  Here is a list, element by element and what it contains.</p>
<table border="1" cellspacing="0" cellpadding="5" width="100%">
<tbody>
<tr>
<td width="10%" align="left" valign="top"><em>PO1_01</em></td>
<td>This is the Line Identifier, or Line Number.  This is a value that must be unique among the lines or PO1 segments of a purchase order.  There is no rule that these must be incrementing integers starting at 1.  But it is normal for these to be Numeric even if the type is Alpha-Numeric.  And it is general practice to have them increment in some fashion.  Thus having the first line item number as 1.  The second as 2, and so forth.  I have also seen the first line item being 10 , the second 20 and so forth.  As well as 001 and 002.</p>
<p>In any case, I would discourage using random numbers.  And I would discourage using Alpha-Numerics.  These may confuse your trading partners and cause them to have exceptions that there is no need to have.  On the other hand, when planning on handling line numbers from other parties, you should expect that they might not be using nice incrementing numbers.  This will prevent getting exceptions in your system when your trading partner does something odd.</td>
</tr>
<tr>
<td width="10%" align="left" valign="top"><em>PO1_02 </em></td>
<td>This is the quantity ordered.  Most of the time people will just call this the quantity, but there are places and times, (like in order responses, invoices and shipping notices) that quantity ordered and other quantities have a distinction.  The quantity is Numeric integers only.  Ordering fractions of something is not supported.  The PO1_02 is conditional with the PO1_03, if one exists the other is required.</td>
</tr>
<tr>
<td width="10%" align="left" valign="top"><em>PO1_03 </em></td>
<td>This is the Unit of Measure.  It is a 2 character, Alpha-Numeric value.  It is also an encoded value.  Being &#8220;encoded&#8221; means that there is a list of acceptable values for this element, any value outside of that set is invalid and will cause an exception.</p>
<p>When the PO1_02 and PO1_03 are used together, we can tell how much of something is being ordered.  1 CA (1 case) is not the same as ordering 1 EA (1 each) of an item.  Generally this is not a problem.  The data in the catalog is accurate.  When there is a problem, it is important to go back to the PO to find out exactly how many items were ordered and in what UOM.</td>
</tr>
<tr>
<td width="10%" align="left" valign="top"><em>PO1_04 </em></td>
<td>This is the Price.  It is optional, but most of the time is present.  It is required if the PO1_05 is present.  This is a Numeric, but can be decimal  it is not strictly currency formatted, so it is possible to have item prices that precise past .01.  This is the price of a single item, so we would multiply the PO1_02 and the PO1_04 to arrive at the cost of the line item.</td>
</tr>
<tr>
<td width="10%" align="left" valign="top"><em>PO1_05 </em></td>
<td>This is the Price Basis Code.  This is optional, and most of the time is not used.  If it is used, it denotes where the PO1_04 price was derived from.</td>
</tr>
<tr>
<td width="10%" align="left" valign="top"><em>PO1_06 </em></td>
<td>Is a Product or Service Qualifier.  This element is a 2 character, encoded value.  All of the &#8220;Qualifier&#8221; defined elements are encoded values.  This, again, means that there is a list of acceptable values for this element, any value outside of that set is invalid and will cause an exception.</p>
<p>This qualifier defines what type of value is found in the next element, the PO1_07.  So if the PO1_06 has a &#8220;VC&#8221;, then the PO1_07 contains a Vendor&#8217;s Catalog Number.  (This means it is a part number as found in the Vendor Catalog.)</td>
</tr>
<tr>
<td width="10%" align="left" valign="top"><em>PO1_07 </em></td>
<td>This is a Product or Service ID.  It is Alpha-Numeric, and can be from 1 to 48 characters in length.  It is conditional with the PO1_06, if one is present, the other must be present.  This value is an identifier like a part number or other type of line item data.</td>
</tr>
<tr>
<td width="10%" align="left" valign="top"><em>PO1_08 </em></td>
<td>The PO1_08 has the exact same definition as the PO1_06 with the exception that it defines the type of value is found in the PO1_09.</td>
</tr>
<tr>
<td width="10%" align="left" valign="top"><em>PO1_09 </em></td>
<td>The PO1_09 has the exact same definition as the PO1_07.  This is a Product or Service ID.  It is Alpha-Numeric, and can be from 1 to 48 characters in length.  It is conditional with the PO1_08, if one is present, the other must be present.  This value is an identifier like a part number or other type of line item data.</td>
</tr>
<tr>
<td width="10%" align="left" valign="top">PO1_06 to PO1_25</td>
<td>This pattern continues all way to <em>PO1_24 </em>and <em>PO1_25. </em>All of the segment pairs from PO1_06 t PO1_25 that have the same potential values for each pair.  In earlier version of EDI, like 3010, the PO1 segment only had 23 elements.  Or in other words it was one Product or Service pair shorter that what we have in  4010.</td>
</tr>
</tbody>
</table>
<p><strong>Good Form on PO1 line</strong></p>
<p><a href="http://www.theintegrationengineer.com/edi-in-good-form/">EDI in Good Form</a> is both style and best practice tips to avoid common exceptions.  Paying attention to good form tips and best practices helps you create an integration solution that is not only complies to the standard, but functions to help you and your trading partner have an unnecessary support burden due to the avoidable unexpected.</p>
<p>1.  It is bad from to have PO1 Product and Service pairs that are empty.  This relates to not having any trailing element delimiters.  It also goes along with not having empty pairs in the line with populated Product and Service element pairs following.  Thus it is best to build your mapping so that optional data doesn&#8217;t create empty elements when it opts out.</p>
<p>2.  When reading a PO1 line, it is best to assume that an expected Product and Service value could be in any pair.  So the map needs to walk down the pairs of elements until it finds the qualifier that indicates the value you are looking for.  This allows you to use the same input map with multiple EDI producing trading partners that may have interpreted the priority of data in different ways, and avoid exceptions.</p>
<p>3.  When producing EDI with a PO1 line, it is best to be as consistent as possible with your placement of the Product and Service data.  Create your logic and mapping so that mandatory data occurs early in the PO1 line, and optional data is moved to the end.  This will keep your required data from hopping around positionally.  This will help your trading partners that may not have had the foresight to follow Good Form Tip number 2 from having exceptions that slow down you process.</p>
<p><strong>PO1 Loop Segments</strong></p>
<p>As we said in the beginning, the PO1 is a segment, and a <a href="http://www.theintegrationengineer.com/edi-repeated-segments/">loop/group.</a> And as you may have noticed, there is data that you may need that is not covered in the elements available in the PO1 Segment that belong to the line item.  Values like Item Description, found in the PID segment. Or Tax information, found in the TAX and TXI segments.  These and other values are found on the line item, but are not on the PO1 segment.  We will have talk about some of these other segments and where to find other common data on another day.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.theintegrationengineer.com/line-item-part-one-po1/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>EDI Repeated Segments</title>
		<link>http://www.theintegrationengineer.com/edi-repeated-segments/</link>
		<comments>http://www.theintegrationengineer.com/edi-repeated-segments/#comments</comments>
		<pubDate>Sun, 28 Jun 2009 17:13:59 +0000</pubDate>
		<dc:creator>Roy</dc:creator>
				<category><![CDATA[EDI]]></category>
		<category><![CDATA[Segments]]></category>
		<category><![CDATA[b2b]]></category>
		<category><![CDATA[context]]></category>
		<category><![CDATA[Envelope]]></category>
		<category><![CDATA[Group]]></category>
		<category><![CDATA[Loop]]></category>
		<category><![CDATA[Repeating]]></category>
		<category><![CDATA[Segment]]></category>

		<guid isPermaLink="false">http://www.theintegrationengineer.com/?p=133</guid>
		<description><![CDATA[In EDI there is a construct called a Loop.  But this is not like you think of a loop using an while  statement.  EDI is a file format, not a programming language.  When we speak of Loops in EDI, what we are really talking about is repeated structures, or segments.
EDI is not a flat file, [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignleft size-full wp-image-134" title="loop" src="http://www.theintegrationengineer.com/wp-content/uploads/2009/05/loop.jpg" alt="loop EDI Repeated Segments" width="102" height="102" />In EDI there is a construct called a Loop.  But this is not like you think of a loop using an while  statement.  EDI is a file format, not a programming language.  When we speak of Loops in EDI, what we are really talking about is repeated structures, or segments.</p>
<p>EDI is not a <a href="http://www.theintegrationengineer.com/flat-files/">flat file</a>, but it does have repeated lines or segments.  Some times this repetition comes in groups and sometimes its just a line that get repeated in part of the document.  Repeating structured data is fundamental to EDI, but can become difficult to interpret at times.  Understanding the types of repeating structures and when and where they may occur can save a lot of time.<span id="more-133"></span></p>
<h2>Repetition</h2>
<p>There are three kinds of loops/repeated segments; First there is a simple segment that can appear more than once.  Lets call this a Repeating Segment.  Second there is a group of segments that appear together, and may repeat.  Lets call this a Repeating Group.  And finally there is a segment or group that repeats within a beginning and ending loop envelope.  Lets call this a Repeating Envelop.</p>
<h2>Repeating Segments</h2>
<p>A repeating segment is pretty much just what it sounds like, a segment that may occur more than one time.  A good example of this would be the AMT segment.  The AMT is a segment that contains a monetary value.  The AMT_01 declares what type of value it is, and the AMT_02 has the amount of money.  In an EDI document like an invoice, we may need to have many values, subtotals, taxes, base price, and so on.  Having a repeating segment lets us put all of these values on their own independent segment to be interpreted and included as best fits the Trading Partners and the nature of the transaction.<a href="http://12967i2wnvdrcfsnl1fdmv2gvr.hop.clickbank.net/" target="_top"><img class="alignright size-full" src="http://www.pdf-creator.us/images/m-softbox.jpg" width="176" height="338" title="EDI Repeated Segments" alt="m softbox EDI Repeated Segments" /></a></p>
<p>Here is an example of an <a href="http://www.theintegrationengineer.com/edi-wrapped-and-unwrapped/">unwrapped</a> N1 group where the N3 is repeated:</p>
<p>N1*AC*ARTHUR JONES*1*9012345918341*11*SE~<br />
N2*GEORGE WASHINGTON~<br />
N3*157 WEST 57TH STREET~<br />
N3*Suite 2001*5th Floor~<br />
N4*CINCINNATI*OH*43017~</p>
<p>When segments are repeatable, they are indicated with a &#8220;Max Use&#8221; value of greater than one in the <a href="http://www.theintegrationengineer.com/tool-box/#Spec">standards and usage specification</a>.  In the N1 Group, the N2 and N3 segments may have a max use of 2.</p>
<h2>Repeating Groups</h2>
<p>A repeating group is also what it sounds like.  It is a group of segments that work together and get repeated.  This loop is generally referred to by the primary segment.  This segment is required in this group.  This means that if this group occurs, this segment must also occur.</p>
<p>Most Repeating Groups are contextual.  This means that they are defined by the segments that surround them, and are terminated by the first segment that is not in the group, or starting the group again.  So a Repeating Group may repeat, but as soon as we move out of the segments in this group, we are done repeating it and move on to the next segments or groups defined in the standard.</p>
<p>The N1 is a good example.  The N1 group contains name, address and contact related information.  The only required segment is the N1.  Subordinate to the N1 (that contains name and such) is the N2 (that contains secondary name or attention type data.) Then comes the N3 (with the street address) and then the N4 (with the city, state, country, zip).</p>
<p>Not all groups have the same letters, like &#8216;N&#8217; and the N1 group is no different.  It also contains the PER segment that contains a persons name, and contact info like phone number or email.  Any PER that happens under an N1 is for that location.</p>
<p>In a document like an order you may want to have the address and contact for the shipper, the receiver, a biller, and a payer.  There are many possibilities, and these are all repeated in this group. Here is an example of an <a href="http://www.theintegrationengineer.com/edi-wrapped-and-unwrapped/">unwrapped</a> N1 group where the that is repeated:</p>
<p>N1*ST*MRS JONES*1*123456789*11*SE~<br />
N2*BEVERLY SIMPSON~<br />
N3*157 WEST 57TH STREET~<br />
N4*CINCINNATI*OH*43017~<br />
N1*SF*MR JONES*1*9012345918341*11*SE~<br />
N2*MAGGIE MCGILLICUTTY~<br />
N3*1001 MAPLE STREET~<br />
N4*PITTSBURGH*PA*86753~</p>
<p>Segments that are in a repeating group are listed as being in a Loop.  They may be repeated whenever the loop is repeated as specified in the <a href="http://www.theintegrationengineer.com/tool-box/#Spec">standards and usage specification</a>.  Thus you may have a max use of the N3 as 2, and an N1 Loop that has a max use of 1000.  So really you could see 2000 N3 segments, (2 for each of the 1000 possible N1 loops).</p>
<h2>Repeating Envelope</h2>
<p>A repeating envelope makes reference to EDI Enveloping.  Basically, the ISA-IEA envelope can contain one or more GS-GE envelopes.  And each GS-GE can contain more than one ST-SE envelope.  These levels of enveloping are covered in greater detail on the <a href="http://www.theintegrationengineer.com/edi-enveloping-part-one/">EDI Enveloping</a> page.  But it doesn&#8217;t have to stop there.  In the 3050 850 document there is a loop called LS-LE that contains terms.  This section happens inside the ST-SE.  And there is nothing to prevent other sub envelops from happening where there is a need.</p>
<p>What is fundamental to these types of loops is that they have a designated beginning, and ending.  They must have both.  Repeating Groups end when a beginning of a new iteration of the loop is found, or a segment that is not in the group is found.  This can leave some ambiguity if the standard is not followed closely.  The Repeating Envelope leaves nothing to chance and declares that it is done.</p>
<h2>A note about Required segments</h2>
<p>You may have noticed in the examples above or in the specification that we referenced that there are required segments in loops that are optional.  This is not a contradiction and I will explain this here.  A loop may be optional.  If it is, then it may be ommitted entirely from a document while still compliant with the standard.  If the loop is included, then the required and optional segments within that loop apply.  And they apply in each instance of the loop.  (We can&#8217;t have an second N1 loop unless we include the required N1 segment.)</p>
<p>Basically this is like scope in XML.  The requirements of mandatory or optional only apply within the scope of the loop where they are defines. in the same fashion as sub nodes in and XML hierarchy.</p>
<h2>Basic Fundamentals to Remember</h2>
<ol>
<li>Some segments can occur more than once, or can be repeated.</li>
<li>Some groups of segments can and often do occur more than once.  These are contextual and are terminated by segments after the group in the standard.</li>
<li>Some segments are encapsulated in beginning and ending segments like enveloping.  These segments can repeat, but only in another encapsulation or envelope.</li>
<li>The standard will indicate when repetition is allowed.</li>
</ol>
<p>&#8211;</p>
<p>Looking for something else relating to EDI?  Check out the <a href="http://www.theintegrationengineer.com/the-edi-primer/">EDI Primer</a> post</p>
<p>&#8211;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.theintegrationengineer.com/edi-repeated-segments/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>EDI Enveloping Part Four (The ST)</title>
		<link>http://www.theintegrationengineer.com/edi-enveloping-part-four-the-st/</link>
		<comments>http://www.theintegrationengineer.com/edi-enveloping-part-four-the-st/#comments</comments>
		<pubDate>Tue, 26 May 2009 16:00:44 +0000</pubDate>
		<dc:creator>Roy</dc:creator>
				<category><![CDATA[EDI]]></category>
		<category><![CDATA[Envelope]]></category>
		<category><![CDATA[ST]]></category>
		<category><![CDATA[Segments]]></category>
		<category><![CDATA[b2b]]></category>
		<category><![CDATA[Control Numbers]]></category>
		<category><![CDATA[counter]]></category>
		<category><![CDATA[Document]]></category>
		<category><![CDATA[Document Identifier]]></category>
		<category><![CDATA[Document Type]]></category>
		<category><![CDATA[format]]></category>
		<category><![CDATA[SE]]></category>
		<category><![CDATA[segment counter]]></category>
		<category><![CDATA[ST-SE]]></category>

		<guid isPermaLink="false">http://www.theintegrationengineer.com/?p=124</guid>
		<description><![CDATA[The 3rd layer of the EDI envelope is the ST segment.  The ST segment contains a Document Identifier, and a control number. The ST and its partner the SE segment define the beginning and ending of the Document.  The SE segment contains a counter of segments within the document, and the corresponding control number to [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignleft size-full wp-image-129" title="scroll" src="http://www.theintegrationengineer.com/wp-content/uploads/2009/05/scroll.jpg" alt="scroll EDI Enveloping Part Four (The ST)" width="76" height="101" />The 3rd layer of the EDI envelope is the ST segment.  The ST segment contains a Document Identifier, and a control number. The ST and its partner the SE segment define the beginning and ending of the Document.  The SE segment contains a counter of segments within the document, and the corresponding control number to the ST.  Relatively simple compared to the ISA and the GS.<span id="more-124"></span></p>
<p><strong>Document Identifier</strong></p>
<p>The document Identifier is not encoded.  That is to say, for an 850 the ST document ID is &#8220;850&#8243;.  For an 810, the Document Identifier is &#8220;810&#8243; and so on.  Thus if you open an EDI file, and don&#8217;t recognize the GS_01, skip to the ST_01 and it will tell you what standard you will need to find to read this document.</p>
<p>Good form would dictate that the GS_01 and the ST_01 would specify the same type of document.  The GS would specify it on a functional level, and the ST on the standard level.  Thus they would not be identical strings but would indeed convey the same message about what the document(s) would be.  Some EDI translator or processing software will validate this relationship and some may not.  But in the end consistency is the best policy.</p>
<p><strong>Control Number</strong></p>
<p>The control number is different for the ST than we saw in both the ISA and GS.  The ST_02 is a 3 to 9 digit number.  This means that it will start with 001 not 000000001.  Of course you can still use a 000000001 but don&#8217;t be surprised when you see less than 9 digits in the ST-SE control number.  Whichever you chose, you must do the same for both the ST and SE.</p>
<p>(Using 000 or 000000000 may be allowed, but is not recommended as any application that trims the zeroes will get an empty string and produce an error.  Be nice and only use values greater than zero.)</p>
<p><strong>Segment Counter</strong></p>
<p>The SE segment counter is the part of the ST-SE that gives people hand editing an EDI document the most trouble.  If the counter is inaccurate it indicates that the document is corrupted.  This should fail in all good translators as processing a corrupt EDI file is saying, &#8220;Its okay if we get bad data.&#8221;  This counter represents the number of segment between the ST and before the SE.</p>
<p>And it is just that simple.  Remember that you can have more than one GS-GE envelope inside an ISA-IEA, and you can have more than one ST-SE inside a GS-GE, but you can only have one document of one type in side a ST-SE envelope.</p>
<p>–</p>
<p>For an overview of Enveloping go <a href="http://www.theintegrationengineer.com/edi-enveloping-part-one/">here</a>.</p>
<p>Looking for the <a href="http://www.theintegrationengineer.com/edi-enveloping-part-two-the-isa/">ISA enveloping page</a>?</p>
<p>Looking for the  <a href="http://www.theintegrationengineer.com/edi-enveloping-part-three-the-gs">GS enveloping page?</a></p>
<p>Looking for something else relating to EDI?  Check out the <a href="http://www.theintegrationengineer.com/the-edi-primer/">EDI Primer</a> post</p>
<p><object id="Player_b2b49725-0564-4e90-a2d5-2f349cb25499" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="400px" height="150px" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="quality" value="high" /><param name="bgcolor" value="#FFFFFF" /><param name="allowscriptaccess" value="always" /><param name="src" value="http://ws.amazon.com/widgets/q?ServiceVersion=20070822&amp;MarketPlace=US&amp;ID=V20070822%2FUS%2Ftheinteengi-20%2F8010%2Fb2b49725-0564-4e90-a2d5-2f349cb25499&amp;Operation=GetDisplayTemplate" /><param name="name" value="Player_b2b49725-0564-4e90-a2d5-2f349cb25499" /><param name="align" value="middle" /><embed id="Player_b2b49725-0564-4e90-a2d5-2f349cb25499" type="application/x-shockwave-flash" width="400px" height="150px" src="http://ws.amazon.com/widgets/q?ServiceVersion=20070822&amp;MarketPlace=US&amp;ID=V20070822%2FUS%2Ftheinteengi-20%2F8010%2Fb2b49725-0564-4e90-a2d5-2f349cb25499&amp;Operation=GetDisplayTemplate" align="middle" name="Player_b2b49725-0564-4e90-a2d5-2f349cb25499" allowscriptaccess="always" bgcolor="#FFFFFF" quality="high"></embed></object> <noscript><A HREF="http://ws.amazon.com/widgets/q?ServiceVersion=20070822&#038;MarketPlace=US&#038;ID=V20070822%2FUS%2Ftheinteengi-20%2F8010%2Fb2b49725-0564-4e90-a2d5-2f349cb25499&#038;Operation=NoScript" mce_HREF="http://ws.amazon.com/widgets/q?ServiceVersion=20070822&amp;MarketPlace=US&amp;ID=V20070822%2FUS%2Ftheinteengi-20%2F8010%2Fb2b49725-0564-4e90-a2d5-2f349cb25499&amp;Operation=NoScript">Amazon.com Widgets</A></noscript></p>
]]></content:encoded>
			<wfw:commentRss>http://www.theintegrationengineer.com/edi-enveloping-part-four-the-st/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>EDI:  Wrapped and Unwrapped</title>
		<link>http://www.theintegrationengineer.com/edi-wrapped-and-unwrapped/</link>
		<comments>http://www.theintegrationengineer.com/edi-wrapped-and-unwrapped/#comments</comments>
		<pubDate>Mon, 18 May 2009 16:00:14 +0000</pubDate>
		<dc:creator>Roy</dc:creator>
				<category><![CDATA[EDI]]></category>
		<category><![CDATA[Segments]]></category>
		<category><![CDATA[b2b]]></category>
		<category><![CDATA[Flat File]]></category>
		<category><![CDATA[HowTo]]></category>
		<category><![CDATA[MS word]]></category>
		<category><![CDATA[new line]]></category>
		<category><![CDATA[newline]]></category>
		<category><![CDATA[search and replace]]></category>
		<category><![CDATA[substitution]]></category>
		<category><![CDATA[unwrap]]></category>
		<category><![CDATA[Unwrapped]]></category>
		<category><![CDATA[vi]]></category>
		<category><![CDATA[wrap]]></category>
		<category><![CDATA[Wrapped]]></category>
		<category><![CDATA[\n]]></category>

		<guid isPermaLink="false">http://www.theintegrationengineer.com/?p=126</guid>
		<description><![CDATA[EDI in its proper form is wrapped.  This means that there is nothing between the segment terminator and the beginning of the next segment.  Sometimes this is hard to read, for humans anyway.  And at those times people will unwrap the EDI so that it looks more like a flat file.  This is not hard [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignleft size-full wp-image-127" title="emptywrapper" src="http://www.theintegrationengineer.com/wp-content/uploads/2009/05/emptywrapper.jpg" alt="emptywrapper EDI:  Wrapped and Unwrapped" width="96" height="96" />EDI in its proper form is wrapped.  This means that there is nothing between the segment terminator and the beginning of the next <a href="http://www.theintegrationengineer.com/edi-segments/">segment</a>.  Sometimes this is hard to read, for humans anyway.  And at those times people will unwrap the EDI so that it looks more like a flat file.  This is not hard to do, and is useful for debugging and trouble shooting processes.  A good parser or validator should be able to read either file.<span id="more-126"></span></p>
<p><strong>Wrapped</strong></p>
<p>As I said wrapped EDI has nothing between the segment terminator and the next segment, in this format;</p>
<p style="text-align: center;">SEG|||~SEG||||||~</p>
<p>and so on.  Wrapped EDI looks like this:</p>
<p>ISA*00*          *00*          *01*9012345720000  *01*9088877320000  *090508*1459*U*00200*000000001*0*T*:~GS*PO*901234572000*908887732000*090508*1459*1*T*004010~ST*850*0001~BEG*01*BK*99AKDF9DAL393*39483920193843*20090508*AN3920943*AC*IBM*02*AE*02*BA~DTM*002*20090508*1615*CT*CM*DATE TIME PERIOD~N1*AC*ARTHUR JONES*1*9012345918341*11*SE~N2*MAGGIE MCGILLICUTTY*BEVERLY SIMPSON~N3*PO BOX 123*157 WEST 57TH STREET~N4*CINCINNATI*OH*43017*US*IP*02535~PER*AC*ARTHUR JONES*TE*(614)555-1212*TE*(614)555-1212*TE*(614)555-1212*ADDL CONTACT DESC~PO1*AAA849*100*DP*100.00*PD*AB*ASSEMBLY*BL*BRAND OR LABEL*ON*CUST12345*AB*ASSEMBLY*BL*BRAND OR LABEL*ON*CUST12345*AB*ASSEMBLY*BL*BRAND OR LABEL*ON*CUST12345*AB*ASSEMBLY~PID*F*BC*AX*UNSCENTED*GENERAL PURPOSE*BS*SUBQUALIFIER*N*ENG~CTT*10*855*12345678*HB*40*QD*GENERAL PURPOSE~SE*12*0001~GE*1*1~IEA*1*000000001~</p>
<p><strong>Unwrapped</strong></p>
<p>When we unwrap the EDI, we don&#8217;t just place any character between the segment terminator and the next segment, we place a carriage return and line feed.  This makes all of the segments appear to be justified like separate lines of a text file.  Thus the format is changed in this manner;</p>
<p style="text-align: center;">SEG|||~</p>
<p style="text-align: center;">SEG||||||~</p>
<p style="text-align: left;">and so on.  Unwrapped EDI looks like this:</p>
<p style="text-align: left;">ISA*00*          *00*          *01*9012345720000  *01*9088877320000  *090508*1459*U*00200*000000001*0*T*:~<br />
GS*PO*901234572000*908887732000*090508*1459*1*T*004010~<br />
ST*850*0001~<br />
BEG*01*BK*99AKDF9DAL393*39483920193843*20090508*AN3920943*AC*IBM*02*AE*02*BA~<br />
DTM*002*20090508*1615*CT*CM*DATE TIME PERIOD~<br />
N1*AC*ARTHUR JONES*1*9012345918341*11*SE~<br />
N2*MAGGIE MCGILLICUTTY*BEVERLY SIMPSON~<br />
N3*PO BOX 123*157 WEST 57TH STREET~<br />
N4*CINCINNATI*OH*43017*US*IP*02535~<br />
PER*AC*ARTHUR JONES*TE*(614)555-1212*TE*(614)555-1212*TE*(614)555-1212*ADDL CONTACT DESC~<br />
PO1*AAA849*100*DP*100.00*PD*AB*ASSEMBLY*BL*BRAND OR LABEL*ON*CUST12345*AB*ASSEMBLY*BL*BRAND OR LABEL*ON*CUST12345*AB*ASSEMBLY*BL*BRAND OR LABEL*ON*CUST12345*AB*ASSEMBLY~<br />
PID*F*BC*AX*UNSCENTED*GENERAL PURPOSE*BS*SUBQUALIFIER*N*ENG~<br />
CTT*10*855*12345678*HB*40*QD*GENERAL PURPOSE~<br />
SE*12*0001~<br />
GE*1*1~<br />
IEA*1*000000001~</p>
<p style="text-align: left;"><strong>Converting from Wrapped to Unwrapped and back</strong></p>
<p style="text-align: left;">When you need to do this, you need to do this fast, not manually.  Sure the manual way works with small files, but if you are trying to edit a big invoice or order, you will want to do something snappier than walking through the file segment at a time.  Here are two ways to do it with common tools.</p>
<p style="text-align: left;"><em><strong>VI</strong></em></p>
<p style="text-align: left;">To unwrap:</p>
<ol>
<li>open the file.  Type &#8220;vi [file name]&#8220;</li>
<li>Hit &#8220;:&#8221; to get the command prompt</li>
<li>Type &#8220;%&#8221; to do a every line replace. (may not be needed as this is wrapped, but it doesn&#8217;t hurt.)</li>
<li>Type &#8220;s&#8221; for a substitution.</li>
<li>Type &#8220;/&#8221; to begin the string to find.  (you may need to escape characters like ~ and | with a \.  I will show this in the example)</li>
<li>Type the delimiter to be replaced.</li>
<li>Type &#8220;/&#8221; to begin the replaced string (again with the possible need to escape characters.)</li>
<li>Type the delimiter again, as we don&#8217;t want to lose it, then follow it will a [crtl]+v and [crtl]+m</li>
<li>Type &#8220;/&#8221; to end the substitution</li>
<li>Type &#8220;g&#8221; to make it global or indicating all of the instances not just the first one.</li>
</ol>
<p style="text-align: left;">It looks like this:  &#8220;%s/[delimiter]/[delimiter]^M/g&#8221;</p>
<p style="text-align: left;">Put another way, here is what I typed for our example:  &#8220;%s/\~/\~^M/g&#8221;  (notice that I am escaping the ~ with a \)</p>
<p style="text-align: left;">To re-wrap:</p>
<ol>
<li>open the file.  Type &#8220;vi [file name]&#8220;</li>
<li>Hit &#8220;:&#8221; to get the command prompt</li>
<li>Type &#8220;%&#8221; to do a every line replace. (may not be needed as this is wrapped, but it doesn&#8217;t hurt.)</li>
<li>Type &#8220;s&#8221; for a substitution.</li>
<li>Type &#8220;/&#8221; to begin the string to find.  (you may need to escape characters like ~ and | with a \.  I will show this in the example)</li>
<li>Type &#8220;\n&#8221; to designate the newlines.</li>
<li>Type &#8220;/&#8221; to begin the replaced string (again with the possible need to escape characters.)</li>
<li>Type &#8220;//&#8221; to begin and end the substitution.</li>
<li>Type &#8220;g&#8221; so that it will get any multiples of the newline.</li>
</ol>
<p style="text-align: left;">It looks like this: &#8220;%s/\n//g&#8221;</p>
<p style="text-align: left;">
<p style="text-align: left;">
<p style="text-align: left;">
<p style="text-align: left;"><em><strong>MS Word</strong></em></p>
<p style="text-align: left;">To Unwrap:</p>
<ol>
<li>Open file.</li>
<li>Select Edit&gt;Replace or press [ctrl]+h</li>
<li>In the &#8220;Find what&#8221; field insert the delimiter.</li>
<li>In the &#8220;Replace with&#8221; field insert the delimiter, and then click on the &#8220;More&#8221; button on the bottom of the control.</li>
<li>In more, there is another button called &#8220;Special&#8221;  Click on this button and select &#8220;Manual Line Break&#8221;</li>
<li>Click replace all and the EDI will unwrap.</li>
</ol>
<p>To re-wrap:</p>
<ol>
<li>Open file.</li>
<li>Select Edit&gt;Replace or press [ctrl]+h</li>
<li>In the &#8220;Find what&#8221; field click on the &#8220;More&#8221; button on the bottom of the control.</li>
<li>In more, there is another button called &#8220;Special&#8221;  Click on this button and select &#8220;Manual Line Break&#8221;</li>
<li>Don&#8217;t put anything in the  &#8220;Replace with&#8221; field.</li>
<li>Click replace all and the EDI will re-wrap.</li>
</ol>
<p><em><strong>Other Tools:</strong></em></p>
<p>There are lots of other tools that can do the search and replace with newlines, these are only two ways.  If you have one that you would like to share, please let me know.</p>
<p>&#8212;</p>
<p>Looking for something else relating to EDI?  Try <a href="ttp://www.theintegrationengineer.com/the-edi-primer/">here</a>.</p>
<p style="text-align: left;">
<p style="text-align: left;">
<p style="text-align: left;">
<p style="text-align: left;">
<p style="text-align: left;">
]]></content:encoded>
			<wfw:commentRss>http://www.theintegrationengineer.com/edi-wrapped-and-unwrapped/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>EDI Elements</title>
		<link>http://www.theintegrationengineer.com/edi-elements/</link>
		<comments>http://www.theintegrationengineer.com/edi-elements/#comments</comments>
		<pubDate>Tue, 13 Jan 2009 16:44:18 +0000</pubDate>
		<dc:creator>Roy</dc:creator>
				<category><![CDATA[EDI]]></category>
		<category><![CDATA[Elements]]></category>
		<category><![CDATA[b2b]]></category>
		<category><![CDATA[Data]]></category>
		<category><![CDATA[data type]]></category>
		<category><![CDATA[Delimited]]></category>
		<category><![CDATA[element]]></category>
		<category><![CDATA[Element Notation]]></category>

		<guid isPermaLink="false">http://www.theintegrationengineer.com/?p=59</guid>
		<description><![CDATA[What is an Element?
In the context of delimited data files, an element is the contents between two delimiters.  Like in a spreadsheet, the element is the contents of a cell.  In EDI, we have delimited segments, and just like a delimited file, the contents between the delimiters is the element.
So in this segment &#8220;PO1*1*8*EA*10**SW*H11510.REF*CT*089480-00-B-0336~&#8221;, the [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignleft size-full wp-image-61" title="Element" src="http://www.theintegrationengineer.com/wp-content/uploads/2008/12/atomic_particle.png" alt="Element" width="99" height="95" /><strong>What is an Element?</strong></p>
<p>In the context of delimited data files, an element is the contents between two delimiters.  Like in a spreadsheet, the element is the contents of a cell.  In EDI, we have delimited segments, and just like a delimited file, the contents between the delimiters is the element.</p>
<p>So in this segment &#8220;PO1*1*8*EA*10**SW*H11510.REF*CT*089480-00-B-0336~&#8221;, the 5th element or PO1_04 is &#8220;10&#8243;, while the 6th element or PO1_05 is empty.</p>
<p><em>Empty elements are <a href="http://www.theintegrationengineer.com/the-nature-of-null">not necessarily null</a>.  Calling something null when the data type is know like an empty element can cause some data theory debates.  I don&#8217;t want to start one here, but may write about that philosophical discussion at a later time.</em></p>
<p><span id="more-59"></span></p>
<p><strong>What types of elements are there?</strong></p>
<p><img class="alignright size-full wp-image-85" title="Type" src="http://www.theintegrationengineer.com/wp-content/uploads/2009/01/typeset.jpg" alt="typeset EDI Elements" width="114" height="85" />What we are really talking about is the data type.  Each element in an EDI file has a specific data type defined.  Part Numbers are Alpha-Numeric which means that they may contain letters in the alphabet, and number in any mixture.  Where a price is not just a number, but is a currency.  Letters are not acceptable in the price field, so one can&#8217;t populate it with &#8220;N/A&#8221; in any case.</p>
<p>I won&#8217;t describe all of the data types here.  That is a discussion for some other time.  Most of the time these are fairly easy to work with, especially when you have samples to work from.  But there is another type of element.  This is the encoded value element.  This element does still contain a value, but it is in a code.</p>
<p>UOM or Unit Of Measure is the easiest to relate to, as it deals with something physical.  In the PO1 segment above, we find the UOM in the PO1_03 element.  In this case it means &#8220;each&#8221;  and by putting &#8220;EA&#8221; in this position we don&#8217;t have to type out &#8220;each&#8221; every time we just us EA as the abbreviation for this.</p>
<p>Why do we do this?  Well as I said the UOM is the easiest encoded element.  Some of the other encoded elements that are available define larger concepts.  Also, by having an encoded element, the EDI standard constrains the data to a rational type of data.</p>
<p>For instance, if you have an order response, we don&#8217;t want to have to process a free form response, we want to know if the product is accepted, back ordered or canceled.  And I want to know this in the same way for everyone.</p>
<p><strong>What is Element Notation?</strong></p>
<p><img class="alignleft size-full wp-image-86" title="actuarial_notation" src="http://www.theintegrationengineer.com/wp-content/uploads/2009/01/actuarial_notation.jpg" alt="actuarial notation EDI Elements" width="72" height="53" />Elements are contained in segments.  The segment is referred to by the characters that preceded the first delimiter.  Each element in the segment has the name of the segment followed by its position in the segment.  Sometimes these are not separated, or they are separated by a space or underscore.  The position of the element is 0 based counting.  This means that the first position, the position preceding the first delimiter where the name of the segment is found, is position 0.</p>
<p>Thus in this segment, &#8220;N1^ST^Bill&#8217;s Grill^01^123456789~&#8221;, the N1 is N1_00.  I prefer the underscore to the space or no delimiter format for clarity.  But they are all used, so this would be the same as N101 and N1 01.  We use a two digit position designator even for positions less than 10 for clarity as well.  If there are any segments that develop more than 99 positions, there won&#8217;t be many.  And even fewer will ever be used.  And we don&#8217;t reduce it to just one digit, as N11 might actually exist, and that could cause confusion.</p>
<p>Now back to our example;  N1_01 is &#8220;ST&#8221;.  N1_02 is &#8220;Bill&#8217;s Grill&#8221; as so forth.</p>
<p>An example of how this is used is first found in our mapping rules that we need to write down.  And then in our notes and documentation.  If you wanted to say, &#8220;Whenever we have a ship to address for &#8216;Bill&#8217;s Grill&#8217; we need to used the Duns number of &#8216;123456789&#8242;.&#8221;  We could say , &#8220;When N1_01 = &#8216;ST&#8217; and N1_02 = &#8216;Bill&#8217;s Grill&#8217; then N1_03 = &#8216;01&#8242; and N1_04 = &#8216;123456789&#8242;.&#8221;  This way we are not leaving anything open to interpretation and clarity is our friend when writing rules for mapping and forming data.</p>
<p>You will see this used extensively in the mapping exercises here, and once you get the hang of using Element Notation, you will never write it any other way.</p>
<p>–</p>
<p>Looking for something else relating to EDI?  Check out the <a href="../the-edi-primer/">EDI Primer</a> post</p>
<p>–</p>
]]></content:encoded>
			<wfw:commentRss>http://www.theintegrationengineer.com/edi-elements/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>EDI in Good Form</title>
		<link>http://www.theintegrationengineer.com/edi-in-good-form/</link>
		<comments>http://www.theintegrationengineer.com/edi-in-good-form/#comments</comments>
		<pubDate>Tue, 19 Aug 2008 22:02:06 +0000</pubDate>
		<dc:creator>Roy</dc:creator>
				<category><![CDATA[Delimiters]]></category>
		<category><![CDATA[EDI]]></category>
		<category><![CDATA[Segments]]></category>
		<category><![CDATA[b2b]]></category>
		<category><![CDATA[format]]></category>
		<category><![CDATA[Good Form]]></category>
		<category><![CDATA[Repetition]]></category>
		<category><![CDATA[Space]]></category>
		<category><![CDATA[trailing delimiters]]></category>
		<category><![CDATA[Unwrapped]]></category>
		<category><![CDATA[White Space]]></category>
		<category><![CDATA[Wrapped]]></category>

		<guid isPermaLink="false">http://www.theintegrationengineer.com/?p=22</guid>
		<description><![CDATA[Beyond just compliance with the EDI standards, good form is using good practices in planing the format of your EDI.  Below are a set of rules or guidlines that will help you create EDI in good form.  Good form helps others to received your EDI and process it without encountering common exceptions.]]></description>
			<content:encoded><![CDATA[<p><img class="alignleft size-medium wp-image-23" title="venusmilo" src="http://www.theintegrationengineer.com/wp-content/uploads/2008/08/venusmilo-108x300.jpg" alt="venusmilo 108x300 EDI in Good Form" width="63" height="176" />Beyond just compliance with the EDI standards, good form is using good practices in planing the format of your EDI.  Below are a set of rules or guidelines that will help you create EDI in good form.  Good form helps others to received your EDI and process it without encountering common exceptions.</p>
<p><strong>Eliminate trailing delimiters.</strong></p>
<p>When EDI was first created, modems were much slower, and high speed internet and Wi-Fi didn&#8217;t exist.  Moving large, verbose files over a network took time, and e-commerce solutions charged by the kilo-character.  This means that having unneeded characters cost money.<span id="more-22"></span></p>
<p>EDI, in good form tries to eliminate extra characters.</p>
<p><span style="text-decoration: underline;"> The rule is to keep your segments as compact as possible by eliminating optional trailing data elements.</span></p>
<p><strong>Choosing Effective Delimiters</strong></p>
<p>It is illegal to have a <a href="http://www.theintegrationengineer.com/edi-delimiters/">delimiter</a> as part of the data in any data field.  There is no escape character that will allow it.  That being said, many systems will allow EDI that breaks this rule to be formed, as it does not harm the system sending the message.</p>
<p>However, it becomes impossible for the receiver to read the message properly.  (I know that some of you have encountered and scripted solutions for this type of thing, but this is about good form, not work-a-rounds for bad form.)  If you are lucky, this violation only errors out of translation.  If you are not so lucky, the translation succeeds and you have corrupt  data in your system.</p>
<p><span style="text-decoration: underline;">The rule is to select delimiters that will never appear in your output data.</span></p>
<p><strong>Avoid Unnecessary Repetition<br />
</strong></p>
<p>Some segments can be found in multiple locations in an EDI document.  This allows for a flexible and context sensitive usage of segments and data.</p>
<p>Lets take the N1 segment and group for example.  In a shipping notice you can use the N1 in the header section before any of the line items, but you can also use it in the line level.  This gives you power to specify specific shipping locations for the line.</p>
<p>This is great if each line is going to a different locations, but if most of the time this means that the N1 group repeats the same information over and over, then we are wasting space and are not in good form.  It would be best if we place as much information where it will only be displayed once if it is the same.  And in our shipping example, we can specify that N1 only appears in the line if and when there is an overriding shipping locations.  (this is where having effective usage specs comes in handy.)</p>
<p><span style="text-decoration: underline;">The rule is to avoid repetition of any data that can be represented in a non-repeating structure.</span></p>
<p><strong>Remove Excess White Space</strong></p>
<p>Just like any other character spaces take up room in the file.  Outside of the ISA segment, no EDI fields should contain leading or trailing white space.</p>
<p><span style="text-decoration: underline;">The rule is to trim or remove any whites space in an EDI field.</span></p>
<p><strong>Send EDI in Wrapped form</strong></p>
<p>When EDI is wrapped it looks like one continuous line of text characters.  When EDI is unwrapped each line appears on its own line.  Normally people do this by inserting carriage returns and line feeds after each segment delimiter.  Humans have an easier time reading an unwrapped EDI files.  So in most of the examples of EDI that I use here are unwrapped EDI.</p>
<p>Wrapped and unwrapped EDI are both EDI and most parsers don&#8217;t have a problem with either one.  But line feeds and carriage returns are characters and take up space.  And because in good form EDI eliminates excess characters, these should be eliminated as well.</p>
<p><span style="text-decoration: underline;">The rule is, always transmit wrapped EDI.</span></p>
<p><span style="color: #808080;"><em>Some people try to have the best of both worlds and try to use a line feed as a segment delimiters.  This is a bad idea.  First, delimiters are supposed to be a single character, second, different operation systems treat these characters differently.  And some systems pre process files and remove carriage returns and line feeds.  Basically, its not a nice way to do it and will eventually cause someone trouble</em>.</span></p>
<p><strong>What all these rules have in common?</strong></p>
<p>What all of these rules have in common is saving space.  Creating EDI that uses extra or unnecessary characters is bad form.</p>
<p>&#8211;</p>
<p>Looking for something else relating to EDI?  Check out the <a href="http://www.theintegrationengineer.com/the-edi-primer/">EDI Primer</a> post</p>
<p>&#8211;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.theintegrationengineer.com/edi-in-good-form/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>EDI Segments</title>
		<link>http://www.theintegrationengineer.com/edi-segments/</link>
		<comments>http://www.theintegrationengineer.com/edi-segments/#comments</comments>
		<pubDate>Tue, 12 Aug 2008 18:07:00 +0000</pubDate>
		<dc:creator>Roy</dc:creator>
				<category><![CDATA[EDI]]></category>
		<category><![CDATA[Segments]]></category>
		<category><![CDATA[b2b]]></category>
		<category><![CDATA[format]]></category>
		<category><![CDATA[Segment]]></category>

		<guid isPermaLink="false">http://www.theintegrationengineer.com/?p=15</guid>
		<description><![CDATA[The segment is what makes an EDI file and EDI file.  they are at the very heart of EDI.  There are hundreds of different types of segments and each holds a different type of data.]]></description>
			<content:encoded><![CDATA[<p><img class="alignleft size-full wp-image-19" style="float: left;" title="Segments" src="http://www.theintegrationengineer.com/wp-content/uploads/2008/08/b-segment.gif" alt="b segment EDI Segments" width="51" height="128" /><strong>Why are segments Important?</strong></p>
<p>The segment is what makes an EDI file an EDI file.  They are at the very heart of EDI.  There are hundreds of different types of segments and each holds a different type of data.</p>
<p><strong>N1^BT^Bill Gates^01^123456789~</strong></p>
<p>For instance the &#8216;N1&#8242; segments holds some common data that is used in many EDI documents.  First, the &#8216;N1&#8242; type.  This is the name type.  The first elements following is the qualifier for the second field.  If this is were an invoice it might be the code &#8216;BT&#8217; indicating that the value in the second field is the name of the &#8220;Bill To&#8217; party, in this case &#8216;Bill Gates&#8217;.  Following the name is another qualifier that determines the type of the account number in the fourth filed.  In this case we will use the DUNS Number, and so on.  We stop now with the segment terminator to indicate to the parser that the next character will start a new segment.<span id="more-15"></span></p>
<p><strong>What are Segments?</strong></p>
<p>In EDI a segment occupies the space from the character directly following a segment delimiter, to and including the next segment delimiter.</p>
<p><strong>How are segments used?</strong></p>
<p>By using segments, EDI files are able to represent data in a compact, logical arraignment.  Parsing out the data is just a function of recognizing the pertinent segments and reading the data.  As a rule of thumb, segments should only be as long as the data they contain.  So even if there are 10 possible elements in the segment, if we only have data in 4, we terminate the segment there.  We discuss that further in the <a href="http://www.theintegrationengineer.com/edi-in-good-form/">Good Form </a>section.  This PO1 segment illustrates the salient points.</p>
<p><strong>PO1^1^100^EA^100.00^^VN^A-1234~</strong></p>
<p style="margin-bottom: 0in;">The PO1 line in the specification for 4010 can have 25 elements, but we only have the basic required elements and one set of the identifiers.  This only takes us to the 7th element.  The remaining 18 elements are not needed, and so are not included.</p>
<p style="margin-bottom: 0in;">Also of note is the PO1_5.  This element is optional, so there is no data there.  But because we are using elements after it, it must be present, even if empty, to keep the position of the elements that come after it.</p>
<p style="margin-bottom: 0in;"><strong>Summary</strong></p>
<p style="margin-bottom: 0in;">Segments in EDI don&#8217;t just occur randomly.  There are some segments, those involved in enveloping, that have a mandated location across all EDI files.  Each type of EDI document has a logical order that segments are to follow.  A shipping notice will have an defined set of segments and order of segments.  Some will be required, and some will be optional, and some will be conditional on other segments.  An invoice on the other hand will have a different defined set of segments, some will be in common, and some will be unique to those of the shipping notice.  We will see this illustrated in the mapping exercised that use EDI formats.</p>
<p style="margin-bottom: 0in;">
<p style="margin-bottom: 0in;">Looking for something else relating to EDI?  Check out the <a href="http://www.theintegrationengineer.com/the-edi-primer/">EDI Primer</a> post</p>
<p style="margin-bottom: 0in;">
<p style="margin-bottom: 0in;">
<p style="margin-bottom: 0in;">
]]></content:encoded>
			<wfw:commentRss>http://www.theintegrationengineer.com/edi-segments/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
