Data binding with Multiple Filter

Hi Experts,
I am trying to do the data binding using filters with multiple values.
ex: I am selecting the multiple values from list dialog and those i want to pass to odata service as a filters.
name : abc
               pqr
I am looping on above and pushing it to array of filters.
     jQuery.sap.require("sap.ui.model.FilterOperator");
     var FilterOperator = sap.ui.model.FilterOperator;
     var filtersTerr =  new Array();
   for(i=0;i<name.length;i++){
  filterName = new sap.ui.model.Filter("FirstName", sap.ui.model.FilterOperator.EQ, name[i]);
  filter.push(filterName );
this..getBinding("items").filter([filter],false);
Final filter should be something $filter=FirstName='abc' or FirstName='pqr'.
I have already looked into below discussions but somehow came to conclusion that array cannot be use with OR/AND.
Odata Filter with OR
http://scn.sap.com/thread/3462246
http://scn.sap.com/thread/3560814
Please let me know how this needs to be written.
Thanks,
Rahul

Hi Rahul
There are many ways.
Filter for table
var sRlUrl = "http://<host Name>/sap/opu/odata/sap/ZTWMP" ;
var list = new sap.ui.model.odata.ODataModel( sRlUrl, false, "username", "pswd"); 
list.setDefaultBindingMode(sap.ui.model.BindingMode.TwoWay);
var iv_proID  = sap.ui.getCore().getElementById('input1').getValue();
var iv_listNo = sap.ui.getCore().getElementById('input2').getValue();
var iv_Matnr  = sap.ui.getCore().getElementById('input3').getValue();
var iv_Po     = sap.ui.getCore().getElementById('input4').getValue(); 
//... Set any Filters .. if reqd'
var oFilter = new Array();
var iCount = 0;
if (iv_proID) {
oFilter[iCount] = new sap.ui.model.Filter("abc", sap.ui.model.FilterOperator.EQ, sap.ui.getCore().getElementById('input1').getValue());
iCount++;
if (iv_listNo){
oFilter[iCount] = new sap.ui.model.Filter("def", sap.ui.model.FilterOperator.EQ, sap.ui.getCore().getElementById('input2').getValue());
iCount++;
oFilter[iCount] = new sap.ui.model.Filter("PcTotal", sap.ui.model.FilterOperator.EQ,"HEADER" );
iCount++;
sap.ui.getCore().getElementById('T-POhdr-DR').setModel(list);
//... Bind Rows with oData, with filters if any
sap.ui.getCore().getElementById('T-POhdr-DR').bindRows({
path: '/t_entity set/',
filters: oFilter
2 General filter
  OData.read({ requestUri: "http://<URL>:8001/sap/opu/odata/sap/ZTMP_ABC/Item?$filter=ID eq '"+ID+"' and DESC eq '"+Desc+"'", headers: { Accept: "application/json" } }, function (data, response) {
if (data.results[0]) {
                 sap.ui.getCore().byId("oInput2").setText(data.results[0].<odata field to assign>;

Similar Messages

  • Data Set with multiple ref cursors

    Hi ,
    I need to design an integrated report , i created my data set with a oracle procedure which returns "multiple ref cursors" . In this case birt is displaying all output columns together and it is difficult to identify which column belongs to which ref cursor and if there are any columns with same name in both output cursors , it displays only one. Is there any way to handle this ? or how we handle a data set which contains multiple ref cursors in output ??

    Having to ref cursors return mutiple recordsets in an Oracle package is like haveng two resultsets return from a MS SQL Server sparc.
    The link may point you in the right direction.
    http://www.codeproject.com/Articles/675933/Returning-Multiple-Result-Sets-from-an-Entity-Fram

  • Can we use same data definition with multiple concurrent programs?

    Hi,
    My requirement is as below:
    I have two concurrent programs (say CP1 and CP2), both concurrent programs need to use same data definition (the same data template xml file) and same RTF layout template. However when registering data definition in the E-Biz, the data definition code must match concurrent program, hence I have to create two definitions (for the same data template xml file) and because layout template is attached with data definition I have to duplicate the layout definition also.
    In summary, i have to create two (duplicate) Data Definition and Layout Template for the same dataTemplate.xml and Layout.rtf files. Is there any way to avoid this duplication?
    The only issue with duplication is any change in xml or rtf needs to be updated in all the four definitions (2 data definitions and 2 layout definitions).
    Thanks
    Bhavik

    I found the resolution and thought of sharing
    you can see this post
    *[How to use same data definition/template between multiple concurrent programs? |http://techatwork.wordpress.com/2009/08/06/how-to-use-same-data-definitiontemplate-between-multiple-concurrent-programs/]*
    Thanks
    Bhavik

  • Tip for Data Merge with Multiple Records (labels, etc.)

    I have seen many InDesign Data Merge questions about how to create sheets of mailing labels, especially the problem of getting only one label per page, when you need 30 or more.
    Adobe's instructions are poor and incomplete in that InDesign doesn't step out the records from a data source - it steps out the FRAMES that contain the data field placeholders.
    That is why you only need to place a text or image frame once on a single page - during the datamerge, InDesign will create the additional FRAMES for each record, and it will create the pages required to hold them.
    You do have to set the desired spacing on the
    If you create the frame on a Master page, ID allows you to update the data source (when it changes) in the Data Merge tool panel.
    These are very nice and robust features, but the documentation for them is confusing to many people.
    You will find more great in-depth help  for Data Merge, with screen captures and attachments, here in the forum.

    For a multiple record merge you need one set of placeholders, then set the margins and spacing in the merge options so the positioning is correct.
    Warning: Using Preview in a multiple record merge will corrupt the file. If you press the preview button, Undo after looking at the preview, then merge without using preview.

  • Error in viewing data in a data template with multiple data sources

    Hello,
    I have designed a data template with two data sources.One is from DEPARTMENTS table and the other datasource is a xml file.Following is the code for the data template :
    <dataTemplate name="EmployeeListing" dataSourceRef="demo">
    <parameters>
    <parameter name="p_DEPTNO" dataType="character" defaultValue="20"/>
    </parameters>
    <dataQuery>
    <sqlStatement name="Q1">
    <![CDATA[SELECT DEPARTMENT_NAME,DEPARTMENT_ID,LOC from DEPARTMENTS]]>
    </sqlStatement>
    <xml name="empxml" expressionPath=".//ROW[DEPARTMENT_NAME =$DEPARTMENT_NAME]">
    <url method="GET" realm="" username="" password="">file:///D:\OraHome_1\xmlp\XMLP\DemoFiles\Employee Salary Report.xml</url>
    </xml>
    /dataQuery>
    </dataTemplate>
    The problem is when i am trying to view the data, only data from SQL Query Q1 is getting displayed and the data from Employee xml is not at all getting displayed.
    Could anyone please let me know what i am missing?
    Thanks
    Nutan
    Edited by: user609971 on Oct 23, 2008 8:06 AM

    This is from Documenation sample....
    Did you see the data structure section, where you say, how you wanted the columns ?
    <?xml version="1.0" encoding="WINDOWS-1252" ?>
    <dataTemplate name="Employee Listing" description="List of Employees" v
    ersion="1.0">
    <parameters>- Defines a single parameter for the Department Number
    - with default of 20:
    <parameter name="p_DEPTNO" dataType="character"
    defaultValue="20"/>
    </parameters>
    <dataQuery>
    <sqlStatement name="Q1">
    <![CDATA[SELECT DEPTNO,DNAME,LOC from dept
                      order by deptno]]>
    </sqlStatement>
    <xml name="empxml" expressionPath=".//ROW[DEPTNO=$DEPTNO]"> - Defines name
    - and link to DEPTNO in Q1
    <url method="GET" realm="" username="" password="">
    file:///d:/dttest/employee.xml</url> - Defines url for xml data
    </xml>
    </dataQuery>-
    <dataStructure>- The following section specifies the XML hierarchy
    - for the returning data:
    <group name="G_DEPT" source="Q1"
    <element name="DEPT_NUMBER" value="DEPTNO" />
    <element name="DEPT_NAME" value="DNAME"/>
    - This creates a summary total at the department level based
    - on the salaries at the employee level for each department:      
    <element name="DEPTSAL" value="G_EMP.SALARY"
    function="SUM()"/>
              <element name="LOCATION" value="LOC" />
    <group name="G_EMP" source="empxml">
    <element name="EMPLOYEE_NUMBER" value="EMPNO" />
    <element name="NAME" value="ENAME"/>
    <element name="JOB" value="JOB" />
    <element name="MANAGER" value="MGR"/>
    <element name= "HIREDATE" value="HIREDATE"/>
    <element name="SALARY" value="SAL"/>
    </group>     
    </group>
    </dataStructure>
    </dataTemplate>

  • Manual Data binding with ADF table?

    Hi,
    I am making a stored procedure call for fetching data from database on the click of action button. My query has a where clause in it. I am not able to bind my adf table manually with my data control. Can anyone provide me some link for binding my ADF table with data control manually? My requirement is like : - I have one table in which I am displaying data in ADF table. I want to display data in another table on click of some id in the coulmn of first table.

    You basically have two options - you can choose to use ADF Binding - and have your Java class return a collection - then you just right click the class to expose it as an ADF Data control.
    Or if you rather not use ADF Binding, then you'll need to have a managed bean that returns a collection and you can use "regular" JSF binding to bind the table to it.
    The second option is shown in the ADF Faces Components demo: http://www.oracle.com/technology/products/adf/adffaces/11/doc/demo/adf_faces_rc_demo.html

  • Cfselect data binding with statically defined options

    I am having some trouble getting statically defined options
    to remain in my cfselects when I use binding in CF8
    I have four cfselects: Continent, Country, State/Province,
    County
    The continent select is populated by a list in a database,
    and each subsequent select is populated depending on the continent
    value (your run-of-the-mill related select box model).
    I have a form that allows a user to edit an existing record
    that uses these select boxes. The form is populated with data from
    that existing record - for example, a record in which
    Continent=North America, Country=United States, State=Montana, and
    County=Meagher
    The problem is that when I define a static option based on
    what's already in the database:
    <cfselect name="continentSelect"
    bind="cfc:CF_Classes.places.getContinents()" bindonload="true">
    <option value="#
    defined continent name#" selected="selected">
    defined continent name</option>
    </cfselect>
    the static option is displayed only momentarily while the
    query is running and then disappears completely from the box once
    the box is populated. I have got the option to stay when I turn
    "bindonload" off, but even then when I trigger the binding the
    option disappears. I have been able to get it to stay when I use
    the old method of defining a query to populate the box, but then I
    lose the binding ability in subsequent boxes so that options I
    don't want to show are displayed (i.e. something like
    Continent=North America, Country=Japan).
    Maybe there isn't a way around this, but there is an example
    of this type of thing in the CFML reference for CF8. I haven't
    tested it so I don't know if that one works or not. Am I missing
    something?

    Hi,
    There are a couple of ways you can do this. One is where the dropdown would change the presence of static text objects. The other would be where the dropdown would set the actual text within a textfield.
    Sample here: https://acrobat.com/#d=k2tAeWMsKS0pEbhmWt33oA
    Good luck,
    Niall

  • Problem socket.bind() with multiple modems and multiple IPs

    I've connected 2 or more modems in Windows control panel and made up windows dail ups. Then I dail up each modem and obtain the local DHCP IPs of each modem.
    My target is : to set up sockets using separate modems.
    the code is like: create a socket instance , and use Socket.bind()method to bind the socket to a specified modem's local IP , then do socket.connect().
    but the problem is : although there are several modem dail ups and at the same time I bind each socket to different IPs , the program always connect via the first modem dailed up.
    Does Socket.bind() method really bind the socket connection to the IP's or hardwares?

    I think you are trying to use a Socket where you want a ServerSocket to accept the incoming connection. Check this out (I have underlined what
    should interest you):
    public ServerSocket(int port, int queueLength) throws IOException, BindException
    This constructor creates a ServerSocket on the specified port with a queue length of your choosing. If the machine has multiple network interfaces or IP addresses, then it listens on this port on all those interfaces and IP addresses. The queueLength argument sets the length of the queue for incoming connection requests--that is, how many incoming connections can be stored at one time before the host starts refusing connections. Some operating systems have a maximum queue length, typically five. If you try to expand the queue past that maximum number, the maximum queue length is used instead. If you pass 0 for the port number, the system selects an available port.
    For example, to create a server socket on port 5,776 that would hold up to 100 incoming connection requests in the queue, you would write:
    try {
      ServerSocket httpd = new ServerSocket(5776, 100);
    catch (IOException e) {
      System.err.println(e);
    }The constructor throws an IOException (specifically, a BindException) if the socket cannot be created and bound to the requested port. An IOException when creating a ServerSocket almost always means one of two things. Either the specified port is already in use, or you do not have root privileges on Unix and you're trying to connect to a port from 1 to 1,023.
    So once you receive a connection, it looks like it is up to you parse any
    relevant info you want out of the Socket you get from ServerSocket.accept();
    -Cludge

  • Data binding with tableview: no data returned...

    Hi,
    I looked at the example BSP_MODEL and now I am trying to build a simple test application with a tableview.
    I can easily display data from my model in the tableview, but I can't get the modified data back to my model.
    I have implemented the method DO_HANDLE_DATA in the table's controller with the following code:<i>
      CALL METHOD super->do_handle_data
        EXPORTING
          form_fields     = form_fields
          global_messages = global_messages.</i>
    The DO_INIT method is like this:
    <i>m_model ?= create_model( model_id = 'm'
                             class_name = 'ZNP5' ).
    if m_model is bound.
      m_model->init( ).     "a simple select on SFLIGHT
    endif.</i>
    Obviously I missed something, any idea?
    Thanks for your help.
    Nicolas

    Hi Richard,
    Here are more details on my test application:
    Model:
    - Class Name: ZNP5, superclass: CL_BSP_MODEL
    - Attributes: FLIGHTS, Public, TYPE FLIGHTTAB
    - Method INIT, Public:
      SELECT * FROM sflight INTO TABLE flights.
    The BSP Applications consists of a main controller (main.do) and a subcontroller (table.do) calling views main.htm and table.htm.
    MAIN.DO:
    - DO_INIT method
      DATA: subc1 TYPE REF TO cl_bsp_controller2.
      subc1 ?=  create_controller( controller_name = 'table.do'
                                   controller_id   = 'subc1' ).
    - DO_REQUEST method
      DATA: view TYPE REF TO if_bsp_page.
      dispatch_input( ).
      view ?= create_view( view_name = 'main.htm' ).
      call_view( view ).
    TABLE .DO
    - Attributes: M_MODEL, Private, Type Ref To ZNP5
    - DO_INIT method
      m_model ?= create_model( model_id = 'm'
                               class_name = 'ZNP5' ).
      if m_model is bound.
        m_model->init( ).
      Endif.
    - DO_REQUEST method
      DATA: view TYPE REF TO if_bsp_page.
      view ?= create_view( view_name = 'table.htm' ).
      view->set_attribute( name = 'model' value = m_model ).
      call_view( view ).
    - DO_HANDLE_DATA method
      CALL METHOD super->do_handle_data
        EXPORTING
          form_fields     = form_fields
          global_messages = global_messages.
    main.htm
    <%@page language="abap" %>
    <%@extension name="htmlb" prefix="htmlb" %>
    <%@extension name="xhtmlb" prefix="xhtmlb" %>
    <%@extension name="bsp" prefix="bsp" %>
    <htmlb:content design="design2003" >
      <htmlb:page title=" " >
        <htmlb:form>
          <bsp:call comp_id="subc1" />
        </htmlb:form>
      </htmlb:page>
    </htmlb:content>
    table.htm
    Attributes: model Type ref to ZNP5
                SelectedRow type string
    <%@page language="abap" %>
    <%@extension name="htmlb" prefix="htmlb" %>
    <htmlb:tableView id               = "tvX"
                     headerText       = "Connections"
                     width            = "100"
                     headerVisible    = "true"
                     design           = "alternating"
                     visibleRowCount  = "8"
                     fillUpEmptyRows  = "true"
                     showNoMatchText  = "true"
                     filter           = "server"
                     sort             = "server"
                     onHeaderClick    = "MyEventHeaderClick"
                     onRowSelection   = "MyEventRowSelection"
                     selectionMode    = "LINEEDIT"
                     selectedRowIndex = "<%= selectedRow %>"
                     table            = "//model/flights"
                     tabIndexCell     = "true" />
    I've just discovered that the data is actually transfered to the model but it's not retained: When I edit the 1st line of the table, the modified values are transfered to the model, but if I edit the 2nd line, I loose the previous changes... How to solve this?
    Regards,
    Nicolas

  • Help for ADF data binding with MySQL BLOB type.

    Hi,
    I have a blob column called photo for table person in my MySQL database, with ADF, I want to bind this column with a JUImage control, but when I drag the column attribute from the data control palete as a JUImage, an error dialog appears, it says:
    Control cannot be bound to that Attribute.
    This control should be bound to an Attribute whose Java type is one of the following
    oracle.ord.im.OrdImageDomain
    oracle.jbo.domain.BlobDomain
    oracle.jbo.domain.Raw
    What should I do ?
    Thanks.

    Hi,
    Are you using BC4J as the persistence layer? If you use your own persistence (e.g. a bean) then you need to make sure the datatype of the atribute is defined as one of the three mentioned in your question.
    Frank

  • How do I use the High Speed Data Logger with multiple I/O devices?

    I am using the High Speed Data Logger vi to read from a 16 channel A/D card (NI PCI-MIO-16E). The project may require more than 16 channels. How can I use High Speed Data Logger to read from two A/D cards? Will it be able to write the data to one file?

    The High Speed Data Logger vi will not acquire and right to multiple DAQ boards at the same time without modification. LabVIEW is more than capable of doing this what you are trying to do, but you will have to modify the code.
    Regards,
    Anuj D.

  • Query with multiple filter

    Hi All,
    I need to write a query example
    SELECT 'INV', T0.DocDate, T0.CardCode, T0.CardName, T0.DocTotal FROM OINV T0
    WHERE T0.DocDate  BETWEEN '[%0]' AND '[%1]'
    UNION
    SELECT 'CN', T1.DocDate, T1.CardCode, T1.CardName, T1.DocTotal FROM ORIN T1
    WHERE T1.DocDate  BETWEEN '[%2]' AND '[%3]'
    But Actually i want to filter the Date is same. How can the query can help only filter one time only mean between date1 and date2,  and my query can filter all the invoice and CN between date1 and date2
    Please advised.
    Thanks

    Hi
    If you want to use the same criteria for date, you could use this query.
    /SELECT FROM [dbo].[OINV] T8/
    declare  @docdate as datetime
    /* WHERE */
    set @docdate = /* T8.DocDate */ '[%0]'
    /SELECT FROM [dbo].[ORDR] T9/
    declare  @docdate1 as datetime
    /* WHERE */
    set @docdate1 = /* T9.DocDate */ '[%1]'
    SELECT 'INV', T0.DocDate, T0.CardCode, T0.CardName, T0.DocTotal FROM OINV T0
    WHERE T0.DocDate BETWEEN @docdate AND @docdate1
    UNION
    SELECT 'CN', T1.DocDate, T1.CardCode, T1.CardName, T1.DocTotal FROM ORIN T1
    WHERE T1.DocDate BETWEEN @docdate AND @docdate1
    Regards,
    Vijay Kumar
    SAP Business One Forums Team

  • Problem in Data updation with multiple windows in JSF

    Hi,
    I am facing a problem whitle working in JSF. As per my project scenario I have a list page which shows list of entities. I can click on the id of the entity and open a new window containing the details of that particular entity. In that perticular window I have option to update the details of the entity. I can open as many windows as I wish (Every window opens the same JSP Page) and can update them at the same time.
    If I open 3 windows containing details of 3 entities and update them one by one by clicking on edit button and then update button, it will work fine for all 3 windows. But if I click edit in all 3 windows simultaneously then click update on each of them it will work fine for the first updated entity but for the next windows I am getting the same object as the object is not getting updated with new data in the request for particular entity.
    Can anyone please suggest me any solution.

    Hi Deepak,
    Good to hear that your first problem is solved. For the problem you are currently facing now, when ever some inbound request is stuck in either waiting or partial state any sync that you do from the client is useless because middleware doesn't accept any further inbound requests until and unless the previous requests which got stuck in either partial or waiting state move to either finished or ignore or error state.
    This problem could happen because of many reasons. One reason could be either that particular synbo is not active. If it is active and still the requests are stuck in partial state then the problem could be with middleware system i mean because of heavy load it will take some time to process the request or if the system goes down in middle of processing then it doesn't restart processing.
    So i would like you to check if all MAM syncbo's are active (status should be green). If you are sure that middleware system is also working fine then move that request to ignore state and then do a sync from client and check if the middleware processes the new requests.
    Even if the new requests are stuck in partial state then the only solution could be to reinstall the application on middleware.
    Regards,
    Siva.

  • Connecting to AOP data store with multiple NIC's

    I have a situation where I need to have the computer running Diadem to be connected to two different networks.  I have two NIC's installed in the machine, NIC A and NIC B, we will call them.  The reason for this, is that I am using Diadem to access an AOP server on an AVL PUMA machine.  If I connect PUMA to the LAN, PUMA occasionally crashes, probably something to do with the IP address.  So, PUMA needs to be on a network that does not have a router.  My diadem computer needs to communicate with PUMA, and with the local shared drives on our company network.
    Anyway, I have the company LAN hooked up on NIC A, and the PUMA network hooked up on NIC B.  Diadem fails to connect when both networks are connected, but connects to the data store no problem when only the PUMA network is hooked up. Any ideas how to fix this?  It seems diadem is looking at NIC A instead of NIC B, like it should be. 
    For reference, when both NIC's are hooked up, I can access share drives, and ping computers on both separate networks, without a problem, so it's not a connection issue.
    Any help would be appreciated.
    -Russ
    Solved!
    Go to Solution.

    I assume poth NIC have different IP range.
    - Did you use IP instead of server name.
    - Do you use RPC or CORBA to access the PUMA server?
    - Which DIAdem version.
    Can you create a logfile when the connection fails?
    Greetings
    Andreas

  • PerformancePoint - 2 scorecards from 2 data sources with 1 filter

    Hi,
    Please help…
    On PerformancePoint, I have created a dashboard which has 2 scorecards from 2 different data sources.  They are all connected to one common Member Selection filter, in this case Account Owners. 
    The issue is that, when you select ALL I get the below error, however when you select an Account Owner it works fine.  
    The Unattended Service Account "xxxxxx" does not have permissions to see this data. Additional details have been logged for your administrator.
    Can anyone advise on why this would be the case?
    Many thanks

    Hi FM
    Check if your Claims to Windows tike service is running in your farm, over CA Services Application you can find it, if yes, try to reconfigure your Secure Store Service for unattended account.
    Check this http://technet.microsoft.com/en-us/library/ee836145(v=office.15).aspx
    Let me know
    Ray Chapa

Maybe you are looking for

  • ALV Output need to send to Printer

    Hi Folks, I need to send the ALV output to the printer. I built the ALV in OOps. The printer button is enabled in the scrren and when I give print it is goint to dump Below I have pasted the dump. Help me to solve this. Points will be rewarded. Regar

  • Register for a firefox account to sync my computers?

    register for a firefox account to sync my computers, but I think I just did that when I had to create an account to ask this question, is that correct??

  • Sender Channel getting problem "RFCSenderR3 "

    Hello friends, In my XI  QA env...there is one service "RFCSenderR3" which is not showing any messages like in message monitoring ,but if i check in Communication channel CC monitoring for that service it shows as following error : Error* Sender chan

  • Prompts for Workspace Financial Report

    Hi, i am trying to open reports in workspace with prompts on it. I have security applied on the Entity dimension for different users. However when we try to open the reports, the prompt allows us to select any member of the entity irrespective of the

  • Is it possible to EXECUTE Recurring posting Automatically?

    Hi All, Currently in SAP B1, recurring posting are alerted when it becomes due. It could be monthly, weekly, daily etc. Is it possible to execute this recurring posting automatically on specific date instead of someone executing these postings manual