cancel
Showing results for 
Search instead for 
Did you mean: 

Handling RFC Calls

Former Member
0 Kudos

Hi,

I have a program to trigger RFC call from ABAP.

Can someone help me how to handle or show error message when RFC destination(Connection) is not ON.

Currently it is going for Short dump when Connection is not ON or Connection is not establised.

Current code:

CALL FUNCTION 'RFC_PING'

DESTINATION 'JCOSAMPLE'.

CALL FUNCTION 'ZSAMPLE_JAVA_FM'

DESTINATION 'JCOSAMPLE'

EXPORTING

hostname = sy-sysid

username = uname

password = pword.

Any help will be greatly appreciated!!

Thanks,

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Use the following function moudle if sy-subrc <> 0.

Then rise the error.

CALL FUNCTION 'BBP_REMOTE_CLNT_CHECK' DESTINATION RFC_DEST

IMPORTING

CLIENT = client

RELEASE = REL.

REgards,

Madan.

Edited by: madan mohan reddy on May 8, 2008 12:19 PM

Former Member
0 Kudos

Hi Madan,

I wrote the code to call the Fucntion module 'BBP_REMOTE_CLNT_CHECK' and check for sy-subrc.

But even this FM is going to short dump since the destination is not registered.

I need to avoid the Short dump and raise an Error in program.

Thanks,

Former Member
0 Kudos

Hi,

If the RFC is created then you can get the entry for the same in table RFCDES.

You can get the different options set for the RFC like client ETC.

Check this table before calling the RFC FM.

If sy-surc <> 0 then do not call the FM.

regards,

mahantesh

Answers (1)

Answers (1)

Former Member
0 Kudos

any inputs please