cancel
Showing results for 
Search instead for 
Did you mean: 

How to make the SAP Connector logout

Former Member
0 Kudos

Good morning,


I'm starting to use Sap connector with Visual Studio 2010 (vb.net) , everything works fine I get my information continues from a transaction Z , except that when I get the information I can not get to my Logout SAP


  • as I make the logout of sap connector ?
  • because when I use the sap connector in the transaction SM04 me two connections appear ?

I add my code to see how do the connections



Dim ofunc As IRfcFunction = oDestination.Repository.CreateFunction("ZFN_FACTUR_CLI_FECH")

        ofunc.SetValue("variables", variables)

        ofunc.SetValue("variables", variables)

        ofunc.SetValue("variables", variables)

        RfcSessionManager.BeginContext(oDestination)

        ofunc.Invoke(oDestination)

        ofunc.GetTable("table_variable")

        RfcSessionManager.EndContext(oDestination)

Accepted Solutions (0)

Answers (1)

Answers (1)

MarkusTolksdorf
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hello Alfonso,

NCo 3.0 is pooling connections for performance reasons. Therefore, connections are kept open for a while so that they could be re-used in a request that is triggered shortly after the previous one for the same user in the same system. However, it's not pooled forever. After a idle timeout the connection will be closed by the NCo runtime. The pool size, idle timeout, and other pool related settings can be configured for each destination. Thus, you can tweak the pooling to zour needs. Please note that diabling pooling completely has a negative impact on performance.

Best regards,

Markus

P.S.: In your code sample above it doesn't make sense to begin and end a context. If you only invoke a single function module in that sequence, you will definitely not need the ABAP system state and lose some performance.