cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Error while parsing an XML stream

Former Member
0 Likes
32,510

Hi,

I'm receiving an "error whilse parsing an XML stream" while calling the oModel.create() - method.

Can you help me with that?

Here is my Code:

//Creating a new Entry

var oModel = sap.ui.getCore().getModel("Service");

var oRequestBody =

        {

            Kunnr: parseInt(iIdSelectedDebitor),

            Matnr: sActualMatnr.toString(),

            DatumHinzu: new Date(),

            Gekauft: false,

            DatumGekauft: null

        };

oModel.create("/WListSet", oRequestBody, null,

               function(oSuccess, oResponse)

               {...},

               function(oError)

               {...});


//ServiceBinding.js

    var sUrl = "/sap/opu/odata/sap/ZSHOPPING_APP_SRV/";

    var oModel = new sap.ui.model.odata.ODataModel(sUrl, true);

    sap.ui.getCore().setModel(oModel, "Service");

View Entire Topic
Former Member
0 Likes

All the elements in the requestBody have to be parsed as in the service definition.

Like this:

var oRequestBody =
   {
   Kunnr: iIdSelectedDebitor.toString(),
   Matnr: sActualMatnr.toString(),
   DatumHinzu: new Date(),
   Gekauft: "",
   DatumGekauft: new Date()
   };