cancel
Showing results for 
Search instead for 
Did you mean: 

User defined function in PI 7.1 compilation error "Recompile with -Xlint"

Former Member
0 Kudos

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

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

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

Answers (3)

Answers (3)

Former Member
0 Kudos

I changed the method with more number of arguments and it solved my purpose.

Thanks everyone for your inputs

stefan_grube
Active Contributor
0 Kudos

container.getParameter() returns Object, not String.

try following:

String aq = (String) container.getParameter("AdjustmentQuantity");

if(aq.trim().startsWith("-"))

Regards

Stefan

Former Member
0 Kudos

Hi,

Use "import java.lang.*;" while creating the function. It is mendatory.

Regards,

Jitender