Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 10052

Re: Passing Error / Info / worning from Gateway to Ui5 applictaion

$
0
0

Hi,

 

Assume you want to add document number 123 into SAP table and you have GW service ready with entity having that field and corresponding entity set of it. and also you have instantiated model as

 

var sURI = getUrl( '/sap/opu/odata/sap/YOUR_GW_SRV/');

 

  oModel = new sap.ui.model.odata.ODataModel(sURI, false),

  sap.ui.getCore().setModel(oModel);

 

then you need to add below code on your button press event.

 

var oEntry = {}; 

oEntry.your_property_name = "123"; 

oModel.create('/YourCollection', oEntry, null, function(oResponse){ 

                        alert("Create successful"); 

                                                    console.log(oResponse); 

                    },function(){ 

                        alert("Create failed");});    

 

now in the success callback function, oResponse will have response payload information that you will fill into create_entity method of DPC_EXT class of OData service. Refer Create operation details in the blog Let’s code CRUDQ and Function Import operations in OData service!

 

Regards,

Chandra


Viewing all articles
Browse latest Browse all 10052

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>