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.


To report this post you need to login first.

1 Comment

You must be Logged on to comment or reply to a post.

Leave a Reply