Hello, everyone!
I have a problem with post method in sap.
I use Odata model:
var sServiceUrl = "/sap/opu/odata/SAP/Z_RYP_SRV/"; var oModelCreate = new sap.ui.model.odata.v2.ODataModel(sServiceUrl, true, "888", "8888" ); this.getView().setModel(oModelCreate);
When I try to do post query I get error.
The following problem occurred: HTTP request failed404,Not Found,{"error":{"code":"005056A509B11EE1B9A8FEC11C21D78E" ,"message":{"lang":"ru","value":"Resource not found for the segment 'sap'."} ,"innererror":{"transactionid":"576A38D4666B2310E1000000C0A805DC","timestamp":"20160628143602.8293510","Error_Resolution":{"SAP_Transaction":"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 (https://service.sap.com/sap/support/notes/1797736)"}}}}
I use this code
onCreatePost: function() { var oEntry = {}; oEntry.Name = "Peter"; var sServiceUrl = = "/sap/opu/odata/SAP/Z_RYP_SRV/" var oModelCreate = new sap.ui.model.odata.v2.ODataModel( sServiceUrl ); sap.ui.getCore().setModel(oModelCreate); oModelCreate.create('/sap/opu/odata/SAP//sap/opu/odata/SAP/Z_RYP_SRV//EtSet', oEntry, null );
Could you help me deecide it problem?!
Your create path is incorrect, should be something like
oModelCreate.create('/EtSet', oEntry, null ...
See
OData Write Support - UI Development Toolkit for HTML5 (SAPUI5) - SAP Library
Regards,
Jamie
SAP - Technology RIG
Add a comment