Skip to Content

How to use UPDATE_ENTITY method of class DPC_EXT SAP UI5 ?

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

Add comment
10|10000 characters needed 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

  • Get RSS Feed

1 Answer

  • Apr 28, 2017 at 02:28 PM

    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.

    Add comment
    10|10000 characters needed characters exceeded

    • 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.