IMPORTANT:
this is not a Support Forum! Experienced users might answer from time to time questions posted here. If you need a professional and reliable answer, or if you want to report a bug, please contact Altova Support instead.

XML to EDI (856) HL Question Options · View
ellerbe
Posted: Monday, July 20, 2009 4:02:54 PM
Rank: Advanced Member

Joined: 10/17/2007
Posts: 56
Location: Seattle
This one might be difficult (or maybe not possible)

I have an XML file with this sort of format.

<ASN>
<HEADER>
<BillTo>SYSCO</BillTo>
<ShipTo>SYS RDC,VA</ShipTo>
<ShipFrom>010</ShipFrom>
<SalesOrderNumber>1136431</SalesOrderNumber>
<BOLNumber>1136431</BOLNumber>
<SCAC>BUEL</SCAC>
<CustomerPO>Z11382 02608220</CustomerPO>
<CurrentDate>
<year>2009</year>
<month>07</month>
<day>17</day>
</CurrentDate>
<NumberOfPallets>014</NumberOfPallets>
<GrossWeight>025722</GrossWeight>
<NumberOfCases>0000828</NumberOfCases>
<DETAILS>
<PALLET>
<SSCC>00100726081462665882</SSCC>
<ProductKey>74865-07842</ProductKey>
<PackFillFactor>1.0000</PackFillFactor>
<DetailQuantity>60.0000</DetailQuantity>
<OrderLine>1</OrderLine>
<UOMFrom>CS</UOMFrom>
<UOMTo>EA</UOMTo>
<LotKey>39109-9F10G1N</LotKey>
<ProductionDate>2009-06-10</ProductionDate>
<PullDate>2011-06-10</PullDate>
<Layers>6</Layers>
<Cases>10</Cases>
<TareWeight>0</TareWeight>
<ShipWeight>0</ShipWeight>
</PALLET>
<PALLET>
<SSCC>00100726081462673504</SSCC>
<ProductKey>74865-54101</ProductKey>
<PackFillFactor>1.0000</PackFillFactor>
<DetailQuantity>30.0000</DetailQuantity>
<OrderLine>6</OrderLine>
<UOMFrom>CS</UOMFrom>
<UOMTo>EA</UOMTo>
<LotKey>39134-9F12J1N</LotKey>
<ProductionDate>2009-06-12</ProductionDate>
<PullDate>2011-06-12</PullDate>
<Layers>6</Layers>
<Cases>10</Cases>
<TareWeight>0</TareWeight>
<ShipWeight>0</ShipWeight>
<ProductKey>74865-54101</ProductKey>
<PackFillFactor>1.0000</PackFillFactor>
<DetailQuantity>30.0000</DetailQuantity>
<OrderLine>6</OrderLine>
<UOMFrom>CS</UOMFrom>
<UOMTo>EA</UOMTo>
<LotKey>39475-9G07J1N</LotKey>
<ProductionDate>2009-07-07</ProductionDate>
<PullDate>2011-07-07</PullDate>
<Layers>6</Layers>
<Cases>10</Cases>
<TareWeight>0</TareWeight>
<ShipWeight>0</ShipWeight>
</PALLET>
</DETAILS>
</HEADER>
</ASN>

Which I need to convert into an 856 doc. The hard part is the hierarchical level segment. HL

For the above two pallets I would need.

HL~1~~S*
TD1~CAS~14~~~~G~25722~LB*
TD5~~~~T*
REF~2I~1136431*
DTM~011~20090717*
N1~SF~NATIONAL-CHEHALIS~ 9~010*
N3~CHEHALIS INDUSTRIAL PARK*
N4~Chehalis~WA~98532*
N1~ST~Sysco Corp : SYS RDC,VA~91~SYS RDC,VA*
N2~1000 BAUGH DRIVE*
N4~FRONT ROYAL~VA~22630~USA*
HL~2~~O*
PRF~02608220~~~20090717*
REF~CR~Z11382*
REF~YD~SYS~National Frozen Foods Corp.*
REF~VR~009262064*
REF~IL~19150639*
REF~VN~19150639*
N1~RE~~91~SYS RDC,VA*
N1~VN~National Frozen Foods~ 9~009262064*
HL~3~2~T*
TD1~CAS~60~~~~N~1800~LB*
MAN~GM~00100726081462665882*
PAL~4~6~10*
HL~4~3~I~0*
LIN~1~UK~10074865078426~VN~74865-07842~PI~1440270~~~CH~US*
SN1~~60~CA*
HL~5~4~UT*
SLN~1~~~60~CA~~~~LT~39109-9F10G1N*
DTM~094~20090610*
DTM~208~20110610*
HL~6~2~T*
TD1~CAS~60~~~~N~1800~LB*
MAN~GM~00100726081462673504*
PAL~4~6~10*
HL~7~6~I~0*
LIN~6~UK~10074865541012~VN~74865-54101~PI~8731697~~~CH~US*
SN1~~30~CA*
HL~8~7~UT*
SLN~1~~~30~CA~~~~LT~39134-9F12J1N*
DTM~094~20090612*
DTM~208~20110612*
HL~9~6~I~0*
LIN~6~UK~10074865541012~VN~74865-54101~PI~8731697~~~CH~US*
SN1~~30~CA*
HL~10~9~UT*
SLN~2~~~30~CA~~~~LT~39475-9G07J1N*
DTM~094~20090707*
DTM~208~20110707*
HL~11~2~T*
TD1~CAS~60~~~~N~1800~LB*
MAN~GM~00100726081462681035*
PAL~4~6~12*
HL~12~11~I~0*
LIN~5~UK~00074865001120~VN~74865-00112~PI~1055417~~~CH~US*
SN1~~60~CA*
HL~13~12~UT*
SLN~1~~~60~CA~~~~LT~39207-9F17B1N*
DTM~094~20090617*
DTM~208~20110617*

So the way the HL works is that HL~X (X is just a incrementing by one sequence number) thats easy enough to handle with a autonumber. But for HL~X~Y (The Y indicates what the parent node is for the element)

So the first time you use the HL, you use it like HL~1~~S* (There is no parent node , and it is at the shipment level indicated by S)

The next time you use it like HL~2~~O*

So then it gets interesting, for the next you use HL~3~2~T* (this means #2 is its parent)

Then a little data then HL~4~3~I~0* (#3 is its parent)

Then a little data, then HL~5~4~UT* (#4 is its parent)

Then we start over again with HL~6~2~T* (#2 is its parent)

Then a little data then HL~7~6~I~0* (#6 is its parent)

...data then HL~8~7~UT*

ect...

so the data format is something like

1
**2
***3,2
****4,3
*****5,4
***6,2
****7,6
*****8,7

ect...

Any thoughts on how to achive this with mapforce? It's a sticky one. Any thoughts at all welcome!

-Michael
mmachhale
Posted: Friday, January 15, 2010 2:36:50 PM
Rank: Newbie

Joined: 1/15/2010
Posts: 1
Location: USA
Did you got answer. please post the answer.
chen@segment.co.il
Posted: Monday, November 7, 2016 7:42:13 AM
Rank: Member

Joined: 10/5/2016
Posts: 16
Any solution yet?
K101
Posted: Monday, November 7, 2016 12:49:41 PM
Rank: Advanced Member

Joined: 2/27/2009
Posts: 565
chen@segment.co.il wrote:
Any solution yet?


Although this is quite an old topic, as it went unanswered (and you're now experiencing the same issue), I'll describe the solution.

The solution is to customize the particular X12 configuration file to use the newer configuration file specification Altova uses for the HIPAA X12 configuration files, as that specifies the hierarchical levels where the older X12 files do not.

The attached files demonstrate this. I've customized the default X12 856 configuration. I 1) changed the Config element's Version attribute from 3 to 4 2) changed the schema reference from EDIConfig.xsd to EDIConfig4.xsd, and 3) added the <Completion singleConditions="1" singleValues="1" HL="1"/> element as a child of the Message element as described in the HIPAA Transactions documentation.

Then, I added four copies of the LoopHL group as an hierarchy; that is, one inside of the other. This gives us the five levels of hierarchy the original poster wanted.

I also changed the F735 Hierarchical Parent ID Number element from minOccurs="0" to minOccurs="1" so the completion will affect it.

(Note: as each level can have its' own required children per the actual 856 specification, I removed all other LoopHL children other than the HL segment so we can simply demonstrate the hierarchy. You will need to consult the 856 specification for the X12 version you're targeting and add the relevant children back to each HL level.)

Move the X12.ellerbe folder to "C:\Program Files\Altova\MapForce2017\MapForceEDI\X12.ellerbe" MapForce can find it, then open the mapping "design.mfd". In the mapping, you can see how we use a string constant to supply the level codes.

The original poster described his desired output, which was one S level, one O level, then two T levels (one per PALLET), each with one I and one UT level. The example mapping demonstrates exactly this output.

One final note: The X12.Codelist file was too large to attach in this forum. Copy it from "C:\Program Files\Altova\MapForce2017\MapForceEDI\X12\X12.Codelist" to "C:\Program Files\Altova\MapForce2017\MapForceEDI\X12.ellerbe\X12.Codelist".

File Attachment(s):
2009-07-20, XML to EDI (856) HL Question - Copy.zi (64kb) downloaded 0 time(s).

K101 attached the following image(s):
configuration.png
design.png

chen@segment.co.il
Posted: Thursday, November 10, 2016 5:19:00 PM
Rank: Member

Joined: 10/5/2016
Posts: 16
THANKS!!
chen@segment.co.il
Posted: Wednesday, November 16, 2016 6:32:06 AM
Rank: Member

Joined: 10/5/2016
Posts: 16
Hi. This is working fine when i create a 856 file.
But for the opposite (parsing 856 file to an XML) - it doesn't.
The "O" HL (Order) is not parsed as a loop and therefore just the 1st order is begin read.
K101
Posted: Wednesday, November 16, 2016 3:50:17 PM
Rank: Advanced Member

Joined: 2/27/2009
Posts: 565
chen@segment.co.il wrote:
Hi. This is working fine when i create a 856 file.
But for the opposite (parsing 856 file to an XML) - it doesn't.
The "O" HL (Order) is not parsed as a loop and therefore just the 1st order is begin read.


I recommend you package your files up in a zip archive and submit it directly to Altova Support.
Jas
Posted: Thursday, December 13, 2018 8:11:10 PM
Rank: Newbie

Joined: 12/13/2018
Posts: 1
Location: Canada
Thanks for configuration option! This saved my day!
Users browsing this topic
guest

Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

Use of the Altova User Forum(s) is governed by the Altova Terms of Use.