on 04-15-2009 11:18 PM
Hi All,
I have a user defined function in PI 7.1 .,which is throwing the following error.
Do i need to add any import statements like "import java.lang.String" in the beginning.
It is unable to recognize the String methods used in the user defined function.
E:\usr\sap\PID\DVEBMGS30\j2ee\cluster\server0\.\temp\classpath_resolver\Map02580a102a0911deb2b20019990eddfd\source\com\sap\xi\tf\_MM_C_to_Goods_.java:276:
cannot find symbol
symbol : method trim()
location: class java.lang.Object
if(container.getParameter("AdjustmentQuantity").trim().startsWith("-")){ ^
Note: E:\usr\sap\PID\DVEBMGS30\j2ee\cluster\server0\.\temp\classpath_resolver\Map02580a102a0911deb2b20019990eddfd\source\com\sap\xi\tf\_MM_C_to_Goods_.java
uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: E:\usr\sap\PID\DVEBMGS30\j2ee\cluster\server0\.\temp\classpath_resolver\Map02580a102a0911deb2b20019990eddfd\source\com\sap\xi\tf\_MM_C_to_Goods_.java
uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
Any Help greatly appreciated..
Collins
Hi!
String methods normally are known in the context of UDFs (e.g. ... myString.toCharArray() works without any problems).
Did you already try to use the trim() method in a more simple statement? Just to double check that it is really the trim() method the compiler has problems with ..?
Regards,
Volker
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I changed the method with more number of arguments and it solved my purpose.
Thanks everyone for your inputs
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
container.getParameter() returns Object, not String.
try following:
String aq = (String) container.getParameter("AdjustmentQuantity");
if(aq.trim().startsWith("-"))
Regards
Stefan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Use "import java.lang.*;" while creating the function. It is mendatory.
Regards,
Jitender
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
10 | |
10 | |
10 | |
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.