on 07-05-2007 12:26 PM
Hi Experts,
Simple userdefined function:
public String ro(String a, Container container) {
if (a.length() == 0)
return "No Value";
}
When I tried to test message mapping with & without the input <b>a</b> value, I am getting the below error. Could you please tell me, what mistake I am doing here.
Source code has syntax error: C:/usr/sap/PI7/DVEBMGS01/j2ee/cluster/server0/./temp/classpath_resolver/Mapf41537902ae911dcb8f1000c29643148/source/com/sap/xi/tf/_MM_RESPONSE_.java:78: missing return statement } ^ 1 error
Regards
Sara
Please give the return statement outside the if segment. Use a String object to store the output you desire like
public String ro(String a, Container container) {
String output = "";
if (a.length() == 0)
output = "No Value";
}
else
{
output = a;
}
return a;
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
public String ro(String a, Container container) {
String res;
if (a.length() == 0)
res="yes";
else
res="no";
return""res"";
Please try the above, if it works I'll tell u the problem why it doesn't works for u.
Best regards ,
raj.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
no need to use UDF here:
just use those sntadard functions:
<b>length</b> - and <b>if</b>
http://help.sap.com/saphelp_nw04/helpdata/en/43/c4cdfc334824478090739c04c4a249/content.htm
lenght to check the lenght and if to return your value
in case it's length = 0
Regards,
michal
-
<a href="/people/michal.krawczyk2/blog/2005/06/28/xipi-faq-frequently-asked-questions"><b>XI / PI FAQ - Frequently Asked Questions</b></a>
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Try making the function as context
and change the UDF to
if(a.length>0)
{
for(int i=0;i<a.length;i++)
{
if(a<i>.length()==0)
{
result.addValue("NoValue");
}
}
Mudit
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
90 | |
10 | |
10 | |
10 | |
7 | |
7 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.