DataXstream OMS+

How To Debug ABAP Web Service on SAP Web Application Server (WAS)

How To Debug ABAP Web Service on SAP Web Application Server (WAS)

One of the more confounding aspects of developing in the SAP space is the lack of good, low-level, helpful instructions.  While this post is merely regurgitating information that is readily available elsewhere, it will be done in a manner that (hopefully) will actually be useful to vast majority of ABAP developers out there that,  like me, find a lot of SAP’s implementation of web services on the ABAP stack confusing.

Debugging a web service on the ABAP stack of SAP Web Application Server is a very useful procedure to know.  Here’s how you do it.

Note: This example is for ECC 5.0

Locate the web service definition in the HTTP Service Hierarchy.  There are two ways to do this:

    • Option 1:

      Use transaction WSCONFIG and display the configuration for your web service.  Click on the ICF Details button
      Debug ABAP Web Service 01

    • Option 2:

      Start transaction SICF. Navigate directly to /sap/bc/srt/rfc/sap for your default host.

      Regardless of the method used to get to the service definition for your web service enabled function module, you should have it selected as in this example.

      Debug ABAP Web Service 02Next, enable the debugger by selecting the EditDebuggingActivate Debugging menu.

      Debug ABAP Web Service 03

      In the ensuing dialog box, confirm the debugging options (the defaults are usually OK).

      Debug ABAP Web Service 04To exercise the debugger, test your web service.  For this example, I will use the SAP WAS web service test tool, but the application calling the web service can be anything as long as it connects with the debugger’s user ID.

      Debug ABAP Web Service 05When the web service is executed, the debugger will start in a new SAPGUI session (make sure you are already logged in via the SAPGUI prior to executing the web service).

      Debug ABAP Web Service 06In the debugger, choose BreakpointsBreakpoint atFunction Module from the menu to create a new breakpoint.

      Debug ABAP Web Service 07Specify the function module that implements your web service.  In the debugger, press F8 to run to your newly created breakpoint.

      Debug ABAP Web Service 08
      If the debugger doesn’t get to your breakpoint, the most likely culprit is malformed input XML.  Check the payload of the message to ensure that it conforms to the specifications of the web service.

Once the debugger has started, it is just like debugging any other SAP application. If you have any specific tips or tricks regarding debugging web services, please share them in the comments section of this blog.

10 Comments

  1. Avatar for Hendro
    Hendro
    January 15, 2010 at 3:01 am · Reply

    Nice tips Craig, thanks a lot

  2. Avatar for Ganesan Rajamani
    Ganesan Rajamani
    January 18, 2010 at 3:50 pm · Reply

    Excellent Tip. Thanks Craig!

  3. Avatar for Justin Loranger
    Justin Loranger
    November 2, 2010 at 3:57 pm · Reply

    Craig,

    we are currently developing some interfaces with SAP utilizing SAP web services. We have had success with their creation and deployment to a web page.

    However, one issue I have come up against is trying to test the service, before deploying it to a web page. When I try to test the service, the browser opens to an error page. Does the J2EE server need to be enabled on the SAP system in order to use the test system? I am currently working with our system administrator to enable this functionality.

    you are correct, there seems to be scattered bits of info on SAP’s web services on the net.

    Regards,
    Justin

  4. Avatar for Peter
    Peter
    March 17, 2011 at 8:34 am · Reply

    You brush over the “same username” issue.

    How do I find the username of the web service? Without that I am stuck

    How do I make them the same. change mine or the WS or both?. I realise this might depend on the situation but you could discuss the pros and cons

    Peter

  5. Avatar for Ajay
    Ajay
    March 29, 2012 at 2:21 am · Reply

    @Peter,
    Go to SICF, search for your web service. It will normally be under sap/bc/srt/rfc/sap/ folder. Now double-click the web service. In second tab, rightfully named ” Logon Data”, maintain login information under Logon Data frame.

    @Justin,
    Without JAVA stack, SAP WAS can’t run Web services.

    thankz,
    Ajay

  6. Avatar for Shobhika
    Shobhika
    May 29, 2012 at 4:35 am · Reply

    Hi,

    how do i test my web service.I’m stuck as I cannot debug my ITS.

    please suggest

    Shobhika

  7. Avatar for AF
    AF
    November 26, 2012 at 1:04 pm · Reply

    Hi,

    I’m trying to create a WebService using just ABAP Stack and when I select “Open Web Service navigator for selected binding” on SOAMANAGER I get error: ” J2EE host or port not specified; define them under “System Settings”.

    Also, when I use an external WebService Test Tool I get error: “System.Net.WebException: The request failed with HTTP status 401: Unauthorized.”

    Any idea?
    AF

  8. Avatar for AF
    AF
    November 26, 2012 at 1:09 pm · Reply

    Ajay,

    Is this true?

    “Without JAVA stack, SAP WAS can’t run Web services.”

    AF

  9. Avatar for Rob Moss
    Rob Moss
    September 23, 2014 at 5:00 am · Reply

    “Without JAVA stack, SAP WAS can’t run Web services.”

    This actually couldn’t be any less true. The Java stack is completely irrelevant to an ABAP Web Service, whether it’s the client or the server portion – we’ve been using them for years with no Java stack involved.

  10. Avatar for Tyler Constable
    Tyler Constable
    April 13, 2021 at 5:13 pm · Reply

    You’re completely right about the lack-of good, low-level and helpful instructions readily available for developers out there, however you’ve hit the nail on the head with this article about how to debug ABAP on SAP WAS, well done!

Leave a reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.