on 02-11-2009 5:00 AM
Hi All,
In my Mapping i have a target fields which will occur mutiple times , i need to collect the value and concatenate it , when i write a UDF for it , i am getting a error , casue the value which is comming is not in a Array format but in string format , anyone please help me in this isssue
Thanking you
Sridhar
Hi Sridhar,
In your mapping, you could change the context of the source node so that all value of ED1PT1 etc occur inside the context. That is, change the context which is currently occuring at each parent node to their immediate parent node.
<root>
......<details>
............<E1DPT1/> <----- Currently context is here....shift it to its parent node, which is <details>
............<E1DPT2/>
............<E1DPT3/>
This will make sure that all your values are occuring within the same context.
Now you could write a UDF logic in context or queue output where you could use a simple for loop to parse through the individual strings and concatenate them using a simple delimiter.
Later you could split the strings based on the same delimiter and use split by value to obtain each individual string if you need it
Regards,
Kshitij
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I am getting error . all are existing in the same context only
Method testcase$ with 1 arguments not found in class com.sap.xi.tf._MM_RFQ_IDOCILE_IND_
where in my UDF i have written a coding for concae all the vallues
where my UDF is
String value = "";
if(a != null && a.length > 0){
for(int i=0; i<a.length;i++){
value = value + a<i> + "||";
}
value = value.substring(0,value.length()-2);
}
result.addValue(value);
Edited by: sridhar loganathan on Feb 11, 2009 8:04 AM
Sridhar, you need to declare the cache execution method as context or queue which takes multiple values as input.
Value is used to process individual input values (i.e. like a single variable) of a field for each function call.
Context and Queue are used to process multiple input values (i.e. like a string array) of a field for each function call.
Please change it and write the code according to your requirement.
Regards.
Hi,
Maybe you could concatenate the Strings first then use a delimiter like a pipe |, then use a string array function like .split(" I ").
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.
Thank you for you response
But i dont know how to get the value which is occuring in a fields multiple times , actually
My structure is as follows
<E1EDPT1 >
TDID
<E1EDPT2>
TDLINE
<E1EDPT2>
TDLINE
<E1EDPT2>
TDLINE
<E1EDPT2>
<E1EDPT1>
my condition is that when TDID is a06
i Must concatenate All the TDLINE
i dont know how to do it please helpo me
Thaning you
Thank you for you response
But i dont know how to get the value which is occuring in a fields multiple times , actually
My structure is as follows
<E1EDPT1 >
TDID
<E1EDPT2>
TDLINE
<E1EDPT2>
TDLINE
<E1EDPT2>
TDLINE
<E1EDPT2>
<E1EDPT1>
my condition is that when TDID is a06
i Must concatenate All the TDLINE
i dont know how to do it please helpo me
Thaning you
User | Count |
---|---|
85 | |
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.