cancel
Showing results for 
Search instead for 
Did you mean: 

Header/Line Item Mapping Problem

0 Kudos

Hi all

I am trying to achieve some kind of header to line item mapping using the graphical mapping tool. The scenario is as following:

PU1/PA1/NAME

My big problem now is with NAME in the NM1 segment, which is kind of a header to item level mapping since it should become part of PU1 in the target structure which is created by the RMR segments of the source structure. I've tried to use the built-in useOneAsMany function, which works fine if the NM1 segment is always there. Nevertheless, this does not work if the NM1 segment is missing since the function apparently checks the context all the time and has then problems if the segment does not exist. I've tried a global variable with user-defined set and get functions, too, but didn't get it to work either.

I hope that my explanations make any sense. Can maybe anybody help me to get this working? Any help would be appreciated.

Thanks,

Daniel

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Daniel,

did you try to use the "mapWithDefault" function before the useOnAsMany function?

Regards

Dominic

0 Kudos

Thanks Dominic, this solved the problem.

Regards,

Daniel

Answers (1)

Answers (1)

prabhu_s2
Active Contributor
0 Kudos

Hi Daniel

Node function <i>useoneasmany</i> will work only if the source field is available. If this source is missing then the MM will through an error. We can make use of ifexists function, using this we can map the soruce to target. the use is the value is mapped on if the source field exists. hope this helps

thkx

Prabhu