How to close RFC connection ABAP?

Sometimes there is a need to forcibly close the RFC connection after calling some RFC module. There can be many reasons, but more importantly, how to do it?
The functional module RFC_CONNECTION_CLOSE will help us with this. Below I will give an example of calling this FM for greater clarity:

We simply call this FM and the RFС closes the connection.
Where lv_rfs is the connection we previously opened, for example using destination lv_rfs.

Close RFC connection example ABAP

I will also give a more complete example with a call to FM through the RFС and the subsequent closing of this connection in SAP system in ABAP program.

Leave a Reply