Skip to Content

How to debug the code of odata services

Hi Everyone,

I have written the code of "Read Service" in the Get_Entity method from the below link Let’s code CRUDQ and Function Import operations in OData service! but I want to debug the code.

I want to know the technique to debug the code to see which data is coming when and where. Because I am not able to do the read service operation.

Kindly help me to debug the code.

Regards,

Soumya

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

4 Answers

  • Best Answer
    avatar image
    Former Member
    Apr 10, 2014 at 06:26 PM

    You can directly try with transaction /IWFND/GW_CLIENT also known as Gateway Client.

    Or if you are familiar with service builder, You need to go to Service Maintenance node, then you need to click on the Maintain Service button. A new screen will popup . There you can see a button for Gateway Client.

    This is a test client provided by Gateway to simulate browser behaviour. Using this client you can directly call your OData service and check the result.

    To Debug a READ

    1. you need to set a session breakpoint in method GET_ENTITY of your Data Provider class,

    2. Next you need to to call the READ URL with HTTP method 'GET' in the  Gateway Client. The READ URI will look like

    /sap/opu/odata/IWBEP/<SERVICE NAME>/ENTITYSETNAME(KEY1=value1, KEY2= value2 )

    If everything is fine so far , control will hit the break point.

    Also you can use chrome extension like Postman or Advanced Rest Client to test your OData service.

    The Advantage of Gateway Rest Client over these browser extension is , you do not need to pass X-CSRF-Token for PUT-POST-DELETE kind of operations, Gateway Client can take of these out of the box.

    Add comment
    10|10000 characters needed characters exceeded

  • Apr 10, 2014 at 02:26 PM

    To debug a Odata Service, just put a breakpoint inside the GET_ENTITY method, and keep SAP GUI open. When you make the request in the browser, the debugger will open (if it reached your code).

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Sep 29, 2015 at 12:32 PM

    This message was moderated.

    Add comment
    10|10000 characters needed characters exceeded

  • Jun 06, 2016 at 02:44 PM

    This message was moderated.

    Add comment
    10|10000 characters needed characters exceeded