Skip to Content
author's profile photo Former Member
Former Member

Need Your help in the messge UDF

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");

}

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Feb 23, 2008 at 11:19 AM

    Hi JAY,

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

    return "0";

    /wg

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Feb 23, 2008 at 11:26 AM

    Thanks,

    I have really done a simple mistake..

    Thanks Buddy 😊

    JAY

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      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

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.