There are several ways to integrate SAP with Legacy systems all depending on the technology that you have at your disposal, the version of the SAP system, and the functionality that you want to trigger on the backend system. For instance SAP PI can be used for SAP to SAP and SAP to non-SAP integration. Within PI, the various adapters can be used to “connect” the systems and through PI mapping messages can be transformed from the legacy to SAP format and vice-versa. Other options include webservices or RFC calls to SAP.
Within SAP, BAPIs (or RFCs) can be used, depending on the desired functionality, to perform updates to the SAP system. Other options within SAP include BDC and LSMW.
I hope this helps.