Tuesday, October 6, 2015

Monitoring and Debugging XML Messages in SAP SRM 7.0 System

The article describes the procedure to monitor as well as debug the failed XML messages in SAP SRM system. In this scenario, data migration is from SAP R/3 (ECC 6.0) to SAP SRM 7.0 via SAP XI.



1.    Business Requirement

i)  Monitor XML message flow between the sender and the receiver systems via SAP XI.

ii)  Track and debug failed XML messages

(Please note: In this case, SAP SRM 7.0 is the receiving system, SAP R/3 is the sending system and SAP XI is a middleware that connects both the system. Failure is at receiving end, so, we will have to monitor and debug its cause in SRM system.)

2. Definition

SAP Exchange Infrastructure

The SAP Exchange Infrastructure (SAP XI) is a middleware that enables you to connect SAP and non SAP systems with each other in a heterogeneous system landscape and transform message content between sender and receiver systems, for example between an SRM document and a Document Builder document. Both systems are connected to SAP XI by means of special classes called proxies.

Exchanging XML Messages

The core of the SAP XI infrastructure is a message-oriented communication based on Hyper Text Transfer Protocol (HTTP). Business content is transferred in the form of eXtensible Markup Language (XML) messages. The structure of a message is determined by the interface data structure that is used.

For detailed information please check the below link:


3.  Navigation


SAP NetWeaver > Process Integration > SAP Exchange Infrastructure > Runtime > Integration Engine > Monitoring > Monitor for Processed XML Messages.
4. Transactions

Monitoring XML Messages - SXMB_MONI

ABAP Proxy generation – SPROXY
5. Issue

Data migration failed at the receiving end. We will have to analyze the error and its cause by monitoring and then debugging the failed XML message at the receiving end i.e. SRM system.

6.    Step by step procedure

6.1 Monitoring XML messages

a.  Go to transaction ‘SXMB_MONI’ to monitor XML messages. Click on execute button.
It will navigate to the following screen:
b.   Red flag means there is an error in XML message.
Select the message and click on ‘Error Information’ pushbutton (as shown in the above picture) to check the error message only.


c.     Now, to display the entire message in detail, either double click on the message or click on ‘Display’ pushbutton as shown below. 
Following screen will appear:
d.    Select ‘Trace’ (Call Inbound Proxy -> SOAP Header -> Trace) to check the error description on the right-hand side.
 e.   Under Payloads àMain Document, you will get the main record detail (i.e. posted from IDOC).
f.     Get the Receiver namespace and interface details.

g.    You can reprocess the error message by clicking on ‘Restart’ button as shown in figure ‘e’.

6.2 Debugging failed XML messages

a.     Go to transaction ‘SPROXY’ to check the service details. Select the respective node and interface (from 7.1 point ‘f’) on the left-hand side. 
On the right-hand side, double click the Provider Class name. It will navigate you to the class interface screen as seen below:
b.    On double clicking the method name (under ‘Methods’ tab), you will get the executing code where you could place a breakpoint, in order to debug the message.

c.     You can debug the message from SPROXY transaction by clicking on ‘Test (F8)’ button on Application toolbar (first screen).
d.   Following dialog screen will appear:
e.         Select the respective inputs and execute. It will navigate you to the XML message screen.
f.     Click on ‘XML Editor’ from application toolbar (4th button from left). Copy the message from ‘Main Document’ (SXMB_MONI transaction code) and paste it here. Save the data and then execute the record. (By copying the failed message directly in your editor, you are ready to debug that particular record. This will save your time and efforts.)
g.    Since you have set a breakpoint in the code (step ‘b’), following debugging screen will appear. Now you can debug the code and analyze the error and its cause. Accordingly, you can take necessary actions for its resolution.












No comments:

Post a Comment