Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

RFC-client with .net connector 3.0


I need help in working with the RFC.

I'm trying to write a client to connect to SAP system using an example.

using System;
using System.Collections.Generic;
using System.Text;
//using System.Linq;
using SAP.Middleware.Connector;

namespace ConsoleApplication1

     public class MyBackendConfig : IDestinationConfiguration
       public static void Main(string[] args)
           RfcDestination prd = RfcDestinationManager.

               RfcRepository repo = prd.Repository;//3                    
               IRfcFunction companyBapi =
               companyBapi.SetValue("COMPANYID", "001000"); //5
               companyBapi.Invoke(prd); //6
               IRfcStructure detail = companyBapi.GetStructure("COMPANY_DETAIL");
               String companyName = detail.GetString("NAME1");//7                
           catch { }
           // next you should handle all the relevant exceptions, but
           // we will not do this here
           // some exception handling 

       public RfcConfigParameters GetParameters(String destinationName)
            if ("PRD_000".Equals(destinationName))
                RfcConfigParameters parms = new RfcConfigParameters();
                parms.Add(RfcConfigParameters.AppServerHost, "");
                parms.Add(RfcConfigParameters.SystemNumber, "00");
                parms.Add(RfcConfigParameters.SystemID, "IDS");
                parms.Add(RfcConfigParameters.User, "USER");
                parms.Add(RfcConfigParameters.Password, "PASW");
                parms.Add(RfcConfigParameters.Client, "100");
                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 ;


Connection is not happening. Do not fill out the parameter repository.

Tell me whether you need to configure an incoming connection RFC destination in SM59? If yes, how?

Not what you were looking for? View more on this topic or Ask a question