cancel
Showing results for 
Search instead for 
Did you mean: 

mapping with useOneAsMany

Former Member
0 Kudos

Hello,

we have a interface IDOC to JDBC. we have a problem with the mapping

-segment1................0..unbounded -target statement..............0..unbounded

--field1......................0..1 --target field............0..1

--segment2...............0..unbounded --target field2..........0..1

-


field2...................0..1

  • the 'target statment' is mapping with the segment2, if don't exist segment2 will not be created the 'target statment'. -> ok, no problem

    • the 'target field' must be mapped with field1 -> this is the problem*

  • the 'target field2' is mapping with the field2 -> ok, no problem

example

we have two segment1, the first don't have segment2. The second segment1 have a segment2.

we want mapping the field2 of segment2 with the corresponding field1 of segment1.

If we map directly field1 with the target field the result is: the target field has the value of the first field1 instead of the corresponding field1 (second field1 of segment1)

We try to do this with useOneAsMany:

field1 (parameter1)

segment2 (parameter2)..........................useOneAsMany.........................target field

field2 (parameter3)

however the follow error occurs:

'Too many values in first queue in function useOneAsMany. It must have the same number of contexts as second queue'

how can we solve this problem?

thanks you very much

regards,

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

we had changed the data structure in R3

Former Member
0 Kudos

Hi,

Use MapWithDefault function in all source fields when you use UseOneAsMany function because if any of the source field will be missing or does not exist then you well get an error. So to maintain the queue just use MapWithDefault function.

I hope this helps..

--Regards,

Sarvesh

Former Member
0 Kudos

I hope you are generating Target node based on Segment2 which there with in Segment1.

if your source payload doesn't contian segemnt2 for some Segement1 then,

change the context of segement2 and field2 to segement.

and as Sarvesh suggested use MapwithDefault.

use UseOneAsmany when there is a chance to have mulitple segment2 with in one Segement1.