Skip to Content
1
Jun 08, 2018 at 02:08 PM

OData success message even though no new entry

208 Views Last edit Jun 09, 2018 at 09:07 AM 5 rev

I have an SAPUI5 application which is deployed to ABAP server and accessible with Fiori Launchpad. I use this app to create a new interaction (Standard OData service CUAN_IMPORT_SRV) in Hybris Marketing. My problem is that even though the OData call created no new entry (because such entry already exists), I get the success message. When I add invalid data to the upload data, I get the error message. This is my code:

var oModel = new sap.ui.model.odata.v2.ODataModel("https://hostname:port/sap/opu/odata/sap/CUAN_IMPORT_SRV/", true);

var oData = { some json... }

oModel.create("/ImportHeaders", oData, { 
	success: function() { 
		sap.m.MessageBox.success("Interaction successfully created!", {
			title: "Success"
		});
	},
	error: function() { 
		sap.m.MessageBox.error("Interaction could not be created.", {
			title: "Error"                                
		});
	}
});

When I run /n/iwfnd/traces it is marked as "successful execution" (even though no new entry was created).

How can I avoid that the success message appears even though no new entry was created?