Skip to Content
0

How to use UPDATE_ENTITY method of class DPC_EXT SAP UI5 ?

Apr 28, 2017 at 01:07 PM

198

avatar image

Hi All,

I have created a table in frontend (in SAP UI5) and backend is ECC system. I have used ODATA to get the data into the table cells. I redefined the 'GET_ENTITYSET' method of my class for the same.

Now I want to execute one of the rows of the table. Hence I want to pass a parameter to backend, where various operations will be performed ( like updating few standard database tables ). I dont understand which method will be called in this case ? I tried to use Odata Update , but it seems that I am doing it wrong. Please guide me -

Regards

Meenakshi

10 |10000 characters needed characters left characters exceeded

only get_entity and get_entityset of my class is triggered. While, create / update methods of my DPT_EXT class are not triggerred.

Please guide me.

Thanks

Meenakshi

0
* Please Login or Register to Answer, Follow or Comment.

1 Answer

saurabh vakil Apr 28, 2017 at 02:28 PM
0

If you are looking to update the selected table row in the backend by calling update function of the ODataModel then you ahev to pass alongwith the entity set name the key field as well against which the record is supposed to be updated in the back end.

oModel1.update("/objidSet("+selectedUserID+")", oEntry, {success:function(){},error:function(){}});

assuming selectedUserID is the key field of the objidSet entity set.

Show 4 Share
10 |10000 characters needed characters left characters exceeded

Hi Saurabh,

Thanks for your reply. But with this code, the 'update' ( or any other method ) of my DPC_EXT class is not triggered. I want to trigger a method of my DPC_EXT class, so I can perform the update operation in all standard tables at ECC end.

Regards

Meenakshi

0

Have you correctly implemented the update method in your OData service? Also, have you checked by setting a breakpoint in the update method?

0

Yes I have already implemented that method. Also, I had kept an external breakpoint in my method. But it was not trigerred.

0

In the UI5 code I see that you are not passing the key field in the entity set passed as a parameter to the update function. Unless you pass the key field the framework has no way of knowing which specific record you are tyring to update.

0