Skip to Content
0
Nov 25 at 04:21 AM

Unable to read odata response in UI5

169 Views Last edit Nov 25 at 04:22 AM 2 rev

hi,

I'm using below fun to post data to SAP, the data has been added successfully to SAP, but I'm unable to debug the response data from the Odata.

the messageToast for "Done" never reached.

From the odata side, I already filled the er_entity to display the inserted data, so it's not an empty response. I also tested it using sap gateway and the response has data.

But here I cannot read the response.

		postData: function(oEvent) {
		
			var oEntry = {};
			oEntry.Firstname = this.byId("txtFirstname").getValue();
			oEntry.Lastname = this.byId("txtLastname").getValue();
			oEntry.Address = this.byId("txtAddress").getValue();
			oEntry.Postal = this.byId("txtPostal").getValue();
			
			this.getOwnerComponent().getModel("employee").
			create("/employeesSet", oEntry, null, function(response) {
				MessageToast.show("Done");
			}, function(Error) {
				MessageToast.show("Customer Creation Failed  " );
			});
		},<br>

Please help

thanks