cancel
Showing results for 
Search instead for 
Did you mean: 

How to use UPDATE_ENTITY method of class DPC_EXT SAP UI5 ?

meenakshi_raina
Advisor
Advisor
0 Kudos

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

meenakshi_raina
Advisor
Advisor
0 Kudos

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

Accepted Solutions (0)

Answers (1)

Answers (1)

saurabh_vakil
Active Contributor
0 Kudos

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.

meenakshi_raina
Advisor
Advisor
0 Kudos

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

saurabh_vakil
Active Contributor
0 Kudos

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

meenakshi_raina
Advisor
Advisor
0 Kudos

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

saurabh_vakil
Active Contributor
0 Kudos

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.