Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

SAP Connect .NET / Trace cannot be deactivated

Former Member

Dear all,

I'm using the SAP .NET Connector (3.0.6.0) to make a RFC Call. The call can be executed correctly without any problems. If I change an input parameter the RFC Call creates an exception (Material not found -> NOT_FOUND) - this exception is ok and like the specification of the customer SAP developer.

The only problem is that this exception creates a trace/log file "dev_nco_rfc.log". I don't need this and I will deactivate the log file creation but I don't now how.

Therefore I added in the destination configuration the trace flag and set it to 0.

---------------

objParameters.Add(RfcConfigParameters.Trace, "0")

---------------


This doesn't work. In case of an exception this file will be created. I changed the directory via "RfcTrace.TraceDirectory = System.IO.Path.GetTempPath" to the temp folder (this works).

Therefore my question: How to deactivate the trace function?

Thank you all!

Best regards


Rainer

3 REPLIES 3

0 Kudos

We are having the same problem but cannot find much useful info from the doc.

As a workaround you can set the directory to “NUL” (on Windows). This should work like /dev/null on linux. The generated log files are deleted directly. The tests on my development systems seems to work but I am not sure if this works on all systems. So this is only an experimental solution for the problem.

C# Example:

if (RfcTrace.DefaultTraceLevel.Equals((uint)RfcTracing.None)) {
  RfcTrace.TraceDirectory = "NUL"; // => /dev/null
} else {
  RfcTrace.TraceDirectory = Path.Combine(RfcTrace.TraceDirectory, "log");
}

Andre_Fischer
Product and Topic Expert
Product and Topic Expert

Changed the tag to "ABAP Connectivity" since the tag "SAP Gateway" is related to the product SAP Gateway, not to the SAP Gateway service that is part of the ABAP application service and used for RFC based communication.

ceterum censeo RAP esse utendam