cancel
Showing results for 
Search instead for 
Did you mean: 

Need Your help in the messge UDF

Former Member
0 Kudos

Hi All,

There is a small problem in my message mapping. Can anyone have a look at this and let me know the exact problem in this.

I just want to execute the try block and if there is any error then i have to catch this in the catch command.

I am writing a small UDF. When i am running this it is showing me the error in the mapping editor.

ERROR:::

**********************************************************************

Source code has syntax error: /usr/sap/XD1/DVEBMGS03/j2ee/cluster/server0/./temp/classpath_resolver/Map1bcce1b0e1e311dcab730003bae4e429/source/com/sap/xi/tf/_MM_NG_SR3_01_NG_E5_01_.java:3757: missing return statement } ^ 1 error

***********************************************************************

Code Writen is :

************************************************************************

MappingTrace addTrace;

addTrace = container.getTrace();

int i;

int j;

int k;

try

{

if( (a.equals("")) || (b.equals("")) || (c.equals("")))

{

return "A";

}

i = Integer.parseInt(a);

j = Integer.parseInt(b);

k = Integer.parseInt(c);

if (( i >= k ) && (k >= j))

return "B";

else

return "A";

}

catch(Exception e)

{

addTrace.addWarning("Failed to convert Last 3 charecter of to Interger");

}

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi JAY,

There is lack of returnm statement please add in your catch:

return "0";

/wg

Answers (1)

Answers (1)

Former Member
0 Kudos

Thanks,

I have really done a simple mistake..

Thanks Buddy

JAY

Former Member
0 Kudos

Hi Jay,

You are welcome. Usually people are making small mistakes. For instance sometimes I'm making a typos and looking for it for hours. The best solution is to ask your colleague.

Best regards,

wg