2006 Apr 07 11:30 PM
hello All,
Is there any function module available to check RFC destination is active or not?
Thanks,
Johnny
2006 Apr 07 11:36 PM
2006 Apr 08 4:46 AM
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
2006 Apr 08 4:54 PM
hi Johnny,
try this FM
RFC_SYSTEM_INFO
this will give you the desired result.
regards,
Kinshuk