Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

RFC calling has failed.

Former Member
0 Kudos

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.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

      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

6 REPLIES 6

Former Member
0 Kudos

      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

0 Kudos

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.

0 Kudos

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.

0 Kudos

Hi,

have a look at this thread:

and check as well fm RFC_VERIFY_DESTINATION.

Best regards.

Former Member
0 Kudos

Hi deepak, go to the ST22 t-code, there you have a error description. When you get it, let me know your feedback.

nkr1shna
Contributor
0 Kudos

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