The instructions below reference the X12 856 Advanced Ship Notice transactions but can be
used for similar hierarchical structures.
Procedure
-
Make a copy of the type tree to be customized. You can also trim/prune the type tree to remove
components not used. There is a documented process for accomplishing this task.
-
Open the copy of the standard type tree to be used.
-
Navigate to ANSI transaction and expand.
-
Copy LoopHL to each HL Loop level needed in the hierarchy.
For example, copy LoopHL to LoopHLShip, then again for
LoopHLOrder, and again for LoopHLPack, and
LoopHLPackItem.
-
Open LoopHLPack and add LoopHLItem (set range to min
0, max s). Open LoopHLOrder and add LoopHLPack (set range
the same on all). Open LoopHLShip and add
LoopHLOrder.
-
Open the transaction and edit the component LoopHL as follows:
-
Modify to LoopHLShip. Or drag and drop Loop HLShip
and set range to be the same as LoopHL.
-
Remove the LoopHL component.
-
Enter the following mapping rule on LoopHLShip:
HierarchicalLevelCd Element:HL Segment:$ = "S"
& (ABSENT(HierarchicalParentIDNum Element:HL Segment:$)
| MEMBER(HierarchicalParentIDNum Element:HL Segment:$,{"0", " "}))
-
Open LoopHLShip and move to the bottom and enter the following mapping
rule on LoopHLOder:
HierarchicalLevelCd Element:HL Segment:$ = "O"
& HierarchicalParentIDNum Element:HL Segment:$ = HierarchicalIDNum Element:HL Segment
-
Open LoopHLPack and LoopHLItem and enter the
following mapping rule:
HierarchicalLevelCd Element:HL Segment:$ = "P"
& HierarchicalParentIDNum Element:HL Segment:$ = HierarchicalIDNum Element:HL Segment
HierarchicalLevelCd Element:HL Segment:$ = "I"
& HierarchicalParentIDNum Element:HL Segment:$ = HierarchicalIDNum Element:HL Segment
-
Save and analyze the type tree.
Results
The input should parse into each HL Loop depending on the HL Loop level code:
(HierarchicalLevelCd Element:HL Segment:$) and its parent id (HierarchicalParentIDNum Element:HL Segment:$ = HierarchicalIDNum Element:HL Segment)