Mapping Trace in SAP PI 7.31 Single Stack
You have developed your Java or XSLT mapping code in SAP PI 7.3x Java only, or you have migrated your Java or XSLT mapping to one. And you are wondering where all the Trace information thrown during run-time can be viewed.
Adding traces and logs, when used correctly, is a very powerful tool that can make life a lot easier. It is a way of self-documenting your Java and XSLT mapping. After all you’d use these in complex situations, and may derive benefits from trace messages at run-time, even in the Production environment.
On older and dual stack versions, tracing was pretty easy and straightforward – Go to SXMB_ADM and set the Trace Level and trace messages appear under SOAP Header of the message through SXI_MONITOR:
In Java Only versions, the above method is obviously not possible. But is there an alternative feature? Yes, there is. There is a link provided in Message Monitor where you can navigate and filter in the traces and logs for each message. All you need to do is ‘Set the Trace Level‘ through NetWeaver Administrator (NWA) instead.
And here’s how.
1. Logon to NetWeaver Administration (NWA) and navigate to Troubleshooting -> Logs and Traces -> Log Configuration.
2. Select Tracing Locations and enter Location com.sap.aii.ibrun.sbeans.mapping, and press Go.
3. Select entry for MappingAccessBean, and change the severity to the Trace Level you require – during testing this could be set to All, for example.
4. Press Save Configuration button to save these changes.
5. Run the interface, triggering the trace messages to be written to the Trace files.
6. Go to Message Monitor and locate the message.
7. Under Message Details, go to Further Links tab. Click on the link Log Viewer.
8. Log Viewer then shows the traces and logs specific to this message. The trace elements in the example below were raised through a Java User Defined Function.
Obviously, the same rule applies to Java Mapping and XSLT Mapping as well. Following is a detailed view of traces raised through an XSLT mapping.
1. If you are unsure about the exact Trace Location for a specific situation, simply activate the trace for a top level node (See Logging and Tracing – Administering Process Integration (PI) – SAP Library) and propagate the same level completely to the sub tree. Once a message is sent through, locate the trace message that you are after through Log Viewer (as described in this blog). The Category column identifies the exact location required for the trace.
2. See Java Mapping in SAP PI / XI – Step-by-step example » Techplay for quite a good example.
This blog contains contributions from Dieter Bauer as well – thanks Dieter.