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 Function module Error

hkmaradana
Active Participant
0 Kudos

Dear Experts,

I have written simple Remote Function module as like given below.

Before that i did all required RFC settings in SM59 and tested from there.

It is connecting from each other.

REPORT ZTEST_RFC .

data: rfc_var1 type i VALUE '10',

rfc_var2 type i VALUE '599',

rfc_result type i.

CALL FUNCTION 'Z_SUM'

DESTINATION 'dev'

EXPORTING

VAR1 = RFC_VAR1

VAR2 = RFC_VAR2

IMPORTING

RESULT = RFC_RESULT

EXCEPTIONS

COMMUNICATION_FAILURE = 1

OTHERS = 2.

I am getting sy-subrc eq 1.

Please guide what could be wrong...do we need pass any parameters in FM.

Thanks

Cris

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi Cris,

Try with

DESTINATION <b>'DEV'</b>

Regards,

Atish

6 REPLIES 6

Former Member
0 Kudos

Hi Cris,

Try with

DESTINATION <b>'DEV'</b>

Regards,

Atish

0 Kudos

Hi,

I tried that also...still same problem. Do you know how we can debug the RFC?

Thanks

Cris

0 Kudos

Also To debug a RFC:

You need to make sure that you are able to login in to the system containing the RFC using SM59 with your own login. Now place a break point just before the RFC Fm in your se38 and press F5. now it goes into the RFC .Now you need to place a break point at your RFC FM by specifying your RFC name.

and hit F8 . It goes inside the RFC Func module code.

Try it and let me know.

Sri

0 Kudos

Hi All,

Thanks for all your good replies, Problem is resolved.

Reason is that i gave host id in destination instead of RFC name.

Once again thanks for all your support and i am giving points all of you.

Cris

Former Member
0 Kudos

Hi Cris,

The error occurred is due to RFC destination "dev" does not exist.

FYI, the destination is case-sensitive. Make sure the RFC name that u maintain in

SM59 is correct.

Hope this help.

Best Regards,

Hikaruno

Former Member
0 Kudos

Hi Cris,

This is pretty basic one though...but may be u can check..

Is the FM Z_SUM "Remote Enabled" in the Attributes?

Sri