I've got a little situation that I need to solve.

I'm, successfully, executing a SAP function, but after executing, or exiting, the application, the SAP connection remains open in SAP. This is not a good practice. The connection need to be closed, but I can't figure out the problema.

Can anyone help me?

Print with the open SAP connections (it creates two, don't know why…)

The SAPConnection is defined as Dynamic Login

On the OnBeforeConnection I'm defining the language, SAP server and client.

In the login action I'm calling the SAP function to validate if the user and password is correct

Everything works well, but the SAP connection is not closing.

Thank you


It seems that the prints are not showing… but if I edit the post they appear to me.

Please tell me if you are not able to see the prints or understand the problem

I had a problem a few weeks ago, where several connections to SAP were opened. But is was because several calls were made. They all ended when data transfer finished.

Are you sure it is only one call? Follow in debug mode with the SAP connections window opened to see when OS creates the first and second connection.

Hi Nuno,

Thanks for the reply. 

It's only one call, to a BAPI called SUSR_Login_Check_Rfc.

This bapi is used to check if the credentials given are correct. I don't know if it's because of the dynamic login, but in SAP two new RFC connections are created.

It's not critical because SAP closes iddle RFC connections after 10 minutes. But I would prefer to know why the connections are not closed once the SAP function is called.