Application Development and Automation 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: 
Read only

RFC Function Call

Former Member
0 Likes
763

Hi Guys,

Do we need to have RFC function module existed in the system we are calling?

I have a requirement like this...

I created a RFC FM in system A and trying to get data from system B, but giving a short dump while executing.

RFC FM is exist only in system A but not in system B.

can somebody explain me on this?

thanks in advance...

Sailesh

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
738

Yes, the RFC must exist in the system where it is to be called. (B)

It doesn't have to exist in the system that calls the RFC. (A)

7 REPLIES 7
Read only

Former Member
0 Likes
739

Yes, the RFC must exist in the system where it is to be called. (B)

It doesn't have to exist in the system that calls the RFC. (A)

Read only

0 Likes
738

Hi Daniel,

Thanks for the reply.

Is there any way we can do this with out creating the FM in system B? because, i do not know at this moment, what are the systems i am going to call?

sailesh

Read only

0 Likes
738

You cannot call an RFC-Enable FM if this doesn't exist in target system.

Yu can only handle old-type exception such as SYSTEM_FAILURE and COMMUNICATION_FAILURE, assigning to them a specific return code:


CALL FUNCTION 'RFC_SYSTEM_INFO' 
    DESTINATION rfcdest
     EXCEPTIONS 
      system_failure        = 1  MESSAGE mess   "This
      communication_failure = 2  MESSAGE mess   "This
      resource_failure      = 3. 

If the FM is then not founded in the target system, sy-subrc is set accordingly to the value you inserted for SYSTEM_FAILURE and COMMUNICATION_FAILURE.

I.E.


CASE sy-subrc.
 WHEN 1 OR 2 OR 3.
  MESSAGE 'RFC Error' TYPE 'E'.
 WHEN OTHERS.
ENDCASE

Hope this helps.

Roby.

Read only

0 Likes
738

Hi Sailesh,

To call the RFC you need to pass Destination value, there is no other option.

Regards,

Satish

Read only

Former Member
0 Likes
738

Yes it needs to be the target syatem, (B). however it will be used in the source system (A). In addition you have to create a destination in the source system using Transaction SM59. IN sm59 you have to specify the details about the target system (b).

Hope this helps.

Shreekant

Read only

0 Likes
738

Thanks for the information.

Is there anyway or FM, we can find, if the given function module exist in target system or not? So that, atleast i can capture the return code and give a warning message and avoid a dump.

shylesh

Read only

Former Member
0 Likes
738

I found it myself