Skip to Content
0
Jun 20, 2018 at 01:28 PM

500 Internal Server while DELETING rows from SAPUI5

211 Views Last edit Jun 20, 2018 at 01:29 PM 2 rev

Hello,

I have designed and OData service and SAPUI5 Application to perform CRUD operations.

During DELETE operation, everything works fine when tested in Gateway Client. But when tested from SAPUI5 it is Gateway throwing 500 error, though row is deleted successfully. Below are my codes. Please guide me here.

Note : I have a date field in table which is marked 'nullable' in EntityType

	var oTable = this.getView().byId("idProductsTable");
		var oModel = oTable.getModel();
		var aBatchtoDelete = [];
		var oSelectedItems = oTable.getSelectedItems();
		var sPath = oSelectedItems[0].getBindingContext().sPath;
		oModel.remove(sPath,null,function(){
			MessageToast.show("Deleted Successfully");
			oModel.refresh();
		},
		function(errData) {
			MessageBox.show(
			"Error occured during deleting records" ,{
			icon: sap.m.MessageBox.Icon.ERROR,
			title: "Dear User",
			styleClass: "sapUiSizeCompact"
					}
			);}
			);

Attachments

capture.png (58.2 kB)