When i try to connect to SAP server dynamically I am getting error like
Hard-coded logon parameters not allowed when using a Destination Configuration
any one plz help me
I need to send all parameters from codebehind Dynamically not from Web.config
from web.config its working fine .. but not here
My code is like this
SAPSystemConnect objSapConfig = new SAPSystemConnect();
RfcDestination objSapdestination = null;
RfcDestinationManager.RegisterDestinationConfiguration(objSapConfig);
RfcConfigParameters objParameter = new RfcConfigParameters();
objParameter.Add(RfcConfigParameters.AppServerHost, Convert.ToString("XXX"));
objParameter.Add(RfcConfigParameters.Client, Convert.ToString("XXX"));
objParameter.Add(RfcConfigParameters.Password, Convert.ToString("XXX"));
objParameter.Add(RfcConfigParameters.SystemNumber, Convert.ToString("XXX"));
objParameter.Add(RfcConfigParameters.User, Convert.ToString("XXX"));
objParameter.Add(RfcConfigParameters.Language, Convert.ToString("XXX"));
objParameter.Add(RfcConfigParameters.LogonGroup, Convert.ToString("XXX"));
objParameter.Add(RfcConfigParameters.PoolSize, Convert.ToString("XXX"));
objParameter.Add(RfcConfigParameters.PeakConnectionsLimit, Convert.ToString("5"));
objParameter.Add(RfcConfigParameters.IdleTimeout, Convert.ToString("XXX"));
//objParameter.Add(RfcConfigParameters.Name, Convert.ToString("XXX"));
objSapdestination = RfcDestinationManager.GetDestination(objParameter);
RfcCustomDestination customDest = objSapdestination.CreateCustomDestination();
IRfcFunction func = customDest.Repository.CreateFunction("XXX");
RfcRepository objSapRepository = objSapdestination.Repository;
// Calling Sap Function
IRfcFunction objSapDataFunction = objSapRepository.CreateFunction(Convert.ToString("XXX"));
objSapDataFunction.SetValue("XXX", "XXX");
objSapDataFunction.Invoke(objSapdestination);
// Filling SapData into Table
IRfcTable objSapTable = objSapDataFunction.GetTable(Convert.ToString("GIT_DATA"));