on 04-10-2007 2:25 PM
Hi all,
I found a little problem here. I need to map a field to another formatting it as char(10) completed with "0" at left. To do this, I wrote this simple line of java code in a user defined function (PI 7.0)
return String.format("%10s", value).replace(" ", "0");
I was surprised when I found it didn't work in Integration Repository! It works on Eclipse and others Java IDE's. The error I got in IR was this one
cannot resolve symbol symbol : method format (java.lang.String,java.lang.String)
location: class java.lang.String return String.format("%10s", value).replace(" ", "0");
Some tip about it?
Thank you!
roberti
Message was edited by:
Waldemar Roberti
Hi,
I believe "String.format" is a new functionality with Java 1.5.
The current version of XI still uses 1.4.
You will have to devise another method to do the same
Regards,
Bill
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
format method would be in java.text.Format package.you need to use import statement "java.text.*;"
and also check format method parameters.
Cheers,
Jag
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
instead of return use result.addValue();
Thanks,
Maheshwari.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi people,
thank you for your tips!
<b>Maheshwari</b>, why would I use result.addValue instead return? Both seems the same to me.
<b>Jag</b>, it really works (not so easier and faster as the String.format), thanks.
<b>Bill</b>, you are right. The problem is the java version. I couldn't imagine PI 7.0 uses java 1.4 instead 5.0! Hope SAP upgrade it soon
cheers!
roberti
User | Count |
---|---|
80 | |
9 | |
9 | |
7 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.