on 03-16-2007 4:51 AM
if i have a JCO connection.....to process the RFC function...
when i call the function...the job leave to R3 to do the rest...
yet ..the connection broken..at this time..
the is no result return..and consequency receive the
RFC_ERROR_COMMUNICATION exception...
how do i handle this kind of situation....
what should R3 SHOULD DO..
.........................................................
let's say i have a jco connection
the connection broken during processing...how do i return the error message to the java program
the error include....RFC_SYSTEM_FAILURE ,RFC_ERROR_COMMUNICATION
Message was edited by:
yzme yzme
Hi Yzme,
try {
write code to execute ur BAPI here.
}
catch (WDDynamicRFCExecuteException e)
{
wdComponentAPI.getMessageManager().reportException(e.toString(),false);
}
Regards,
Ramganesan K.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Yzme,
You have already got answers how to catch this exception.
Next processing depends on application-specific nature of RFC: whether or not call is idempotent, in simple words -- submitting same request doesn't hurt.
This comes from the fact that network failure may occurs when transferring request (hence no background processing performed) or when returning response (hence function already executed).
For idempotent calls there is also an option for automatic re-tries finite number of times. For non-idempotent calls the only option is to display error to user in friendly format.
An idempotent call is a call that can be executed more than once on the server without undesirable side effects. Take for example Create / Read / Update / Delete operations. Obviously, read is idempotent while it doesn't alter data at all. You may treat Delete as idempotent up to certain extent -- just handle "record not exists" gracefully. Create and Update are not good candidates -- re-submitting same request typically leads to serious problems like duplicate entries or data inconsistency.
Valery Silaev
SaM Solutions
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Yzme,
You can write the following code in your Catch block of execute_RFC(Where you are executing the RFC) method.
catch (WDDynamicRFCExecuteException e){
wdComponentAPI.getMessageManager().reportException(e.getMessage(),false);
}
or
catch (WDDynamicRFCExecuteException e) {
final Writer wr = new StringWriter();
final PrintWriter pw = new PrintWriter(wr);
e.printStackTrace(pw);
wdComponentAPI.getMessageManager().reportException(wr.toString(),false);
}
Regards,
Jhansi
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.