Partner name in UNB

64 views
Skip to first unread message

Jakub

unread,
May 17, 2013, 5:34:37 AM5/17/13
to bots...@googlegroups.com
Hello,
I'm having a problem with changing S003.0010 field in UNB. Generally EAN code should be placed there but my partner requires a name.
I cannot change their EAN to the name, because then the NAD+SE would also use that value.

What I tried at first was to use out.ta_info['topartner'] = 'PartnerName' and I thought it worked. It did the trick for one item in Order, but when there are 2 or more the error occurs:
MessageError: [S04]: Record "[['UNH'], ['UNT']]" occurs 2 times, max is 1.

I also tried using partner dependent syntax:
syntax = {
          'UNB.S003.0007':'ZZZ',        # partner qualifier
          'UNB.S003.0010':'Name',
          }

but it only changes the 0007 field...

Do you have any suggestions?

Angelo de Laat

unread,
May 17, 2013, 5:47:59 AM5/17/13
to bots...@googlegroups.com
Maybe pre/post processing on message level could work for you.

lines=lines.replace('old value', 'new value')

henk-jan ebbers

unread,
May 17, 2013, 6:03:49 AM5/17/13
to bots...@googlegroups.com
several options, eg:
in mapping says out.ta_info['topartner'] = 'name'

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/groups/opt_out.
>
>

Jakub

unread,
May 17, 2013, 6:15:39 AM5/17/13
to bots...@googlegroups.com
I though this might help, but unfortunately I cannot figure out how to use it. I checked the preprocessing demo and still I find it tricky. Where should I place the script to use it just for one partner? usersys/routescripts with partner name?

henk-jan I already tried your solution but it produces errors. Please take a look at my first post

henk-jan ebbers

unread,
May 17, 2013, 6:21:40 AM5/17/13
to bots...@googlegroups.com

On 05/17/2013 11:34 AM, Jakub wrote:
> Hello,
> I'm having a problem with changing S003.0010 field in UNB. Generally EAN code should be placed there but my partner requires a name.
> I cannot change their EAN to the name, because then the NAD+SE would also use that value.
>
> What I tried at first was to use out.ta_info['topartner'] = 'PartnerName' and I thought it worked. It did the trick for one item in Order, but when there are 2 or more the error occurs:
> MessageError: [S04]: Record "[['UNH'], ['UNT']]" occurs 2 times, max is 1.
this looks like another issue.
you are somehow writing the UNT segemtn twice.
when I read what you say, it looks like you re writing the UNT for every item?

henk-jan

>
> I also tried using partner dependent syntax:
> syntax = {
> 'UNB.S003.0007':'ZZZ', # partner qualifier
> 'UNB.S003.0010':'Name',
> }
>
> but it only changes the 0007 field...
>
> Do you have any suggestions?

Jakub

unread,
May 17, 2013, 9:54:35 AM5/17/13
to bots...@googlegroups.com
Uffff, I found the error. Thank you for confirming that the first solution was good so I dug into the subject.

My problem was weird and I don't know how I finally found it out. The errors were totally different for what the reason was.

When I write python code I use notepad++ and tab for every new line. When I later reopened the file I also put the new line with tab, but before all the tabs were implicitly changed to spaces... The problem was with that somehow, unintended mix of spaces and tabs. Nevermind;) It's ok now

henk-jan ebbers

unread,
May 17, 2013, 10:01:22 AM5/17/13
to bots...@googlegroups.com
try to avoid tabs. This will lead to strange and unintended errors.

lot's of editors, think also notepad++ have a setting that inserts spaces when you give a tab.

if it does not: use eg http://www.editplus.com/index.html, scite, geany.


kind regards,
henk-jan
Reply all
Reply to author
Forward
0 new messages