Skip to Content

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:  

Trace_001.png

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.

Trace_002.png

2. Select Tracing Locations and enter Location com.sap.aii.ibrun.sbeans.mapping, and press Go.

Trace_003.png

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.

Trace_004.png

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.

Trace_005.png

7. Under Message Details, go to Further Links tab. Click on the link Log Viewer.

Trace_006.png

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.

Trace_007.png

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.

Trace_008.png

Some Tips:

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.

3. Know the AbstractTrace Object – Managing Services in the Enterprise Services Repository – SAP Library.

4. Learn about Error Handling in XSLT – Managing Services in the Enterprise Services Repository – SAP Library.

This blog contains contributions from Dieter Bauer as well – thanks Dieter.

To report this post you need to login first.

7 Comments

You must be Logged on to comment or reply to a post.

  1. Sascha Wenninger

    Great work finding out about this option and then blogging about it. I like putting xsl:message elements into my XSLTs and was really disappointed they were no longer showing up in the message monitor of our 7.31 system. This is very useful indeed! 🙂

    (0) 
  2. William Li

    Hi,

    In the “Trace Locations”, I am unable to find the path “com.sap.aii.ibrun.sbeans.mapping“, under “com.sap.aii.ibrun”, I only see: itsam, server, servlet and web.

     

    I also used the filter to try to locate “MappingAccessBean“, but none came up.

     

    I have looked in AEX 7.31 SP6 and SP8.

     

    Regards,

    William Li

    (0) 
    1. Sascha Wenninger

      Very strange. I’ve set this up in a 7.31 SP06 AEX system without any issues. It seems like this is part of the SAP_XIAF software component, so surely it can’t be optionally installed?

      (0) 
  3. stephen xue

    haha, good to see so many friends making comments on one blog.

    Well, Kapila, one question here. by using <xsl:message>, how can message types, like info, warning, error, be passed to the runtime workbench?

    (0) 
    1. Kapila Epasinghe Post author

      Hi Stephen,

       

      Thank you for your comments. This blog is on adding trace messages from XSLT and Java mapping, using <xsl:message> and AbstractTrace respectively.

       

      If I understand your comment, what you’re after is to add messages and content to the Message Log in RWB? Then there is the AuditAccess Interface which you can access via com.sap.engine.interfaces.messaging.api.PublicAPIAccessFactory.

       

      In fact there is great blog written by a friend of mine :

      write mapping message to RWB audit log when ICO is used in PI 730 .

       

      Kind regards,

      Kapila

      (0) 

Leave a Reply