Activating Trace in SAP Application

SAP Trace is the term used perform diagnostics activities in SAP application. Usually this is used by setting the DPTRACE environment variable. The value of this variable in denotes level of details of trace log that gets written in the *.trc file.

To illustrate SAP trace in action, I will start by setting the DPTRACE environment variable to 2, logoff / restart the computer to make the environment variable active, and activates SAP Logon screen.

After the logon screen is active, I entered random non existent SAP ID, that will cause the SAP server to return login error message.

Now, let’s see the result trace file in C:\Documents and Settings\xxx\SapWorkDir, particularly the sapni_*.trc file. Where xxx denotes the logon id or user id in Windows XP OS. The sapni_*.trc is the trace file for SAP’s Network Interface activities. At DPTRACE level 2, the size of the above activity is about 7 kb.

So, what about increase the level to 3 ? Checking again sapni_*.trc, I see a significant increase in the trace file to about 33 kb. How about 4 ? Well, at this level, particularly for sapni_*.trc is remain the same.

The conclusion is that there is particular limit for the level of detail of trace for each module in SAP application. In the above example, the detail level stops at 3.

There are many *.trc files that is generated by SAP when this trace flag is activated, and you can examine any file of particular interest for level of detail of trace file.

You can also notice that certain files is created for particular DPTRACE level and not in other level. For example, take saplogon_*.trc and saplgdll_*.trc is created only at DPTRACE level 2 and 3, but not in level 4.

There is also another option called the hex dump mode option of tracing capability in SAP. This, for example, can be set in the SAP Logon screen in the Option menu :

This will signicantly increase the sapguidll_*.trc file size, because it will include the hex dump of incoming and outgoing communication data.

Still another method, from SAP Help is to create section in the sapfront.ini file :


This has similar effect as setting the DPTRACE level to 4.

So far, I’ve found that the max level for DPTRACE is 4. But you can inform me when there is indeed higher trace detail for particular module in SAP trace file 🙂

Below is the varieties of files created in each case of SAP trace scenario :

SAP Trace Level 2 :

SAP Trace Level 3 :

SAP Trace Level 4 :


SAP Diagnostic Trace with Hex Dump :


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: