Hi
When the RFC being called is a customer development then you could retrieve system information on the calling program (SAP, Excel, ...). One can do so by calling the module RFC_SYSTEM_INFO with destination BACK. RFC destination BACK calls a RFC in the calling program. When the calling program is not a SAP system or not a specific SAP system then you could abort your RFC.
Regards Jack