Netweaver Gateway Development

Debugging SAP Gateway Service

          We have created OData service in SAP Gateway.Debugging skills are necessary for a developer to resolve issues in his journey.In this tutorial we will be discussing troubleshooting SAP Netweaver Gateway service.We will be using our flight service created in previous tutorial.
          We will analyse Gateway error log and SAP backend error log.We will set external breakpoint and debug our code.We will use gateway client for testing.

  1. OData service created.


  1. Open gateway client (/IWFND/GW_CLIENT)and paste following url and press execute button.Url:/sap/opu/odata/SAP/ZTEST_ODATA_SRV_01/FlightScheduleSet(Carrid='AA',Connid='0017').(It will definitely throw error because we have not implemented getentity method of FlightScheduleSetšŸ˜Ž).See screenshot.
  2. Now click on 'Error Log'(or tcode /IWFND/ERROR_LOG) button(circled in screenshot of step 1) to see Gateway error log.Identify the current error by analysing date and time of the error occured.Clicking on the error detail will be shown in below window.On clicking Information button(red tagged 1 in screenshot) more information will be shown in a popup window.Check Backend Error Flag(red tagged 2 in screenshot).Backend Error Flag is ticked so now we know error is in SAP backend.Click on Backend Monitor button(tagged 3 in screenshot).
  3. Now we reached SAP backend error log((or tcode /IWBEP/ERROR_LOG) ).Here also the error message is pretty much same.Clicking Call Stack button(tagged 1) will show the flow of the application.Clicking Active Source button(tagged 2) will take us to directly in the coding.
  4. Here we will put an external break point.For this press button highlighted in screenshot.Now running the Gateway client will take you to abap debugger in a new session.Here you can check the values of variables,logic etc.
  5. Now we need to rectify the issue.For this Open ***DPC_EXT class and redefine FlightSchedule's getentity method. Put some code to fetch data and activate it.I have set one line code er_entity-carrid = 'AA'  inside method.
  6. Now run gateway client again.Now we can see success response.
If you enjoyed this post, Please Share!!


Post a Comment

Powered by Blogger.