on 08-27-2015 7:08 AM
Hi all,
Iam trying an OData model create method.
This is my sample code,
onInit: function() {
this._oView = this.getView();
this.oModel = new sap.ui.model.odata.ODataModel("myurl", "true","myuserid","mypassword");
this._oView.setModel(this.oModel);
},
// On save button
handleSavePress: function() {
var emp = this.oView.byId("empId").getValue();
var name = this.oView.byId("nameId").getValue();
var city = this.oView.byId("cityId").getValue();
var obj = {};
obj.Id = emp;
obj.Name = name;
obj.City = city;
this.oModel.create("/mycreateSet",obj,null,
function(){
alert("Created Sucessfully");
},
function(){
alert("Error while creating");
}
);
},
while executing this code i'm getting an error in console as,
2015-08-27 11:29:06 [index.html] The following problem occurred: HTTP request failed400,Bad Request,{"error":{"code":"CX_SXML_PARSE_ERROR/001560AA0E081DEB8CA398CC1690D406","message":{"lang":"en","value":"Error while parsing an XML stream"},"innererror":{"transactionid":"55DCDC6D9FA63438E1000000C0A80103","timestamp":"20150827055102.2783640","Error_Resolution":{"SAP_Transaction":"Run transaction /IWFND/ERROR_LOG on SAP NW Gateway hub system and search for entries with the timestamp above for more details","SAP_Note":"See SAP Note 1797736 for error analysis (https://service.sap.com/sap/support/notes/1797736)"},"errordetails":[]}}} -
Please help me on this.
Thanks in advance,
Sathish
May be wrongly passing some data. check with your metadata Properties type.
obj.Id = emp;//If type is integer then you can't pass string values.
obj.Name = name;
obj.City = city;
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Can you share the error in /IWFND/ERROR_LOG or get the Request payload data from the HTTP trace of the browser?
Regards,
Vijay
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
98 | |
11 | |
11 | |
10 | |
10 | |
8 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.