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 call

Former Member
0 Kudos

Hi Gurus,

I have created an RFC FM in one of my system now i want to call it from the other system but when i check it in the pattern its not giving me the name of this RFC FM could any one tell me how to call the RFC from other system. I have activated it also.

Ravi

7 REPLIES 7

Former Member
0 Kudos

Hi ravi,

1. One option is to login to the system

(in which you created the RFC function module)

2. In that, create a temporary Z program and do the

pattern (Ctrl + F6). From that copy/paste the code

to another program in another server.

regards,

amit m.

0 Kudos

Hi Amit,

I have tried doing copy/paste the code to another program in another server by creating a temp program in the source system but its not working. Could you tell me how to debug this RFC? i have tried debugging but i am not able to see how the RFC FM works,

Regards,

Ravi

0 Kudos

Hi again,

1. When we call the RFC from our z program,

we also have to put the addition syntax for DESTINATION mydest.

2. This mydest should be maintained via SM59 tcode.

3. When we do the debugging, and when the control

comes to the statement Call Function 'ZFUNC' Destination 'MYDEST'

then the system will automatically take you to the inside code of the FM. Try putting the code BREAK-POINT inside

your Fm code.

(Just make sure you are pressing F5 and not F6 at this statement)

regards,

amit m.

Former Member
0 Kudos

Hi Ravi.

I would like to suggest a reference,

[SDN Wiki Code Gallery - Standard Reference for Creating RFC & Remote-enabled FM and call from another SAP system using ABAP Program|https://www.sdn.sap.com/irj/sdn/wiki?path=/pages/viewpage.action?pageId=39728]

Hope that's usefull.

Good Luck & Regards.

Harsh Dave

Former Member
0 Kudos

Hi Ravi,

Insted of calling the function module in the 2nd server just call the function module in 1st server then copy the whole code and paste it on the 2nd server wherre u want with a addition destination 'logical system name(logical system of 1st server)'.

This will work......

Note : Your function module on the 1st server should be RFC enabled

Regards,

Suresh S

Former Member
0 Kudos

In other sys..u cannot include ur RFC call through pattern b'cause in that sys RFC is not created. So to call ur FM u can do one thing..in the sys. where u defined ur RFC...create a temp. code through SE38 and then include ur RFC call from pattern. And Copy this RFC FM call and paste it in other sys..from where u actually want to call it.

Regards,

JOy.

Former Member
0 Kudos

Hi Ravi,

Its correct, pattern for the FM will only be available if that logon system consist the FM.

You want to call the function module from the different system which does not have that function module. Then you have to write your self to call that function module with import and export parameters with DESTINATION attached to that FM.

Syntax:

data: v_fun_name(20) type c value 'ZDEST_SYS_FM'.

CALL FUNCTION v_fun_name DESTINATION dest

Import ...

export ...

tables ...

don't use the FM name directly while calling it, use some variable.