on 11-18-2015 11:52 AM
Hi,
I have created one RFM with importing single parameter and exporting tabular.
For get entity set is working right but when I am trying to put(update) getting error.
1. For update I have written code in update_entity even external break point is not triggering, same worked for get entity.
Get entity Request URI : /sap/opu/odata/sap/ZUSER_DATA_SRV/ZUSERDATASet/?$filter=Uname eq 'P02050607'
Put Operation URI : /sap/opu/odata/sap/ZUSER_DATA_SRV/ZUSERDATASet(Mandt='300',Uname='P02050607')
-Amol S
Hi Amol,
Are you trying to hit this service from Gateway or from Code ?
It would be good if you can share Error which you are getting (Browser console use key SHIFT + F12).
Assuming you are trying to hit service from UI5 code, try below code this works for me:
<your function name>: function(oEvent) {
var oEntry = {};
oEntry.<your parameter>= this.oModel.getData().ObjectId;
alert(this.oModel.getData().ObjectId);
// I set my Model in Component.JS file so getting its reference like below might change for you..
this._oComponent.getModel().update("/ZUSERDATASet(Mandt='300',Uname='" + <your user name> + "')", oEntry, null, function(){
sap.ui.commons.MessageBox.show(
sap.ui.commons.MessageBox.alert("Success!")
);
},function(){
sap.ui.commons.MessageBox.alert("Error!");
});
},
Issue I faced while using PUT method was related to Virus Scan profile. but this will throw an error in Gateway when you try to use.
Second thing just check if your Entity is set to Updatable or not as in below screen shot
Thanks-
Abhishek
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
83 | |
10 | |
10 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.