cancel
Showing results for 
Search instead for 
Did you mean: 

formatByExample loophole

Former Member
0 Kudos

Hi guys

I am facing a mapping issue. I am using formatByExample to put the values of a field NAMEV occuring under NODE E1KNVKM into a parent node context - E1KNA1M.

Structure is as follows:

IDOC

E1KNA1M (Node 1-1)

E1KNVKM (Node 0-9999)

NAMEV (field 0-1)

I am mapping like so:

NAMEV ---> mapWithDefault -->

formatByExample --->

E1KNVKM -


>

The reason i am not directly putting the NAMEV into E1KNA1M context by right clicking and changing the context to E1KNA1M, is because, if the E1KNVKM is occuring twice, and NAMEV is missing in only one of the E1KNVKM nodes, that SUPPRESS value for NAMEV is not visible in the queue. A single SUPPRESS will be visible only if both NAMEV's are missing in E1KNVKM . The above output will not be correct as we need to have the suppressed values as blank in the output.

For the above reason i used formatByExample.

This is working fine for most cases except for when the input is a single idoc, single E1KNA1M, E1KNVKM absent.

In this case formatByExample fails because, the NAMEV which is suppressed will have blank value cos of the mapwithDefault, while E1KNVKM will be a single suppressed value since it is missing. The no. values in 2 queues will not be similar hence formatByExample fails.

I can take care of this test case separately by using if then else statement, but the issue is that i need to take care of this in a number of fields, which will make the mappings huge and hence performance issues.

Is there a simpler way to handle this? Im guessing this must be a problem someone may have faced.

Thanks

Pratichi

Accepted Solutions (1)

Accepted Solutions (1)

abhijitbolakhe
Advisor
Advisor
0 Kudos

Hi

useoneAsMany node function can also be used to replicate the field E1KNVKM-NAMEV in parent node E1KNA1M.

Regards

Abhijit

Answers (0)