on 10-30-2015 7:55 AM
oValueHelpDialog.getTable().bindRows("/CompanyCodeValuehelp?$filter=CompanyCode eq '0001'");
In this query i have passed hard coded value '0001'. Here I need to pass a variable.The variable contains value that is filled by user in form.
var aFilters = [];
var sQuery = oEvt.getParameter("query");
console.log(sQuery);
var oColModel = new sap.ui.model.json.JSONModel();
oColModel.setData({
cols: [
{label: "Company Code", template: "CompanyCode"},
{label: "CompanyCodeName", template: "CompanyCodeName"}
]
});
oValueHelpDialog.getTable().setModel(oColModel, "columns");
oValueHelpDialog.getTable().setModel(sap.ui.getCore().getModel("oDataModel1"));
oValueHelpDialog.getTable().bindRows("/CompanyCodeValuehelp?$filter=CompanyCode eq sQuery");
In this way I m trying to implement it. But it is not working.
Please guide me
Try like this and check -
oValueHelpDialog.getTable().bindRows("/CompanyCodeValuehelp?$filter=CompanyCode eq " +sQuery+"");
Regards,
Sai Vellanki
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Sai,
oValueHelpDialog.getTable().bindRows("/CompanyCodeValuehelp?$filter=CompanyCode eq " +sQuery+"");
i tried above code suggested by you but still not getting data in table when i enter particular value in serach field .
console output
1.GET http://dev_sf1:08oct%402015@localhost:51923/AssetPro/proxy/http/10.35.20.16… ATERIAL_SRV/CompanyCodeValuehelp?$filter=CompanyCode%20eq%20%200001/$count 400 (Bad Request)
2.GET http://dev_sf1:08oct%402015@localhost:51923/AssetPro/proxy/http/10.35.20.16…?$skip=0&$top=105&$inlin... 400 (Bad Request)
3.2015-10-30 14:30:16 The following problem occurred: HTTP request failed400,Bad Request,{"error":{"code":"005056A509B11EE1B9A8FEA8DE87F78E","message":{"lang":"en","value":"Property 0001 not found in type CompanyCodeValuehelp"},"innererror":{"transactionid":"562820B4ACD475D0E10000000A2314A6","timestamp":"20151030085942.8365090","Error_Resolution":{"SAP_Transaction":"Run transaction /IWFND/ERROR_LOG on SAP NW 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)"}}}}
Regards,
Monika
In console output in query its taking value "0001" with message bad request but my table is not showing any filtered data in it.
code
var sQuery = oEvt.getParameter("query");
oValueHelpDialog.getTable().bindRows("/CompanyCodeValuehelp?$filter=CompanyCode eq " +sQuery+"");
console output
ATERIAL_SRV/CompanyCodeValuehelp?$filter=CompanyCode%20eq%20%200001/$count 400 (Bad Request)
As you can see in query its taking value "0001" but table was not filtered
output screen
Code
oValueHelpDialog.getTable().bindRows("/CompanyCodeValuehelp?$filter=CompanyCode eq '0001'");
when i am giving particular company code in my query and enter the same company code in search field and hit enter then table is getting updated
Console output
GET http://dev_sf1:08oct%402015@localhost:51923/AssetPro/proxy/http/10.35.20.16…RIAL_SRV/CompanyCodeValu... 400 (Bad Request)
output screen
Hi Monika,
When you hard-code the value, binding is working?
Regards,
Sai Vellanki.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
91 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.