Skip to Content
0
Former Member
Aug 26, 2013 at 09:26 AM

Implementing Odata service in SAPUI5

1342 Views

Hi,

I am new to sapui5 ,trying out some stuffs.

Could you please let me know how to implement this service url

"/sap/opu/odata/sap/ZNWG_ADD_CON/znwg_add_data_modelCollection?$filter=a_imp1 eq 15 and b_imp2 eq 12" in sapui5 .

I have used this method

var oModel=new sap.ui.model.odata.ODataModel("proxy/sap/opu/odata/sap/ZNWG_ADD_CON/znwg_add_data_modelCollection?$filter=a_imp1 eq 15 and b_imp2 eq 12",false,"username","password");

but system appends $metadata after znwg_add_data_modelCollection

i.e., http://localhost:8006/MyFirstMobile/proxy/sap/opu/odata/sap/ZNWG_ADD_CON/znwg_add_data_modelCollection/$metadata?$filter=a_imp1%20eq%2015%20and%20b_imp2%20eq%2012

and error related to this is "The request URI is not valid. The segment 'znwg_add_data_modelCollection' refers to an entity set and not to a single entity".

Thanks,

Vijay.