SeanHoppe.com > CLEO Tips > Cleo EDI Integrator > EDI 846 - Mapping Zero to QTY02 Element

EDI 846 - Mapping Zero to QTY02 Element

3rd July 2019

in Cleo EDI Integrator, it is almost IMPOSSIBLE to map a 0 (zero) to a numeric element, in an outbound EDI (x12 / EDIFACT) document

The outbound EDI 846 is a great example of where we need to map Zero (’0′) to QTY02 element. In the example below, we will show how

  • send a positive quantity on hand
  • a zero quantity on hand

1. QTY segment

We create duplicate QTY segments for each of the qualifiers – 29 and 33

Note: Although this is an outbound document, we still qualify the segments, to help us identify each QTY segment

2. QTY*33 Segment 1

To determine if we send the 1st QTY*33 segment is by making QTY02 element Mandatory



3. QTY*33 Segment 2

If we need to send the 2nd QTY*33 segment where the quantity is Zero,  we will make QTY02 element Mandatory and apply a formula

The BIG difference here is the quantity element;  it is alphanumic

4. Create Formula

The formula (below) will be applied to the 2nd QTY*33 to test against the Current Qty Available field. If the field is 0, then an alphanumeric ZERO (’0′) is passed back to the QTY02 element.


By: on
load('http://www.seanhoppe.com/EXTOL-Blog-Feed2/'); $feed2 = array(); foreach ($rss2->getElementsByTagName('item') as $node2) { $item2 = array ( 'title' => $node2->getElementsByTagName('title')->item(0)->nodeValue, 'desc' => $node2->getElementsByTagName('description')->item(0)->nodeValue, 'link' => $node2->getElementsByTagName('link')->item(0)->nodeValue, 'date' => $node2->getElementsByTagName('pubDate')->item(0)->nodeValue, ); array_push($feed2, $item2); } $limit2 = 5; $rss3 = new DOMDocument(); $rss3->load('http://www.ebithree.com/EBIThree-RSS/'); $feed3 = array(); foreach ($rss3->getElementsByTagName('item') as $node3) { $item3 = array ( 'title' => $node3->getElementsByTagName('title')->item(0)->nodeValue, 'link' => $node3->getElementsByTagName('link')->item(0)->nodeValue, ); array_push($feed3, $item3); } $limit3 = 5; $rss4 = new DOMDocument(); //$rss4->load('http://www.ebithree.com/EBIThree-RSS/'); $rss4->load('http://www.ebiworld.com/EBI-Feed/'); $feed4 = array(); foreach ($rss4->getElementsByTagName('item') as $node4) { $item4 = array ( 'title' => $node4->getElementsByTagName('title')->item(0)->nodeValue, 'link' => $node4->getElementsByTagName('link')->item(0)->nodeValue, ); array_push($feed4, $item4); } $limit4 = 5; echo ' '; ?>