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: 

To check RFC destination

Former Member
0 Kudos

hello All,

Is there any function module available to check RFC destination is active or not?

Thanks,

Johnny

3 REPLIES 3

RichHeilman
Developer Advocate
Developer Advocate
0 Kudos

Try RFC_CHECK_DESTINATION

or

RFC_CHECK_DESTINATION_ID

Regards,

Rich Heilman

ferry_lianto
Active Contributor
0 Kudos

Hi Johnny,

You can use this FM <b>RFC_VERIFY_DESTINATION</b> if your release is greater than 4.6C.

Check this sample code from Craig Cmehil's weblog.


CALL FUNCTION 'RFC_VERIFY_DESTINATION'
  EXPORTING
    DESTINATION = TMP
        TIMEOUT = 10
  EXCEPTIONS
    INTERNAL_FAILURE           = 1
    TIMEOUT                    = 2
    DEST_COMMUNICATION_FAILURE = 3
    DEST_SYSTEM_FAILURE        = 4
    UPDATE_FAILURE             = 5
    NO_UPDATE_AUTHORITY        = 6
    OTHERS                     = 7.

  IF SY-SUBRC EQ '0'.
    "* Do code here
  ENDIF.

or you can also use this FM <b>RFCPING</b> and check this sample code from other thread.


DATA : IT_RFCSI LIKE RFCSI OCCURS 0 WITH HEADER LINE.
 
CALL FUNCTION 'RFC_PING'  
  DESTINATION IT_SLS-SYST
  EXCEPTIONS 
    SYSTEM_FAILURE = 1
    MESSAGE RFC_MESS1
    COMMUNICATION_FAILURE = 2
    MESSAGE RFC_MESS1.

IF NOT RFC_MESS1 IS INITIAL.
  MESSAGE I000(YHPA0K) WITH RFC_MESS1.
ELSE.
  CALL FUNCTION 'RFC_SYSTEM_INFO'
     DESTINATION IT_SLS-SYST
     IMPORTING
       RFCSI_EXPORT = IT_RFCSI
     EXCEPTIONS
       COMMUNICATION_FAILURE = 1 
       MESSAGE MSG_TEXT
       SYSTEM_FAILURE        = 2 
       MESSAGE MSG_TEXT.
       
  MESSAGE I001 WITH 'Connection to '(029)
                    IT_SLS-SYST
                    'Succeeded'(030).
  ENDIF.
ENDIF.

Hope this will help.

Regards,

Ferry Lianto

Former Member
0 Kudos

hi Johnny,

try this FM

RFC_SYSTEM_INFO

this will give you the desired result.

regards,

Kinshuk