I have the following problem. I have an Function import where I have two date fields. SEGW Function import
here is how i call the function import:
this.getView().getModel("odata").callFunction("/SavePos", {
method: "GET",
urlParameters: oProperty,
success: function(oData, response) {
jQuery.sap.delayedCall(500, this, function() {
this.getView().byId("idI_HuCount").focus();
});
sap.m.MessageToast.show(this.getView().getModel("i18n").getResourceBundle().getText("DATA_SAVED"));
this.setBusy(false);
}.bind(this), // callback function for success
error: function(oError) {
sap.m.MessageToast.show(this.getErrorMessageFromOdataError(oError));
this.setBusy(false);
}.bind(this)
});
If i enter the dates, everything works fine. But in a few cases i don't have to input any date. If i don't enter any date i get the following error message in gateway: Invalid function import parameter OData Error message
If i add the date Property as emtpy (oProperty.ProdDate = "";) then i get this error message: Deformed URI literal syntax OData error message
Do you have an idea how i can call the function import with empty date fields?
EDIT: Here is how the request looks like if i set the date field to "":
GET SavePos?sap-client=200&Docno='00000000000000000000000410000003293'&Itemno='0000000020'&HuTopTyp='E1'&QuanTopHu=2m&Productid=guid'005056bc-ebf7-1eda-81aa-812468f4d0ee'&QuanProHu=5m&HuSubTyp='%20'&QuanSubHu=0m&Sample=''&ProdDate=&BestBeforeDate=
And like this if i don't set any values:
GET SavePos?sap-client=200&Docno='00000000000000000000000410000003293'&Itemno='0000000020'&HuTopTyp='E1'&QuanTopHu=2m&Productid=guid'005056bc-ebf7-1eda-81aa-812468f4d0ee'&QuanProHu=5m&HuSubTyp='%20'&QuanSubHu=0m&Sample=''