Question

The question is basically a "am I don't something wrong?" or "It just is that way".

I am logging into my SAP system using the following code. Configuration file is configured for SNC

Backend = new BackendConfig();
RfcDestinationManager.RegisterDestinationConfiguration(Backend);
SapRfcDestination = RfcDestinationManager.GetDestination("P38");

SapRap = SapRfcDestination.Repository;

// Create the function for MD04
BapiMD04 = SapRap.CreateFunction("MD_STOCK_REQUIREMENTS_LIST_API");

To complete all the above takes around 30 seconds.

Logging into SAP the normal way using SAP and the Login Pad takes 4 seconds.

Will using the SAP connector always be that slow or am I doing something wrong?

EDIT 1: BackendConfig class

public class BackendConfig : IDestinationConfiguration
{
    public RfcConfigParameters GetParameters(String destinationName)
    {
        if ("P38".Equals(destinationName))
        {
            RfcConfigParameters parms = new RfcConfigParameters();
            parms.Add(RfcConfigParameters.AppServerHost, "SAPP38.Danfoss.net");
            parms.Add(RfcConfigParameters.SystemNumber, "86");
            parms.Add(RfcConfigParameters.SncMode, "1");
            parms.Add(RfcConfigParameters.SncPartnerName, "p:SAPServiceP38@danfoss.net");
            // parms.Add(RfcConfigParameters.User, "AUTO0101");
            // parms.Add(RfcConfigParameters.Password, "anyth1ng");
            parms.Add(RfcConfigParameters.Client, "010");
            parms.Add(RfcConfigParameters.Language, "EN");
            parms.Add(RfcConfigParameters.PoolSize, "5");
            parms.Add(RfcConfigParameters.MaxPoolSize, "10");
            parms.Add(RfcConfigParameters.IdleTimeout, "600");
            return parms;
        }

        else if ("T38".Equals(destinationName))
        {
            RfcConfigParameters parms = new RfcConfigParameters();
            parms.Add(RfcConfigParameters.AppServerHost, "blahblahblah");
            parms.Add(RfcConfigParameters.SystemNumber, "81");
            parms.Add(RfcConfigParameters.SncMode, "1");
            parms.Add(RfcConfigParameters.SncPartnerName, "blahblahblah");
            parms.Add(RfcConfigParameters.Client, "010");
            parms.Add(RfcConfigParameters.Language, "EN");
            parms.Add(RfcConfigParameters.PoolSize, "5");
            parms.Add(RfcConfigParameters.MaxPoolSize, "10");
            parms.Add(RfcConfigParameters.IdleTimeout, "600");
            return parms;
        }
        else return null;
    }
    // The following two are not used in this example:
    public bool ChangeEventsSupported()
    {
        return false;
    }

    public event RfcDestinationManager.ConfigurationChangeHandler ConfigurationChanged;
}

No correct solution

OTHER TIPS

Your code looks fine.

In my experience of the SAP Connector, the initial connection is always slow - more so than just logging in through the SAP client. Subsequent calls to the connector are much faster as the connection has been established.

30 seconds does seem a bit much though. Check:

  • There's no DNS lookup issues for the server you're specifying

  • You have the latest version of the SAP Connector from the SAP Service Marketplace

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top