Skip to Content

Bad request from sapui5 odata

Hello community,

Right now i'm triying to create an entry, well i'm jus testing that my odata is receiving the info, so i create an odata with my entity CrearSet and activate the check of creatable, put some break-points to debugg when my app sapui5 send the info but is not receiving nothing

now, this is my controller/function that fire my event/odata i'm using odata v2

// "sap/ui/model/odata/v2/ODataModel",
function(Jquery, Controller, MessageToast, JSONModel, ODataModel, ManagedObject, validRut, ODataModeII) {

onCrear : function() {
    var mensajeOkCreado = this.byId("mensajeOkCreado");
    var mensajeNotCreado = this.byId("mensajeOkCreado");
    var sURI = "/sap/opu/odata/sap/ZCRM_UX_PROSPECTO_SRV";
    var oModel = new ODataModeII(sURI, true); 
    var oDatosRespuesta = new JSONModel();
    var oInfo = {};
    oInfo.rut       = this.byId("crearRut").getValue();
    oInfo.nombres   = this.byId("crearNombres").getValue();
    oInfo.apellidos = this.byId("crearApellidos").getValue();
    oInfo.calle     = this.byId("crearDir1").getValue();
    oInfo.numero    = this.byId("crearDir2").getValue();
    oInfo.depto     = this.byId("crearDir3").getValue();
    oInfo.comuna    = this.byId("crearDir4").getValue();
    oInfo.fijo      = this.byId("crearTlf1").getValue();
    oInfo.movil     = this.byId("crearTlf2").getValue();     = this.byId("crearMail").getValue();
    oModel.create("/CrearSet", oInfo, {
          method: "POST",
          success: function(data) {
          error: function(oError) { 


So i got this error:

The following problem occurred: 
HTTP request failed400,Bad Request,
       "message":{"lang":"es","value":"Property 'rut' is invalid"},

"Error_Resolution":{"SAP_Transaction":"For backend administrators: run transaction /IWFND/ERROR_LOG on SAP Gateway hub system and search for entries with the timestamp above for more details","SAP_Note":"See SAP Note 1797736 for error analysis ("},"errordetails":[]}}} - 

this is how i configured my odata:


i follow this tutorial :

properties.png (42.6 kB)
entityset.png (22.6 kB)
method-used.png (7.5 kB)
code-method.png (47.6 kB)
Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

3 Answers

  • Best Answer
    May 17, 2018 at 07:02 PM

    Error message says property 'rut' is is invalid

    check if property with name 'rut' exists in metadata also check the length/data type of the property.

    If data type is Edm.String and length = 4, and you are passing value of length '5' then create operation will result in error.

    Add comment
    10|10000 characters needed characters exceeded

  • May 17, 2018 at 10:11 PM

    Try change oInfo.rut TO oInfo.Rut

    Add comment
    10|10000 characters needed characters exceeded

  • Nov 10, 2018 at 12:55 PM

    Hi Naoto Amari,

    Pass your objects to backend Case sensitive as it is showing in your metadata.

    Sent your objects following format. then i ll will work.

    You have to follow entityset Property Name Tab.

        oInfo.Rut       = this.byId("crearRut").getValue();
        oInfo.Nombres   = this.byId("crearNombres").getValue();
        oInfo.Apellidos = this.byId("crearApellidos").getValue();
        oInfo.Calle     = this.byId("crearDir1").getValue();
        oInfo.Numero    = this.byId("crearDir2").getValue();
        oInfo.Depto     = this.byId("crearDir3").getValue();
        oInfo.Comuna    = this.byId("crearDir4").getValue();
        oInfo.Fijo      = this.byId("crearTlf1").getValue();
        oInfo.Movil     = this.byId("crearTlf2").getValue();    
        oInfo.Email     = this.byId("crearMail").getValue();
    Add comment
    10|10000 characters needed characters exceeded