Hello Friends,
I'm reading the data from Input fields from UI Form and send it to OData Service using below Code after click on Submit Button.
var ofileNamePath = this.getView().byId("fileUploader").getValue();
var oOrderType = this.getView().byId("BSARK_id").getValue();
var oPriceGroup = this.getView().byId("KONDA_id").getValue();
var oCustomerPOReference = this.getView().byId("BSTKD_id").getValue();
var oCustomer = this.getView().byId("KUNNR_id").getValue();
var oCustomerGroup = this.getView().byId("KDGRP_id").getValue();
var oDeliveringClub = this.getView().byId("WERKS_id").getValue();
var oSPricingClub = this.getView().byId("BZIRK_id").getValue();
var oRequestedDeliveryDate = this.getView().byId("VDATU_id").getValue();
var oSalesOffice = this.getView().byId("VKBUR_id").getValue();
var oSalesGroup = this.getView().byId("VKGRP_id").getValue();
var uploadQuoteData = {
"FILENAME": ofileNamePath,
"BSARK": oOrderType,
"KONDA": oPriceGroup,
"BSTKD": oCustomerPOReference,
"KUNNR": oCustomer,
"KDGRP": oCustomerGroup,
"WERKS": oDeliveringClub,
"BZIRK": oSPricingClub,
"VDATU": oRequestedDeliveryDate,
"VKBUR": oSalesOffice,
"VKGRP": oSalesGroup
};
// Set Data to ODataModel
this.getView().getModel().create('/QuoteInputSet', uploadQuoteData, {
success: function(uploadQuoteData) {
sap.m.MessageBox.show("Quotation Uploaded successfully ",{
icon: sap.m.MessageBox.Icon.SUCCESS,
title: "Success",
actions: [sap.m.MessageBox.Action.OK],
onClose: function(oAction) {
// Close the window.
}
});
},
error: function(oError) {
sap.m.MessageBox.show(JSON.stringify(oError.message),{
icon: sap.m.MessageBox.Icon.ERROR,
title: "Error",
actions: [sap.m.MessageBox.Action.OK]
});
}
})
But It goes to the error: function(oError) { and displaying below Error.
Kindly help me on this issue.
Regards
Vijay