on 08-26-2013 10:26 AM
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
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Were you able to figure this error out? I was following this tutorial and found that I am in the same boat as you...
Hi Tapia,
I did figure out where i was going wrong ,filter's should be assigned to controls rather than using it with a service url i.e., in my case model should be like :
var oModel=new sap.ui.model.odata.ODataModel("proxy/sap/opu/odata/sap/ZNWG_ADD_CON",false,"username","password");
and now let us assume the control is oTable,in this case
oTable.bindRows("/CollectionName");
var oFilter=new sap.ui.model.Filter("a_imp1",sap.ui.model.FilterOperator.EQ,15);
var oFilter1=new sap.ui.model.Filter("b_imp2",sap.ui.model.FilterOperator.EQ,12);
oTable.getBinding("rows").filter(oFilter,oFilter1);
Regards,
Vijay.
User | Count |
---|---|
90 | |
10 | |
10 | |
10 | |
7 | |
7 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.