on 12-29-2010 7:17 PM
HI,
My requirement is below: Need to concar 4 sources fields in a file and map them to a single target field (In IDoc) with each source field in new line.
Lets say if I have a source file with
f1, f2, f3, f4
I need to send to single target field as follow:
f1
f2
f3
f4
It is basically concat in newline. Can I use any delimiter string in std concat funtion or help me to provide sample code for UDF.
Regards,
N@vIn
Sample UDF for your case.
public String concatStrings(String var1, String var2, String var3, String var4, Container container) throws StreamTransformationException{
String newLine = System.getProperty("line.separator");
//String newLine="\r\n";
String concatString =var1 + newLine + var2 + newLine + var3 + newLine +var4;
return concatString;
}
Note: Use System.getProperty that would take care for all Operating systems when deploy this code.
you might not able to test in test mapping tool
If you run in eclipse or nwds you will see output as follows
var1 value
var2 value
var3 value
var3 value
Hope this helps. Let me know further.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
86 | |
10 | |
9 | |
9 | |
9 | |
6 | |
6 | |
5 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.