Folks.. do what I did...  

Create a local string variable that's 3 bites long at the beginning of the
map on the left side of the map.  Something like "IS_THERE_AN_N1_BY" and
initially set it to " NO".

Then, in the N1 looping, if you get an N1*BY (or whatever it is you're
looking for in the data), set this local variable to "YES" and do your SAP
mapping. 

After all the header data comes in, the first thing you do in the map is
check the contents of this local variable.  If it still says " NO", then
build your output that SAP needs and map it.   If it is set to "YES", then
you know you got your needed data and just move on with the rest of your
mapping.  If Gentran:Basic does not reset the variable with each new
document before it starts translation (like Gentran:Server does) then just
reset the local variable to " NO" because the mapping to SAP took place
above.  

Works for me..   

Richard
[email protected] 

________________________________________

________________________________________
From: [email protected] [mailto:[email protected]] On Behalf Of
stanley pool
Sent: Sunday, February 06, 2011 1:27 AM
To: Michael Mattias/LS; EDI-L; Richard [SLCUS]Hurd
Subject: RE: [EDI-L] Mapping output where no input segment exists

  
Rich,
 
If memory serves me correctly (at my age it sometimes fails) there is an
option, in Gentran:Basic, on the output side of the map to force a segment
even when no value is feed from the source.  Can this feature be used to
output the segment in question.
 
Cheers,
 
Stanley Pool

--- On Sat, 2/5/11, Hurd, Richard [SLCUS] <[email protected]> wrote:

From: Hurd, Richard [SLCUS] <[email protected]>
Subject: RE: [EDI-L] Mapping output where no input segment exists
To: "Michael Mattias/LS" <[email protected]>, "EDI-L"
<[email protected]>
Date: Saturday, February 5, 2011, 7:19 PM

  

The problem is that the N1 segment is the last segment in the header
section. The last one that is mapped, if it's mapped at all. And even
in the standard, there's not much going on after the address loops.

Section breaks within Gentran:Basic are sort of vital and data can't
cross section breaks. I can't put any logic in the N1 because for the
ones that AREN'T the N1, the logic will never fire because the N1 isn't
encountered. Catch 22.

Functions? It is to laugh. About the only thing I might be able to get
away with is a translation table, but again, it has to be coded at the
N1 segment and if it's not there, I'm more or less out of luck.

-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of
Michael Mattias/LS
Sent: Saturday, February 05, 2011 6:22 PM
To: EDI-L
Subject: Re: [EDI-L] Mapping output where no input segment exists

> The map already makes provision for the N1 segment in it. That's not
> the issue.
>
> Take a look at the second interchange I provide. **THE N1 IS NOT
> PRESENT**. How can I map something that's not there? That's like
> saying "Everybody who's not here, raise your hand." :)
>
> Gentran:Basic is a funny animal. I came from the Mentor product, so I
> do have experience with at least one other mapping tool; but this one
is
> pretty different.

Actually, no it isn't.

"Do <something> when <something else> is not found in the input" is
actually 
a fairly common mapping challenge (outside the classroom in The Real
World).

Most mapping tools will have a Present() or Exists() or found() or
MIssing() 
or absent() function, or allow you to do what in Sql/Server is a
"nullif"... 
provide a list of 'source' data to be mapped to the 'target' , selecting
the 
first non-null item in the list.

In your case your map logic needs to be, If Missing( N1 Segment), map 
"MISSING" else map N1Segment

I'm not familiar with your specific tool. If it does not have one of
the 
functions above, perhaps you can set a flag when you get the N1 Segment.
If 
that flag is false when you think you are done, you are not done: you
have 
to set the default values to account for the absence of that N1 segment.

Something like that, anyway.

Michael C. Mattias
Tal Systems Inc.
Racine WI
[email protected]

------------------------------------

...
Please use the following Message Identifiers as your subject prefix:
<SALES>, <JOBS>, <LIST>, <TECH>, <MISC>, <EVENT>, <OFF-TOPIC>

Job postings are welcome, but for job postings or requests for work:
<JOBS> IS REQUIRED in the subject line as a prefix.Yahoo! Groups Links

[Non-text portions of this message have been removed]




------------------------------------

...
Please use the following Message Identifiers as your subject prefix: <SALES>, 
<JOBS>, <LIST>, <TECH>, <MISC>, <EVENT>, <OFF-TOPIC>

Job postings are welcome, but for job postings or requests for work: <JOBS> IS 
REQUIRED in the subject line as a prefix.Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/EDI-L/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/EDI-L/join
    (Yahoo! ID required)

<*> To change settings via email:
    [email protected] 
    [email protected]

<*> To unsubscribe from this group, send an email to:
    [email protected]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/

Reply via email to