on 03-11-2011 8:05 AM
Hello! I need to concat occurences of one element to one element like this
<a>
<element>1</element>
<element>2</element>
<element>3</element>
<element>4</element>
</a>
to:
<b>
<elementB>1234</elementB>
</b>
How can I do this? Occurence of element is 0..4
Thanks!
Hello,
You need to use UDF for this. UDF type is of context type
argument is input
StringBuffer sb = new StringBuffer("");
for(int a=0;a<input.length;a++){
sb = sb.append(input[a]);
}
result.addValue(sb.toString());
Mapping logic is like this:
element --> removeContext --> UDF --> target
Hope this helps,
Mark
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello! I have some errors while executing this UDF:
Function Concat_city, Line 2:
cannot find symbol symbol : variable length location: class com.sap.aii.mapping.api.TransformationInput for(int a=0;a<input.length;a++){ ^
Function Concat_city, Line 3:
array required, but com.sap.aii.mapping.api.TransformationInput found sb = sb.append(input[a]);
Note: /usr/sap/SPD/DVEBMGS22/j2ee/cluster/server0/./temp/classpath_resolver/Map8aa9d039226b11e1869e00000d43ca76/source/com/sap/xi/tf/_MM_Delvry_2_OrderImport_line_old_.java uses or overrides a deprecated API. Note: Recompile with -Xlint:deprecation for details. Note: /usr/sap/SPD/DVEBMGS22/j2ee/cluster/server0/./temp/classpath_resolver/Map8aa9d039226b11e1869e00000d43ca76/source/com/sap/xi/tf/_MM_Delvry_2_OrderImport_line_old_.java uses unchecked or unsafe operations. Note: Recompile with -Xlint:unchecked for details. 2 errors
What does it means?
Edited by: Andrey Bolshakov on Dec 9, 2011 2:44 PM
Sorry, I forgot about input parameter
Edited by: Andrey Bolshakov on Dec 9, 2011 2:49 PM
User | Count |
---|---|
86 | |
10 | |
10 | |
9 | |
6 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.