on 01-27-2005 12:43 PM
Hi.
How does one get the specific message text for an exception raised by the RFC? The given code in the tutorials only show the name of the exception, ie.
catch (WDDynamicRFCExecuteException ex)
{
manager.reportException(ex.<i>getMessage()</i>, false);
}
Hi,
you can get the specific message text for any exception in Java by calling exception.getMessage() and excption.getLocalizedMessage() methods. This calling will return the exact error message as in the caught exception. After that you can process the message as you wish.
regards,
Shubhadip
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
getLocalizedMessage always retuns null and I actually don't know what to do with is but regarding the RFC error situation is following:
1. If Model represent a BAPI then you have RETURN2 structure which contains STATUS and MESSAGE0 fields. The after invalidationg the output you can simply chek the status and if status is FAIL,ERROR or WARNING print the MESSAGE0 field using manager.reportMessage
2. If RFC is not BAPI then all it's ABAP exception are maped to Java exception and ex.getMessage is best you can do.
3.There are some RFCs which has their custom mechanism to report error in all sort of the output fields then you simply should check this field and print them in case they indicates the errors.
Hope it helps.
Victor.
Hi,
there is currently no way to get the ABAP exception text / message as it is not transported into the ARFC by the underlying layers of the ARFC model. You will only be able to get the ID using the mentioned
WDDynamicRFCExecuteException.getMessage()
method. If this ID is not sufficient the recommendation is to do explicit error handling in your RFC (e.g. using the BapiRet2 structure mentioned by Victor).
Regards,
Patric.
Hi,
Did u mean to show a message given by the RFC.
If yes, u can get the return message in the catch block and show that message using message manager.
The return message can be captured in the similar way u r getting the output.
This will be helpful enough if I understand ur question correctly.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
101 | |
13 | |
13 | |
11 | |
11 | |
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.