The RFCServer class supports SAP Connection with SSO and SNC. The RFCServer class provides the property SNCSettings, similar to the R3Connection class, refer to ERPConnect with SSO with SNC. The property OwnName must be set. Additionally one of the properties SNCMechanism and LibraryPath must be set.

Click to open C# example.
RFCServer rfcServer = new RFCServer();
rfcServer.GatewayHost = "reutlingen";
rfcServer.GatewayService = "sapgw00";
rfcServer.ProgramID = "SNCTEST";
rfcServer.SNCSettings.Enabled = true;
rfcServer.SNCSettings.Mechanism = SNCMechanism.Kerberos5;
rfcServer.SNCSettings.OwnName = "p:RFCServerSNC@THEOBALD";
rfcServer.Protocol = ClientProtocol.RFC;
rfcServer.CanReceiveIdocs = true;
rfcServer.IsUnicode = true;

It’s important that the partner name in the SAP transaction SM59 (e.g. p:RFCServerSNC@THEOBALD) is the same as the RFCServer.SNCSettings.OwnName.


If SNC is used with Kerberos and Active Directory, the Active Directory account used for the RFC server must have the right Service Principal Name.