-1

I have been looking at this for quite some time and I don't know why it fails, because in another controller I have the same code and it updates the model. What do you think it could be?

    onAcepta: function(oEvent) {
            var oModel = this.getOwnerComponent().getModel();
            var oDataModel = this.getOwnerComponent().mainIdentJson;
            console.log(oDataModel);
            var sPath = "/IdentitiesSet(Userid='" + oDataModel.Userid + "',Ident='" + oDataModel.Ident + "')";
            oModel.update(sPath, oDataModel, {
                success: function(oData, oResponse){
                    console.log("OK");
                    
                },
                error: function(oResponse){
                    console.log("No");
                }
    
            });
            this.closeParent();
            this.selectedItems = [];
        }

Error in Log-dbg.js:

2021-08-13 14:01:40.161899 Request failed with status code 400: MERGE IdentitiesSet(Userid='?????????'.Ident='?') - [{"code":"SY/530","message":"Inline component is not defined or not allowed (HTTP PUT)","persistent":false,"targets":["/IdentitiesSet(Userid='?????????'.Ident='?')"],"type":"Error"}] sap.ui.model.odata.ODataMessageParser

[![2021-08-13 14:01:40.161899 Request failed with status code 400: MERGE IdentitiesSet(Userid='?????????'.Ident='?') - [{"code":"SY/530","message":"Inline component is not defined or not allowed (HTTP PUT)","persistent":false,"targets":["/IdentitiesSet(Userid='?????????'.Ident='?')"],"type":"Error"}]

this is the batch: and the changes that I want are okay

batch: so, I think that the batch is doing okay? so I don't know the error

and the weird thing is that in other view in this project, I have an update with this same path and works perfectly.

General Grievance
  • 4,555
  • 31
  • 31
  • 45
JK97Tae
  • 28
  • 8
  • 1
    Does this answer your question? [How to define HTTP PUT method while performing a update operation using sapui5](https://stackoverflow.com/questions/64415952/how-to-define-http-put-method-while-performing-a-update-operation-using-sapui5) – Sandra Rossi Aug 15 '21 at 08:18
  • **DO NOT post images of code, data, error messages, etc.** - copy or type the text into the question. [ask] – Rob Oct 09 '21 at 10:08

1 Answers1

1

Are you trying to pass nested payload like we pass to deep insert. If yes, it wont work as the feature is not supported for Put operation. Instead you need to process it via batch. Deep Entity Update

Dharman
  • 30,962
  • 25
  • 85
  • 135
  • I really don't know because the batch is doing automatically. Look, I'll update this post with the info of the batch – JK97Tae Aug 18 '21 at 10:36