cancel
Showing results for 
Search instead for 
Did you mean: 

removed......

former_member489109
Participant
View Entire Topic
junwu
SAP Champion
SAP Champion
0 Kudos

why you are doing that? what is the real problem?

if you delete it, how can it be json format???

former_member489109
Participant
0 Kudos

Firstly you can see my odata picture then;

If you try this like deep insert you will get error.Because deep insert works without "results" tags.

var oEntry = oData.results[0];

var oModel = that.getView().getModel();

oModel.create("/ScarrSet", oEntry, {

method: "POST",

success: function(oData, oResponse) {

console.log("success");

},

error: function(oError, oResponse) {

console.log("error");

}

});

But if you remove "results" tags its work fine

var oEntry = oData.results[0];

oEntry.ScarrToSpfli = oEntry.ScarrToSpfli.results;

oEntry.ScarrToSflight = oEntry.ScarrToSflight.results;

var oModel = that.getView().getModel();

oModel.create("/ScarrSet", oEntry, {

method: "POST",

success: function(oData, oResponse) {

console.log("success");

},

error: function(oError, oResponse) {

console.log("error");

}

});

I know i can change data before create operation.I dont prefer this. I just want to remove all "result" tags in the returned odata json.

In addition, it provides convenience in data binding.

You can use it as ("test>/data") instead of ("test>/data/results").