Error Analysis Under UNIX and WindowsNT 
Purpose
CPI-C Trace
If the function SAP_CMPERR is not sufficient for error analysis, you must activate the CPI-C trace. You have several options:
These options are described below.
0 : |
No trace |
1 : |
Error trace |
2 : |
Trace flow and shortened data trace |
3 : |
Trace flow and complete data trace |
The trace will be in a trace file (CPICTRC<PID>) in the current work directory.

The trace function for the called program can only be activated via the shell variable CPIC_TRACE.
If you want to check a configuration file, you can use the CPI-C test programs cpict1 and cpict2.
Activation via Environment Variable
The environment variable has priority over an entry in the side information file.
You can use the environment variable CPIC_TRACE to activate a trace function, as in the following:
UNIX:
Activation via the Side Information File
If, for example, you want to record an error trace, make the following entry in the side information file:
CPIC_TRACE=2
Activation via the Target Program
If you want to start an R/3 or C program on a remote workstation from an R/2 host, you normally set the trace level using the environment variable CPIC_TRACE. If this is not possible, (for example, if.login or.cshrc are not processed), define the trace level in the side information file using the variable CPIC_TRACE.
The trace level set in this way can be activated via the called program using the following function:
CMSetCPICTrace()

main()
{
.
CMSetCPICTrace();
.
SAP_CMACCP();
.
CMACCP();
.
.
}