on 10-28-2011 9:59 AM
Hi All,
I am trying to use UDF in my scenario.
Can anyone please say how to add return statement in UDF as bcuz default return type is void.
I am not able to change it .
Also I tried to add exception in my function but again I failed .
Can anyone help me to solve both of these problem please?
I am using PI 7.0
Thanks
Rabi
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
To return an exception, you can declare a variable type Exception in Return Definition of UDF.
Then use the TRY-CATCH statement in the UDF to get the exception.
try {
//Code
} catch (Exception e) {
// Exception
String lv_exception_text = e.getMessage().toString();
return lv_exception_text.
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
if you are using a simple UDF, you can write the return statement to pass the output value
else in case of advanced UDF, you will use the resultlist
ex. http://wiki.sdn.sap.com/wiki/display/Snippets/UDFforZeroPaddingon+Left
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello,
Can anyone please say how to add return statement in UDF as bcuz default return type is void.
I am not able to change it .
Return type is not possible for context and queue type UDF. Use result.addValue(String); instead.
Hope this helps,
Mark
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
86 | |
10 | |
10 | |
9 | |
7 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.