Skip to Content
Author's profile photo Former Member

Step-by-Step use Gateway Client to Test Operation–Update

1.In Fiori UI APP-Tasks

I create a task using description “Sara test 20150909” and guid’3440B5B1-72DE-1ED5-95DB-3B2C4244BC62′.

2.In SAP Gateway Client.

Step 1. First, we will use Get method to read this task.

Http method: Get

Request URI:  /sap/opu/odata/sap/CRM_TASK/Tasks(guid’3440B5B1-72DE-1ED5-95DB-3B2C4244BC62′)

Protocol: HTTP

Do action: Hit F8

Image.png

Result:

HTTP Respond Code:200

And got the information of this request.

Image.png

Step 2. Then, Once I get the response, I click on “Use as Request” button, which will populate the request body same as the current response.

Result:


Image.png



Step 3.  Now add  the values in the request  header.

NOTE1: For update, we need to add If-Match in header.

            The purpose of this feature is to allow efficient updates of cached information with a minimum amount of transaction overhead. It is also used, on updating requests, to prevent inadvertent modification of the wrong version of a resource.


NOTE2: The value in is: W/”‘【Etag】'”.

                 For 【Etag】(One property of Entity) is the only field which can distinguish version.


Image.png


Result:


Image.png



Step 4.  Now change  the values in the request  body as you think.

In this case, I will change description from  <d:Description>Sara test 20150909</d:Description> to

                                                               <d:Description>Sara test 20150909 Updated Here</d:Description>.

when Merge

                                                               <d:Description>Merge</d:Description>.

Result:


Image.png



Step 5.

Http method: PUT

Request URI:  /sap/opu/odata/sap/CRM_TASK/Tasks(guid’3440B5B1-72DE-1ED5-95DB-3B2C4244BC62′)

Protocol: HTTP

Do action: Hit F8

Result:

HTTP Respond Code:204 (204:  The server successfully processed the request, but is not returning any content.)

Image.png



For update, you can also use HTTP method: Merge

Http method: Merge

Image.png


Step 6. Do double check in DB.

Image.png



When Merge:

Image.png



Step 7. Do double check in UI.


Finish.


Assigned tags

      2 Comments
      You must be Logged on to comment or reply to a post.
      Author's profile photo Nagarajan S
      Nagarajan S

      Hi,

      can you tell me that how to use post method using json format for service testing.?

       

      Author's profile photo Mohit .
      Mohit .

      Hi Nagarajan,

      Do you get the solution? We also need to pass a 'guid' value in batch call post method. otherwise, when we tried to give any guid value or empty guid value, it is showing value for this property is invalid at offset xyz.
      And we are not able to hit the breakpoint for checking the method implementation.