cancel
Showing results for 
Search instead for 
Did you mean: 

Graphical mapping issue with useOneAsMany if segment does not exist

0 Kudos

Hi all

I have an issue with graphical mapping in an IDoc to file scenario. I need to have header level fields mapped to line item fields. Whether or not and how many source header segments of the same type exist depends on a qualifier (QUALF). This is generally working if I use the following graphical mapping:

if QUALF = 001 then <source> -> removeContext -> useOneAsMany -> splitByValue -> <target>

... with setting QUALF, <source>, and the second input for the useOneAsMany to the highest possible context node.

Nevertheless, if the segment with the qualifier 001 does not exist in the source then the mapping throws the error "Too few values in first queue in fuction useOneAsMany". Whatever I've tried, the mapping wants to execute the useOneAsMany statement anyway and I haven't found a way to omit this. Whether the target would be created with an empty value or not created at all would be secondary. Would eventually somebody have a solution to this problem?

Thanks in advance,

Daniel

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Daniel,

try using mapWithDefault function before useAsmany

if QUALF = 001 then <source> -> removeContext -> <b>MapwithDefault</b>->useOneAsMany -> splitByValue -> <target>

I think it takes care even if the value occur in the contaxt or.

Babu

0 Kudos

Thanks Babu, this solves the problem.

Answers (2)

Answers (2)

Former Member
0 Kudos

you have used if-without-else,it will throw an error coz you don't have any value coming if.

you can try using if-with-else and see if you get the desired result

Thanx

Aamir

VijayKonam
Active Contributor
0 Kudos

In any case, you have to see that you re provind the required inputs to the useasmany functions all the times..

VJ

VijayKonam
Active Contributor
0 Kudos

Daniel,

Thats the way you have mapped it and how can you expect it to be bypassed? It is asking for one of the required fields..!!

VJ