12-10-2008 9:41 AM
Hi experts,
I called a RFC function module from a remote system. In case if RFC failed because of some communication failure or some other reason then Will the RFC return SY-SUBRC value in case of failure other than 0 (Zero)? Or How can I identify the failure?
Thanks in Advance.
12-10-2008 10:00 AM
CALL FUNCTION <fm name>
DESTINATION w_rfcdest
EXPORTING
....................
EXCEPTIONS
function_not_exist = 1
communication_failure = 2
system_failure = 3
resource_failure = 4
OTHERS = 5.
You can add these exceptions while calling the RFC( though they may not be declared in the FM)
and check the SY-SUBRC
12-10-2008 10:00 AM
CALL FUNCTION <fm name>
DESTINATION w_rfcdest
EXPORTING
....................
EXCEPTIONS
function_not_exist = 1
communication_failure = 2
system_failure = 3
resource_failure = 4
OTHERS = 5.
You can add these exceptions while calling the RFC( though they may not be declared in the FM)
and check the SY-SUBRC
12-10-2008 10:06 AM
Hi Bharati,
There are no exceptions defined in the Function Module for exception handling on remote system and I am not authorized to change the called function. And I think SY-SUBRC will not work here.
12-10-2008 10:12 AM
Thats what I have already said.
You dont have to modify the original RFC.
But while calling the RFC, you can add these Exceptions as I have mentioned.
12-10-2008 2:09 PM
12-10-2008 3:06 PM
Hi deepak, go to the ST22 t-code, there you have a error description. When you get it, let me know your feedback.
12-10-2008 3:52 PM
HI,
Here is the scneario which you might be having.
CALL FUNCTION <your remote function module>
STARTING NEW TASK <give some task name>
DESTINATION <provide destination system you are calling>
PERFORMING <yoursubourtine to get online status of your remote call> ON END OF TASK.
....
....
FORM <yoursubourtinename> USING <Task Name>.
RECEIVE RESULTS FROM FUNCTION func
IMPORTING F1 = A1
EXCEPTIONS SYSTEM_FAILURE MESSAGE SYSTEM_SMG.
SET USER-COMMAND 'OKCD'.
ENDFORM.
Above logic in <yoursubroutine> willl get back results from Remote Function Module call which provides online status of your remote call.
Let me know if you have any questions.
Best Regards,
Krishna