Creating a trace file with Rfc Connector


You want to create a trace file to get more detailed information about an error or problem.


When the trace.file option is set before calling session.connect(), Rfc Connector will create a detailed trace file at the specified location. Additionally, debug traces from the RFC library are created in the current working directory.

The following examples show how to create a trace file:

Example: Visual Basic ( VB.NET / VBA / VB6 )

 Dim session As New RfcSession
 ' [...]
 ' enable trace
 session.Option("trace.file") = "C:\\tracefile.txt"
 ' connect to SAP system via RFC
 ' [...]

Example: C#

 RfcSession s = new RfcSession();
 // [...]
 // enable trace
 Session.set_Option("trace.file", "C:\\tracefile.txt");
 // connect to SAP system via RFC 
 // [...]