Debugging Proxy:
Proxy is like a web service call from SAP - PI - 3rd Party. It creates a webservice which can be called directly by any system which is capable of doing that.
Apart from that, we can also use proxy for interaction between SAP - SAP, mostly for synchronous calls. Instead of using RFC's SAP recommends to use proxy if they have PI as a middle ware as there are many advantages of using proxy instead of RFC's.
Steps to create a proxy are explained in a different post, this post is to explain as how to debug a proxy from sproxy transaction.
Step 1: Go to Sproxy transaction and select the appropriate proxy scenario and then click on the execute button on the top.
Execute button is the one on the top left side.
Once you click on that, you get a pop-up where you can select various options to provide the input data. We will be selecting the radio button, Generate Template data and click on execute which will generate test template as how should be the input xml be.
Next screen will the HTML format of the template as how should it look like and also on that screen, there will be button which says XML editor which will allow us to enter data in the xml directly.
Providing the test data: This can be done in many ways.
Option 1 - Manual entry :). I know no one like this option.
Option 2 - If there is already a message sent from Source to PI, then you can go to SXMB_MONI on PI and copy the XML format of the payload and then paste that on to the xml editor. One precaution is, the data on PI will be in HTML view of XML so it might have '-' at the begin of each tag which needs to be removed. Another option, click on the PRETTY PRINTER button on the XML editor which will arrange the tags and you can remove those additional '-' marks. Also, the header tag needs to be adjusted little as per the input format. Easy way to check if the input format is correct or not is, open another session of the same proxy and repeat the steps until where you can see the XML editor. You can compare the tags based on that template which is generated.Also, there is Syntax check button on the top.
Option 3: This is a similar option as 2 but the difference is, I may not have the XML data file on MONI. In that case, you can go to that interface on PI, in the TEST Scenario of mapping, give the data and generate an XML and then come here and give that XML in the data.
Once the data is provided, click on the EXECUTE button with a break-point in the proxy code.
It stops at the break-point and you can debug from there, so its all yours from here :).
No comments:
Post a Comment