on 04-17-2008 10:21 AM
Dear SDN,
I wrote a very simple UDF which just return the value null during mapping.
public String test(String value,Container container){
return null;
}
but i don' know, why i get the follwing errors:
/usr/sap/PID/DVEBMGS20/j2ee/cluster/server0/./temp/classpath_resolver/Map90523a300c5e11dd8d06001a64a7b546/source/com/sap/xi/tf/_MM_WTADDI01_EtikettenAenderungsInfo_.java:130: illegal start of expression public String test$(String value,Container container){ ^ /usr/sap/PID/DVEBMGS20/j2ee/cluster/server0/./temp/classpath_resolver/Map90523a300c5e11dd8d06001a64a7b546/source/com/sap/xi/tf/_MM_WTADDI01_EtikettenAenderungsInfo_.java:139: ';' expected } ^ /usr/sap/PID/DVEBMGS20/j2ee/cluster/server0/./temp/classpath_resolver/Map90523a300c5e11dd8d06001a64a7b546/source/com/sap/xi/tf/_MM_WTADDI01_EtikettenAenderungsInfo_.java:140: '}' expected ^ 3 errors
Could u help me plz? Maye im blind and don't see a very Simple problem.
Thanks in advance.
I think also that there is a problem with java. But i don't know, what. If I try it with another UDF I get similar errors.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi
I put your code in a same UDF and it works. I think it is not the UDF wrong. It seems to be a general problem with java ,
test an other piece of code in a new UDF if it works...
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
try
public String test(String value,Container container){
return new String("");
}
nikhiL
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@ shibani:
I tried it already with blanc. the same problem.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@ Parveen:
that was a good try. But unfortunately the problem is still there.
We have got XI installed a couple of days ago. Could it be a problem from the installation and configuration activities?
Thanks
Ehsan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Eshan,
May be you are facing this problem because in ur code the return type is 'String'.
Where as your code returns a "null" which is considered as a literal in Java.
Refer this : "In Java(tm), "null" is not a keyword, but a special literal of the null type. It can be cast to any reference type, but not to any primitive type such as int or boolean. The null literal doesn't necessarily have value zero. And it is impossible to cast to the null type or declare a variable of this type."
So, you can jst replace null with a blank space (as " " )which will be considered as a string or you may adjust the return type accordingly.
Hope this helps you.
Regards,
Shibani
Reward with points if helpful**
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@ Parveen: I did it more than 10 times. But still the same problem. Very Strange.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I Know, that i don't have to write the Head of the method twice. I just wrote return null in the body and nothing else, but i get the decribed errors.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
but just write return null in my body. just RETURN NULL
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
yes. exactly.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Ehsan
I found u problem
U r getting this error because u r aagin wriiitng you method again
-
public String test(String a,Container container){
-
public String test(String a,Container container){
return null;
}
-
}
See when I write this I am also getting this error/also check ur barackets.
Source code has syntax error: /usr/sap/XS1/DVEBMGS00/j2ee/cluster/server0/./temp/classpath_resolver/Mapb75c82f00c6011dd9b0c00145ec5a6a0/source/com/sap/xi/tf/_MM_Orders05_To_File_.java:2283: illegal start of expression public String test(String a,Container container){ ^ /usr/sap/XS1/DVEBMGS00/j2ee/cluster/server0/./temp/classpath_resolver/Mapb75c82f00c6011dd9b0c00145ec5a6a0/source/com/sap/xi/tf/_MM_Orders05_To_File_.java:2286: ';' expected } ^ 2 errors
In case u write----
public String test(String a,Container container){
-
return null;
-
}
It will not prompt u any error.
Thanks
Abhishek
********please reward points if helpful*****
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
But the braces are created by PI. I can just modify the body of the Method and not the the Head,
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Yes I did. but i get the same errors.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi
Remove braces as those are implicit.
Also this one public String test(String value,Container container)
only there should be return null;
thanks,
Gujjeti
Edited by: Praveen Gujjeti on Apr 17, 2008 11:34 AM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Well there is nothing seems to be wrong in your code...
Instead of Null have you tried with "", or anyother values...is it your code working fine...
Thanks
Swarup
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
It is a bracket { } too much or too less.
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.