INVRPT D96A grammer error.

105 views
Skip to first unread message

Abhishek Ram

unread,
Mar 20, 2014, 3:28:39 AM3/20/14
to bots...@googlegroups.com
I was implementing the INVRPT message and got back a strange error

GrammarError: nesting collision detected at record "['UNH', 'LIN', 'QTY', 'CPS', 'PAC', 'QTY']".

I checked the structure and it is as per the standards, I even removed the QTY mapping  but I am still getting this error. The part of the structure causing this issue is below, is there any issue with this?

       {ID: 'QTY', MIN: 0, MAX: 9999, LEVEL: [
           
{ID: 'INV', MIN: 0, MAX: 1},
           
{ID: 'GIN', MIN: 0, MAX: 9999},
           
{ID: 'LOC', MIN: 0, MAX: 5},
           
{ID: 'DTM', MIN: 0, MAX: 5},
           
{ID: 'STS', MIN: 0, MAX: 9},
           
{ID: 'NAD', MIN: 0, MAX: 5, LEVEL: [
               
{ID: 'LOC', MIN: 0, MAX: 1},
           
]},
           
{ID: 'PRI', MIN: 0, MAX: 5, LEVEL: [
               
{ID: 'CUX', MIN: 0, MAX: 1},
               
{ID: 'DTM', MIN: 0, MAX: 1},
           
]},
           
{ID: 'RFF', MIN: 0, MAX: 10, LEVEL: [
               
{ID: 'DTM', MIN: 0, MAX: 1},
           
]},
           
{ID: 'CPS', MIN: 0, MAX: 9999, LEVEL: [
               
{ID: 'PAC', MIN: 0, MAX: 9999, LEVEL: [
                   
{ID: 'MEA', MIN: 0, MAX: 10},
                   
{ID: 'QTY', MIN: 0, MAX: 10},
                   
{ID: 'PCI', MIN: 0, MAX: 9999, LEVEL: [
                       
{ID: 'RFF', MIN: 0, MAX: 1},
                       
{ID: 'DTM', MIN: 0, MAX: 5},
                       
{ID: 'GIN', MIN: 0, MAX: 9999},
                   
]},
               
]},
           
]},
       
]},

henk-jan ebbers

unread,
Mar 20, 2014, 6:44:06 AM3/20/14
to bots...@googlegroups.com
hi Abhishek


the error you get is because the grammar is not correct.
see http://code.google.com/p/bots/wiki/GrammarsIntroduction about this (end of the page.

(so the error in the structure is 'by design'. ;-))
the grammars in bots are straight for UN-documentation.

(I hope this answers your question)

kind regards,
henk-jan
--
You received this message because you are subscribed to the Google Groups "Bots Open Source EDI Translator" group.
To unsubscribe from this group and stop receiving emails from it, send an email to botsmail+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Abhishek Ram

unread,
Mar 20, 2014, 7:12:19 AM3/20/14
to bots...@googlegroups.com
Thanks hank-jan, 

I got it working by deleting the QTY in the CPS loop.
I am not sure what you mean by this error being by design, what exactly is the issue with having another QTY segment?


You received this message because you are subscribed to a topic in the Google Groups "Bots Open Source EDI Translator" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/botsmail/wBy2D9U7q4Q/unsubscribe.
To unsubscribe from this group and all its topics, send an email to botsmail+u...@googlegroups.com.

henk-jan ebbers

unread,
Mar 20, 2014, 7:35:32 AM3/20/14
to bots...@googlegroups.com
from UN docs, note at the (deeper nested) QTY segment:
0610               QTY, Quantity
                   A segment to specify the quantity per package
                   described in the PAC segment.
                   
                   If the QTY segment of Segment Group 16 is used, and
                   if and only if, the next segment to be used is the
                   QTY tigger of Segment Group 11 (i.e. with no
                   intervening segments being used), then Segment
                   Group 17 must be used before returning to Segment
                   Group 11, in order to prevent segment collision.

the technical details:
imagine bots would use this structure.
bots would use this to understand invrpt-message below:
UNH...
BGM...
DTM...
LIN....
QTY....
CPS.....
PAC....
QTY...

The first QTY would be OK, (directly under LIN)
but when bots encounters the 2nd QTY a problem arises:
- is this the QTY nested under the PAC
- or is the the QTY nested under the LIN

So UN specs say:
 either remove the deeply nested QTY or make the PAC-group mandatory (directly after the deep nested QTY)


hope this helps,
henk-jan

Abhishek Ram

unread,
Mar 20, 2014, 7:45:51 AM3/20/14
to bots...@googlegroups.com
Cool, thanks for the detailed information.
Reply all
Reply to author
Forward
0 new messages