Setting Up RFC Connections
The middleware must be able to access the back-end system. For this reason, the RFC connections must be set up.
There is a network connection between the systems.
Use transaction SM59 to set up the RFC connections.
...

See also the documentation for maintaining RFC connections.
The middleware can call up the BAPI wrapper on the back end.