I need to pass a parameter in my OData.
The URL has to be like this:
http://my_gateway_system:port/sap/opu/odata/sap/ZGW_TRANSF_APPROVAL_SRV_02/ztest
You are using the legacy method call of ODataModel#read (with the parameters spread out). The current signature for this method is read(sPath, mParameters). Please check out the documentation of the method: https://openui5.hana.ondemand.com/#docs/api/symbols/sap.ui.model.odata.ODataModel.html#read
In your concrete case, you should do something like:
oModel.read("/ztest_nameset('RUBENS')", {
filters: [/* your filters here */],
success: function(oData) {
oJsonModel.setData(oData);
}
});
Nevertheless, it is not clear what filter parameter you want to pass. In your example, you have no filter. The /ztest_nameset('RUBENS') URI is just a plain entity set + key. It is also not clear what errors you get. I could guess that it can be a CORS issue. You seem to be making the OData calls to some other host than the one you are serving the UI5 app from.