You can use existing function UGMD_SCDT_CHECK_RFCDEST. It worked without dialog or popup. A rfc destination with locked user in remote system returned failure.
FUNCTION ugmd_scdt_check_rfcdest.
*"----------------------------------------------------...