on 08-20-2009 1:00 PM
Hi,gurus:
Our source data structure is like below
-
MT_SOURCE
--row <1..unbounded>
-
fileldA <1..1>
-
And the target data structure is like below
-
MT_TARGET
---record <1..unbounded>
-
item <0..unbounded>
-
fieldB <1..1>
-
fieldC <1..1>
-
If we have the following source data:
-
1001
1002
-
Then we want to have the following target data:
-
m
1001
n
1001
m
1002
n
1002
-
So,what node function should I use during graphic mapping?
Hi ,
for this You need UDF's...
Map like this....
fieldA--->removeContext--->UDF1 ---->item
fieldA---->removecontext--->UDF1-->splitByvalue(each Value)---->fieldB
fieldA------->UDF3-------->fieldc
Code for UDF1
for( int i=0;i<filedA.length;i--)
{
result.addValue("m");
result.addValue("n");
}
Code for UDF3 is
result.addValue(fieldA);
result.addContextChange();
result.addValue(fieldA);
For these 3 UDFs select Context while creating
And for UDF1 & UDF2 , there is no input...
For UDF3 fieldA is input...
I have tested this code..Working fine...
You can use this now...
Sorry for before reply...I have changed my code now...
Use this code...
Thanks.
Edited by: Jyothi Anagani on Aug 20, 2009 2:41 PM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,Jyothi ,
I have tested the UDF 3, but it throwed errors like:
-
addValue(java.lang.String) in com.sap.aii.mappingtool.tf3.rt.ResultList cannot be applied to (java.lang.String[]) result.addValue(a);
-
And could you tell me the code of UDF2?
FOR UDF1 AND UDF2 ,there are no input parameters,but in your code there are input parameters,I don't know how to deal with it.
Thanks .
Hi XinJiang,
Actually, the mapping is just one-to-one. No need to use node functions unless the actual structure you've provided is different.
For the item use this mapping:
row --> item
For field b, use this mapping:
fieldA --> fieldB
hope this helps,
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Any one can help me ?Thanks in advance.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
84 | |
10 | |
10 | |
9 | |
7 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.