by Steve Park PI/ABAP consultant
Have you ever called a Web Service which is hosted by SAP just to get a generic return code that could mean anything? Do you wonder what was the exact data that was being passed in the parameter as it was executing the SAP web service? For example, when passing ‘00001’ is it really passing ‘00001’ or is it just passing ‘1’. This could be a difference between a successfully called web service or a web service call that brings back an exception.
I found an issue when testing an SAP web service when making a call from an external client. The SAP Web Service was sending back an exception to the external client that did not tell us much of anything.
This SAP web service was created from a function module so my first step was to go to the function module and input exactly what the external client tried to send and hoping to get the same exception. Surprisingly the function module came back successfully.
Since I could not figure out what was wrong when testing in SAP, my next step is to see what the external client is really passing real-time into the SAP Web Service by using the ABAP debugger. You are probably asking yourself, how in the world will SAP know when to initiate the ABAP debugger since SAP is being called from an external client?
The answer: You have to tell SAP that you are expecting a call
Here are the steps to activating the ABAP debugger for external calls.
1) In transaction SICF, find the service that you are having issues with and highlight your service then go to: Edit -> Debugging->Activate Debugging
2) Here you need to enter the user id that the external client is using when making the call. It is vitally important that it is the same user that you will be logged in SAP.
3) Make sure that you are currently logged into SAP with the same user. Now initiate the call from the external client and this time you will notice an ABAP debugger will be initiated as well. Now you can step through the code and see exactly where the problem is occurring.
4) Once you have found the problem, don’t forget to deactivate the debugger. If you forget, SAP will deactivate it automatically after a period of 2 hours.