LS/LE segments
-
Does anyone know why are LS and LE segments used?
Stumbled upon this example, where I believe LS and LE separate REF for different warehouses, but curious what's the more general use case for them. Thanks in advance!
-
Hi @kasia ,
LS/LE segments are used to help parsers (and humans) differentiate between segments which can appear in multiple places in a transaction set. Sometimes it is possible for the last segment of a loop to have the same segment ID as the segment after the loop ends.
For example, in the 846 in the 004010 release, https://www.stedi.com/edi/x12-004010/846, the detail area 450 sequence is an N1 segment. In the loop prior to the 450 there is an N1 segment at the 410 sequence. If you received EDI with an N1 it may not be clear whether it is the N1 at the 410 or the 450 sequence.
But, if the previous loop (380 sequence in this case) is wrapped in LS and LE segments then we can differentiate the two N1 segments, as there will always be an LE segment between the 410 and 450 N1 segments.