Skip to Content
0
Former Member
Mar 05, 2010 at 12:14 PM

Calling RFC from c#

1571 Views

Dear All,

Please guide me how to call RFC from c# 2008.

I am using following code for connection with SAP.

But dont know how to call RFC.

public string gSAPConnect()

{

try

{

//Boolean BootReturn;

SAP.Connector.Destination dest = new SAP.Connector.Destination();

dest.AppServerHost = "192.168.1.8";

dest.Client = 800;

dest.SystemNumber = 00;

dest.Username = "SAPUSER";

dest.Password = "ABAP";

dest.Language="EN";

SAP.Connector.SAPConnection ConnSAP = new SAP.Connector.SAPConnection(dest);

ConnSAP.Open();

Console.WriteLine("SAP Connected");

//SAP.Connector.Rfc. oRfc = new SAP.Connector.Rfc.RFC_RC();

ConnSAP.Close();

return "";

}

catch (SAP.Connector.RfcException rfcEx)

{

//Console.WriteLine("SAP Connection was failed...");

//messagebox.show(rfcEx.Message + rfcEx.StackTrace);

return rfcEx.Message;

}

}

Waiting for reply