Closed GoogleCodeExporter closed 9 years ago
Hi Henk-jan,
I think this has introduced a new bug. For idoc grammars (fixed column
positions), if a field is not mandatory and has no value, it's space is omitted
from the output and all remaining fields are then shifted left out of their
correct position. Have not fully analysed this, but seems to be in
_canonicalfields (message.py). There are no minimum lengths in any of my
grammars.
Kind Regards,
Mike
Original comment by mjg1964
on 3 Nov 2011 at 6:45
Well, maybe not quite a bug!
It was specifically related to the DOCNUM field in idocs. The default syntax
initializes it to '0'.
In my mapping I had out.ta_info['DOCNUM'] = '' # empty string
This caused it to be completely omitted from the output with new message.py
installed.
I changed my mapping to to out.ta_info['DOCNUM'] = ' ' # one space
and now it works ok.
Kind Regards,
Mike
Original comment by mjg1964
on 3 Nov 2011 at 7:42
hi Mike,
how is the DOCNUM defintion? numeric?
I will test this.
Original comment by hjebb...@gmail.com
on 3 Nov 2011 at 10:36
['DOCNUM','C',16,'AN']
grammar is attached
Original comment by mjg1964
on 3 Nov 2011 at 10:50
Attachments:
yes, I see the problem.
thanks!
Original comment by hjebb...@gmail.com
on 3 Nov 2011 at 11:08
hi Mike,
reading this again I am not sure I understand.
in your mapping:
out.ta_info['DOCNUM'] = ''
but the changes I made are in message/outmessage, about how a message gets
written.
is there something else you do with out.ta_info['DOCNUM'] ??
Original comment by hjebb...@gmail.com
on 3 Nov 2011 at 1:07
Hi henk-jan,
In my output I want DOCNUM to be blank (16 spaces). IDoc is a fixed
positional format. In the mapping, if I make DOCNUM='' then each record
in the written IDoc is 16 characters shorter and all following fields
are in the wrong positions, I assume because DOCNUM is not written at
all. If I make DOCNUM=' ' it works ok.
Original comment by mjg1964
on 3 Nov 2011 at 9:08
hi Mike,
I think I solved this issue; DOCNUM='' should work also.
Original comment by hjebb...@gmail.com
on 4 Nov 2011 at 11:45
Yes that has fixed it.
Original comment by mjg1964
on 4 Nov 2011 at 12:22
File "D:\python27\lib\site-packages\bots\outmessage.py", line 176, in
_tree2recordfields if grammarsubfield[ID] in noderecord and
noderecord[grammarfield[ID]]: #field exists in outgoing message and has data
KeyError: 'S009'
I think line 176 should be
if grammarsubfield[ID] in noderecord and noderecord[grammarsubfield[ID]]:
Original comment by mjg1964
on 4 Nov 2011 at 11:47
yes, you are right!
thanks, henk-jan
Original comment by hjebb...@gmail.com
on 5 Nov 2011 at 1:25
Original comment by hjebb...@gmail.com
on 10 Sep 2013 at 12:44
Original issue reported on code.google.com by
hjebb...@gmail.com
on 1 Nov 2011 at 12:43