cancel
Showing results for 
Search instead for 
Did you mean: 

mapping issue, maybe context is not properly set

former_member440449
Participant
0 Kudos

Hi all,

I am trying to map one data with this structures:

Source:

IDOC (1..1)
->SEG1(1..unbounded)
-->SEG2(1..unbounded)
--->FIELD1(0..1)
--->FIELD2(0..1)

Target:


Header(1..1)
->NODE1(1..1)
-->NODE2(1..1)
--->TARGETFIELD(1..1)

The logic is the next one:

If FIELD1 = "A" then map FIELD2 to TARGETFIELD

I have an example as this:

SEG2

-><FIELD1>A</FIELD1>

SEG2

-><FIELD1>A</FIELD1>

-><FIELD2>text</FIELD2>

So, in the first SEG2 there is no FIELD2, and I need the "text" string to be sent to TARGETFIELD.

I could not find the way to do this. I tried with an if without else condition, asking if FIELD1 = "A" AND FIELD2 existis, but I am getting a mapping error saying that the TARGETFIELD could not be created.

I think this should be easy but I was not able to find the solution yet.

Any genius know how to do this?

Thanks!

note: all contexts are set by default, so there is no context change

Accepted Solutions (1)

Accepted Solutions (1)

baskar_gopalakrishnan2
Active Contributor
0 Kudos

Are you doing multimapping?

I see the problems.If you have Field2 exist for few times under seg2, how do you map in the target. I see target structure node2 1..1 and targetfield 1 to 1. In your case target field value does not exist for the field2 missing so you get this error.

former_member440449
Participant
0 Kudos

This is not multimapping.

Yes, as targetfield2 does not exist because of missing value, how should I manipulate this?

Answers (1)

Answers (1)

former_member440449
Participant
0 Kudos

Finally, the issue has been solved by adding a removecontext function.

thanks!