Skip to Content
author's profile photo Former Member
Former Member

cannot read property DSV of Null. During calling Create on POST

http://scn.sap.com/thread/3823581

Getting error as cannot read property DSV of Null.

We are getting this error on calling create during POST. we have created a discussion in Fiori too.

Can some one help in resplving the issue.

Thanks

problem.png (8.4 kB)
Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Nov 17, 2015 at 04:47 AM

    Hello Rupesh,

    This particular property is made as null-able in the GW Model ? If yes you need to send ' null ' as the input value when this property field is empty while firing the create request. Check this please.

    What is the payload ? can u share it for which its giving this error ?

    Regards,

    Ashwin

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      In the below code oEntry is the payload from app frontend.

      var oEntry = {};

      oEntry.Manfacture = this.getView().byId("Manufacturer");

      oEntry.Descript = this.getView().byId("Description");

      oEntry.Maintplant = this.getView().byId("MaintenancePlant");

      oEntry.Funcloc = this.getView().byId("FunctionalLocation");

      oEntry.Equicatgry = this.getView().byId("EquipCatid");

      oEntry.ExternalNumber = this.getView().byId("Equipment");

      oEntry.Objecttype = this.getView().byId("TechObjectType");

      oEntry.Manmodel = this.getView().byId("ModelNumber");

      var url = "/sap/opu/odata/sap/Z_FIORI_CREATE_EQUIPMENT_SRV";

      var oMod = new sap.ui.model.odata.ODataModel(url,true);

      this.getView().setModel(oMod);

      OData.request({

      requestUri : "/sap/opu/odata/sap/Z_FIORI_CREATE_EQUIPMENT_SRV/Z_EquipmentCreateSet",

      method : "GET",

      headers : {

      "X-Requested-With" : "XMLHTTPRequest",

      "Content-Type" : "application/atom+xml",

      "DataServiceVersion" : "2.0",

      "X-CSRF-Token" : "Fetch"

      }

      },

      function(data,response){

      var header_xcsrf_token = response.headers['x-csrf-token'];

      var oHeaders = {

      "X-Requested-With" : "XMLHTTPRequest",

      "Content-Type" : "application/atom+xml",

      "x-csrf-token" : header_xcsrf_token,

      "Accept" : "application/xml; charset=utf-8"

      };

      OData.request({

      requestUri : "/sap/opu/odata/sap/Z_FIORI_CREATE_EQUIPMENT_SRV/Z_EquipmentCreateSet",

      method : "POST",

      headers : oHeaders,

      data : oEntry

      },

      function(data,request)

      {

      sap.m.MessageBox.show("Equipment created" + request);

      location.reload(true);

      },

      function(err){

      sap.m.MessageBox.show("Equipment creation Failed" + err );

      });

      },

      function(err)

      {

      var request = err.request;

      var response = err.response;

      sap.m.MessageBox.show("Error in request "+ request +" Response " + response);

      });

      },

  • Posted on Sep 18, 2016 at 09:15 PM

    Hello,

    how do you solved it?

    I have the same issue.

    BR

    Marcel

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.