Skip to Content
0
Aug 23, 2016 at 02:28 AM

Issue in search the values in ValueHelp.

69 Views

Hello Friends,

I have issue in search the data from the ValueHelp as per below code. when i click on Search in network tab its showing "$skip=0&$top=20" due to this it displayed 20 values. Instead of 20 how to pass "1" into the Service URL.

salesGrpValueHelp: function(oEvent) {
            var oSalesGroupEntitySet = "";
            var oSalesGroupItemTemplate = new sap.m.StandardListItem({
                title: "{Vkgrp}",
                description: "{Bezei}",
                info: "{Vkbur}",
                active: true
            });
//Creation of the JSON Model for the Test Daa
            var oSalesGroupModel = this.getView().getModel("QuoteModel");

            //Create the Dialog and we attach this as helper
            var oSalesGroupSelectDialog = new sap.m.SelectDialog({
                title: "Select Sales Group Values",
                noDataText: "No Sales Group Values Found",
                search: this._oSalesGroupValueHelpSearch,
                confirm: function(oevt) {
                    this._oSalesGroupValueHelpClose(oevt);

                }.bind(this),
                cancel: this._oSalesGroupValueHelpClose
            });
//Now set the model for Dialog and bind the Aggregration.
            if (vsalesOfficeValue === "") {               
                oSalesGroupEntitySet = "/HTvbvkSet?$filter=Vkgrp gt '010'";
            } else if (vsalesOfficeValue !== null) {               
                oSalesGroupEntitySet = "/HTvbvkSet?$filter=Vkbur eq ('" + vsalesOfficeValue + "') and Vkgrp gt ('" + VkgrpNum + "')";
            }
            oSalesGroupSelectDialog.setModel(oSalesGroupModel);
            oSalesGroupSelectDialog.bindAggregation("items", oSalesGroupEntitySet, oSalesGroupItemTemplate);
            oSalesGroupSelectDialog.open();
        },
_oSalesGroupValueHelpClose: function(evt) {

            var oSelectedItem = evt.getParameter("selectedItem");
            var productInput = this.getView().byId("VKGRP_id");
            productInput.setValue(oSelectedItem.getTitle());
            evt.getSource().getBinding("items").filter([]);
            this.onSelectInputValidation();           
            vsalesOfficeValue = "";
        },
        _oSalesGroupValueHelpSearch: function(evt) {
            //var sValue = evt.getParameter("value");
            var sValue = "'" + evt.getParameter("value") + "'";
            var oFilter = new Filter(
                "Vkgrp",
                sap.ui.model.FilterOperator.Contains, sValue
            );
            evt.getSource().getBinding("items").filter([oFilter]);
            vsalesOfficeValue = "";
        }





using below URL. It displayed 20 records

https://HOST/sap/opu/odata/sap/zgw_create_quotation_srv/HTvbvkSet?$skip=0&$top=20&$filter=substringof(%27300%27,Vkgrp)&$inlinecount=allpages&$filter=Vkbur%20eq%20(%27FL%27)%20and%20Vkgrp%20gt%20(%27010%27)

using below URL. It displayed 1 records

https://HOST/sap/opu/odata/sap/zgw_create_quotation_srv/HTvbvkSet?$skip=0&$top=1&$filter=substringof(%27300%27,Vkgrp)&$inlinecount=allpages&$filter=Vkbur%20eq%20(%27FL%27)%20and%20Vkgrp%20gt%20(%27010%27)

Kindly help me on this issue.

Regards

Vijay

Attachments

1.JPG (196.7 kB)