REPORT ZEXAMPLE.

DATA: RFCDESTINATION LIKE RSCAT-RFCDEST,

V_MSGV1 LIKE SY-MSGV1,

V_MSGV2 LIKE SY-MSGV2,

V_SUBRC LIKE SYST-SUBRC.

CALL FUNCTION 'CAT_CHECK_RFC_DESTINATION'

EXPORTING

RFCDESTINATION = RFCDESTINATION

IMPORTING

MSGV1 = V_MSGV1

MSGV2 = V_MSGV2

RFC_SUBRC = V_SUBRC.

IF V_SUBRC NE 0.

WRITE:/ 'ERROR:', V_MSGV1, V_MSGV2.

ELSE.

SET PARAMETER ID 'RFC' FIELD RFCDESTINATION.

WRITE:/ 'CONNECTION TO', RFCDESTINATION, 'IS WORKING'.

ENDIF.