cancel
Showing results for 
Search instead for 
Did you mean: 

Message Mapping Issue

Former Member
0 Kudos

Hello All,

I have a requirement where I am unable to get exact value where needed from idoc

idoc

---

--Field1

--Field2

---Field3

---Field4

</Idoc>

I need to map Field1 equals to A then I need to pass Filed3 value where Filed1 and Field 3 are multiple Occurance..

There might be possible to having only Field1 value and no Field3 value... I wrote a User DF but I am geting Outbound array error.

MappingTrace mapTrace = container.getTrace();

for(int i=0;i<a.length;i++)

{

if(a<i>.equals("A"))

{

mapTrace.addWarning(" Value for" +A<i>);

mapTrace.addWarning(" Value for" +Field2.value);

}

}

I tried with i but its throwing outbound error as there are no field2 values for some Field1 values..

Please help.

Rajeev

Accepted Solutions (1)

Accepted Solutions (1)

former_member214364
Active Contributor
0 Kudos

Hi Rajeev,

please try the mapping as shown in the following pic.

http://www.flickr.com/photos/14144840@N02/4099427554/

Context UDF fn

String str = "";

for(int k=0; k < var2.length; k++)

{

if(var1[0].equals(var2[k]))

{

str = var3[k];

break;

}

}

result.addValue(str);

Cheers,

Jag

Former Member
0 Kudos

Hi,

<IDOC>

--

--Field1<A>

--Field2<V>

--Field3<H>

-


--Field1<B >

--Field2<V>

--Field3<O>

-


--Field1<C>

--Field2<V>

--Field3<G>

-


--Field1<B >

--Field2<V>

-


If Field1=B then I need to pass Field3 value... I used Graphical mapping but I am getting some other values instead of required values... some other values H or G

I created UDF in which I am getting I am getting Outbound error.

How can I get appropriate values?

Thanks

Rajeev.

former_member200962
Active Contributor
0 Kudos

*If Field1=B then I need to pass Field3 value... I used Graphical mapping but I am getting some other values instead of required

values... some other values H or G*

Are Field1, Field2, Field3 recurring?

Field1
            ----> equalS(TextFunction) ---> if(Field3--> Then) --> target node
Constant(B)

You will not get proper values if you do not change the Contaxt of the source nodes....when the source nodes are repeating and the condition needs to scan all the occurences then you either need to raise the COntext of the source nodes or make use of node functions like RemoveContext/ CollapseContext.....in the above mapping logic raise the Context of the Field1 and Field3 to a higher node.

Regards,

Abhishek.

Answers (1)

Answers (1)

Former Member
0 Kudos

would it be possible for you to illustrate your scenario via an example( sample data) ?

Pooja Pandey.