Skip to Content
0

Getting Response From Service Layer While performing CRUD Operations

Nov 30, 2017 at 04:51 PM

41

avatar image
Former Member

Hello Everyone,

I would like to know how can i get the response from SAP B1 HANA Service Layer during Insert, Update & Delete operation.

For e.g : If a record is successfully added into the database using the Service Layer then I should get something in the response like 1, 0, Incremented ID or new Object Key.

Same scenario for Update & Delete operation. So let me know your thoughts.

Currently, I have registered 1 UDO & performing CRUD operations through service Layer now every-time I am getting the blank response upon successful Insertion, Updation & Deletion.

So How would I confirm whether the object has been successfully added in the UDO or not.

Thanks

Rahul Jain

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

1 Answer

Best Answer
Maria Trinidad MARTINEZ GEA
Dec 04, 2017 at 03:04 PM
1

Hi Abhay,

Only the Add operation on Service Layer returns in the response body the full object you requested to be added.

Other operations like Update and Delete return an empty body response.

Nevertheless for all Service Layer operations you get a response status: "201 Created" for Add, "204 No Content" for Update, Delete,... in case of success or different error codes (3XX, 4XX,...) in case of failure. Based on the response status you can know if it was successfull or not and what is the problem. In case of success you can always send a GET request to double check the changes if required.

If you look at the Service Layer API User Manual: https://yourhanaserver:50000/ then click on "User Manual" link section "3.5 Create/Retrieve/Update/Delete (CRUD) Operations" you will be able to check the request and reponse format for each one of the entities exposed via Service Layer.

Hope it helps,
Trinidad.

Share
10 |10000 characters needed characters left characters exceeded