Restrict ALV filter criteria like with MF SELECT_OPTIONS_RESTRICT

Hi all,
I would like to be able to manage my ALV OO filters.
The aim is to force the user to use the pattern option (CP) when they want to filter on a specific field of the ALV.
It would be great if there was a mean to get the same result as the MF SELECT_OPTIONS_RESTRICT for Select-option. ( = Only Pattern is available when the user tries to filter on this specific field)
I'm able to user get_criteria/set_criteria to do so, but the result is not as OK as I want, because the filter are modified after the user action => the user wont understand what happened...
Does anyone know about how to get the result I want?
Thanks and regards,
Christophe Drancourt

Hi Christophe,
for manage Filter after User Input you can use Event AFTER_USER_COMMAND:
methods EVENT_AFTER_USER_COMMAND
     for event AFTER_USER_COMMAND of CL_GUI_ALV_GRID
     importing
       !E_UCOMM
       !SENDER .
In method:
METHOD EVENT_AFTER_USER_COMMAND.
DATA ltb_filter TYPE LVC_T_FILT
   CASE e_ucomm.
     WHEN cl_gui_alv_grid=>mc_mb_filter.
           CALL METHOD sender->get_filter_criteria IMPORTING et_filter = ltb_filter.
*Here Manage the Filter
           CALL METHOD sender->set_filter_criteria EXPORTING it_filter = ltb_filter.
           CALL METHOD sender->refresh_table_display.
       ENDCASE.
   ENDCASE.
ENDMETHOD.
Regards,
Angelo.

Similar Messages

  • ALV Filter criteria

    Hello,
        I have define a list using ALV functions.
        When I am using it I select 4 columns and push the filter button but in the filter window only appears the first column selected as a criteria.
        What do I have to do in order to appear the four?
    Thank you

    Hi,
    Pass  i_save parameter in the ALV
    g_layout-cwidth_opt = 'X'.                 " Optimize columns to data
      g_layout-sel_mode   = 'A'.                  " Column & ROW selections  -- Pass this and try
      g_layout-zebra      = 'X'.
    *  Calling method to display data.
        CALL METHOD g_alv_grid->set_table_for_first_display
          EXPORTING
            is_layout       = g_layout
            i_save          = 'A'
          CHANGING
            it_fieldcatalog = i_fieldcat
            it_outtab       = i_psummary.

  • Filter criteria in ALV report not working

    Hi,
    In ALV report , when i click on filter button , it does not filter the report according to the filtered criteria. this happens in the cases where the selection criteria is a lengthy field. when i debug after the filter criteria it goes into standard function.
    i am using REUSE_ALV_GRID_DISPLAY
    is there any way in which i can correct this?
    thanks,
    Amit
    null

    chk this useful thread
    Re: ALV problem (with filter use)

  • Filter Criteria with where condition in graph api query

    Hi
    Filter criteria in  graph api is  working fine  through this api
    https://graph.windows.net/adummydirectory.onmicrosoft.com/users?$filter=displayName eq 'Ashok'&api-version=1.5
    Select criteria is also working fine through this api
    https://graph.windows.net/ adummydirectory.onmicrosoft.com/users?api-version=1.5&deltaLink=&$select=displayName,accountEnabled
    But when I am combining both query that means, I want that select criteria should also apply with filter clause like
    https://graph.windows.net/adummydirectory.onmicrosoft.com/users?$filter=displayName
    eq 'Ashok'&api-version=1.5&deltaLink=&$select=displayName,accountEnabled
    But its generating error
        "odata.error": {
            "code": "Request_UnsupportedQuery",
            "message": {
                "lang": "en",
                "value": "Unsupported expression node type 'Equal' for Where expression."
    So please suggest how we can use select clause with filter criteria. our requirement is that we don’t need all attributes .we want selected attributes for filtered users.

    Greetings!
    The differential query syntax does not allow for a filter other than $filter=isof(<directory entry type>).  You are not able to use any other query string for this type of query.  Please see the following MSDN link for details:
    http://msdn.microsoft.com/en-us/library/azure/jj836245.aspx
    I will need to do a bit more research to see if it is possible to request specific attributes for an object query and post back to this thread when I have a response.
    Regards,
    MaxV ( MSFT )

  • Set Filter Criteria Fields for ALV

    Hi everyone!
    Is there a way in ALV that you can set the filtering criteria fields for your ALV report, but not the field values itself?
    To be more clear (I hope), When you run the ALV report, it initially shows you the entire report, but when you click on the FILTER button, there are already pre-selected fields for the filter criteria.
    Thanks a lot.. points for any useful answer.

    Hi,
    Yes you can do with Layout button in the application tool bar.
    First filter out the columns and save it with name.
    Everytime you execute the program,click the layout button and select the layout variant .
    regards,
    Maha

  • Issues with Search Filter Criteria Button in Search Help

    Hi ,
    I have applied an elementary search help to a select option and this help is having four fields. The search help works fne and all the four fields are visible when i do a F4. Now , if i want to restrict the number of entries shown (the number of entries are huge) by clicking the "Search Filter Criteria" button , i dont see any of the four fields using which i can restrict the data . Do we need to do any configuration for this ??
    Regards
    Mayank

    Hi,
    in that search help itself you have a option called maximum number of hits, there is a impact if you restricted also.
    Thanks & Regards,
    Srinivasan.R

  • Problem with ALV filter functionality when filtered for multiple values

    Hi,
    I am facing a problem with ALV filter functionality.
    I have displayed an ALV with some columns col_A, col_B and col_C
    col_A---- col_B -
    col_C
    1----
    a -
    abc
    2----
    b -
    pqr
    3----
    c -
    lmn
    4----
    d -
    xyz
    5----
    f -
    stu
    From the settings link I am applying filter on column col_C and selected multiple values say 'pqr', 'xyz' and 'lmn'.
    Now the ALV is showing rows only for last selection i.e . results are fetched only for value 'lmn'.
    i.e. after applying the filter the ALV table looks as below:
    col_A---- col_B -
    col_C
    3----
    c -
    lmn
    But ideally it should be:
    col_A---- col_B -
    col_C
    2----
    b -
    pqr
    3----
    c -
    lmn
    4----
    d -
    xyz
    I could not find any OSS note related to this issue.
    Please help me resolve this issue.
    Thanks,
    Feroz

    Hi,
    I am facing a problem with ALV filter functionality.
    I have displayed an ALV with some columns col_A, col_B and col_C
    col_A---- col_B -
    col_C
    1----
    a -
    abc
    2----
    b -
    pqr
    3----
    c -
    lmn
    4----
    d -
    xyz
    5----
    f -
    stu
    From the settings link I am applying filter on column col_C and selected multiple values say 'pqr', 'xyz' and 'lmn'.
    Now the ALV is showing rows only for last selection i.e . results are fetched only for value 'lmn'.
    i.e. after applying the filter the ALV table looks as below:
    col_A---- col_B -
    col_C
    3----
    c -
    lmn
    But ideally it should be:
    col_A---- col_B -
    col_C
    2----
    b -
    pqr
    3----
    c -
    lmn
    4----
    d -
    xyz
    I could not find any OSS note related to this issue.
    Please help me resolve this issue.
    Thanks,
    Feroz

  • ALV filter with own logic

    Hello colleagues out there,
    I have a request from my users concerning ALV filtering. They want to have filters of the kind :
    - A = 5 or B = 6
    - A + B > C
    (A, B, C Columns of the table)
    Surely I can implement such rules "hard" coded in the ABAP. But my question is: Is there are more generic way, that allows the users to define their filter rules themselves without having to modify my programs ?
    Many thanky for your help
    Rabanus Diehl

    Hi rabanus,
    1.  A = 5  can be done
        B = 6 can be done
    but OR conditions, between two fields cannot be done,
    in standard alv filter functionality.
    2.  A + B > C
       cannot be done,
      bcos it allows filter only one one field, by one field,
      not
      using some expressions/equations.
    regards,
    amit m.

  • Set filter criteria on page 1 for page 2 OData model - "best practice"?

    Hello, I have a problem with an app - where I want to filter data on a second page, based on settings from the first page. I use an OData model.
    The collections on both pages are not related in terms of "navigation" properties, that is my problem and I can not change the data source...
    So I am looking for ideas/best practices to solve this because sometimes my filtering doesn't work... the following problem occurred: Request aborted
    I have a page with a sap.m List with items="{/tabWorkPlace}" and and a local JSON model where I store relevant data during the app lifecycle.
    handleListSelect - first page
    var context = evt.getParameter("listItem").getBindingContext();
    var dataModel = sap.ui.getCore().getModel("dataModel");
    var workplace = context.getProperty("WORKPLACE_ID");
    dataModel.setProperty("/WORKPLACE_ID", workplace);
    this.nav.to("SubMaster", context);
    The general App.controller.js handles the nav.to function:
    var app = this.getView().app;
    var page = app.getPage(pageId);
    if(pageId == "secondPage") {
         page.getController().filterData();
    And the controller of the second page:
    filterData: function() {
    var oModel = sap.ui.getCore().getModel("odata");
    var dataModel = sap.ui.getCore().getModel("dataModel");
    var workplace = dataModel.getProperty("/WORKPLACE_ID");
    var items = this.getView().byId("list");
    var oFilter=new sap.ui.model.Filter("WORKPLACE_ID",sap.ui.model.FilterOperator.EQ,workplace);
    items.getBinding("items").filter(oFilter);
    I don't write this code into the onInit() or beforeRendering() function, because they are called only once and I am navigating back and forth between the two pages, because the pages are created only once and "just" the data is changed.
    The desired page looks like this - with an other collection bound to it:
    <List
      id="list"
      select="handleListSelect"
      items="{/tabWorkstep_Status}"
    >
    But when I call it - then the request gets aborted:
    The following problem occurred: Request aborted
    But despite the fact the Request is aborted, the list on the second page is filtered!
    The filter criteria for the model works when I type it into the browser with URL. Maybe this fails because the data binding for the list didn't took place at this phase?
    I have this pattern (filter criteria on one page and result on the second page) more times - (and I think a better data model would be better with navigation properties would be better, but I cannot change it)
    But at another constellation the filtering doesn't work - same error... the following problem occurred: Request aborted
    I also don't want to change the pattern (page 1 to page 2) into popup lists or this fancy new filtering possibilities because it is not suitable for my use case.
    Is there maybe a more elegant solution - because sometimes filtering works, sometimes don't..., do I have an error in my solution (general approach)?
    Many thanks for any input!
    BR,
    Denise

    Hello, yeah you are right, but it works without the odata> stuff because of this in App.controller.js:
    var uri = "http://localhost:32006/JsonOdataService.svc";
    var oModelMS = new sap.ui.model.odata.ODataModel(uri);
    sap.ui.getCore().setModel(oModelMS, "odata");
    oView.setModel(oModelMS);
    So my question is - how to navigate from one page to another - and on the other page first bind a collection to a select and then when selecting bind certain elements (a textfield) to the selected filtered entity.
    The stuff with context and binding won't work, because the two Collections don't have a navigation/association property between them...
    So for example:
    page1
    select a list item with property color: red and year 1985. Press one of the buttons and pass this criteria to another page.
    page 2:
    show a dropdown box with all car names which fullfill this criteria, and when one car is selected, then display the data for THIS car in several text fields.
    This is not a master->detail navigation example, because on page 1 i select certain criterias, and then with buttons I navigate to several pages with those criterias.
    But since the OData model has no relationships it is really hard to do it manually... With a dummy mock.json like in DJ Adams Fiori like SAPUI5 apps it is no problem... But with OData and no things related to each other it is hard...

  • Middleware-Filter criteria for Transactions replication.

    Hi Experts,
    Can we use filter criteria while transferring transactional data from CRM to R/3.
    Like i want to restrict the replication of transactions of some BP's who belongs to one particular region. Based on the region field can i put the filter criteria for the transactions.
    Points will be rewarded.
    Thanks in advance
    Nadh.

    Hi Nadh,
    I dont think if it will work. As this object is used for BulK messaging, hence you will not be able to create filters.
    Regards
    Keshav
    PS: Please reward point if the info is useful.

  • ALV filter- In activate case Sensitive nature

    Dear experts,
    I have z report with standard ALV filter and when I try to filter text column and itu2019s did not work. I know this happens because of case sensitive nature of filter. Could u pls help me how to inactivate case sensitive nature of the ALV filter
    Thank you & Best Regards
    Sameera

    Sameera,
    You can use lowercase flag on fieldcat:
    DATA: it_fieldcat     TYPE slis_t_fieldcat_alv,
    FORM monta_layout_alv.
      DATA: la_fieldcat LIKE LINE OF it_fieldcat.
      CLEAR: la_fieldcat.
      la_fieldcat-fieldname   = 'DESC_MOD'.
      la_fieldcat-tabname     = 'IT_SAIDA'.
      la_fieldcat-seltext_m   = 'Modalidade'(804).
      la_fieldcat-lowercase   = 'X'.
      APPEND la_fieldcat TO it_fieldcat.

  • Retrieving sort and filter criteria for interactive report

    I have developed a test management system in APEX. Users log in and see an interactive report with their assignments. Each test they've been assigned occupies one row.
    There is an "Execute" link for each row that takes the user to the test execution page, where they can see the input steps / expected results and report the test passing or failing.
    I've implemented "Next >" and "< Previous" buttons on the execution page, so the user can immediately go forwards or backwards in his assigned tests without having to return to the assignments page and click the Execute link on the next or previous row.
    The test execution page figures out what the next and previous assigned test is using the LAG and LEAD functions, like this:
    lag(assignment_id) over (order by ref_num_full) prev_id,
    lead(assignment_id) over (order by ref_num_full) next_id
    Notice that I've "hardcoded" the over clause to be the reference number of the test.
    The problem here - this solution ignores any custom sorts or filters the user has put in place on the assignments (interactive) report.
    Is there a way I can "grab" the interactive report (1) sort criteria and (2) filter criteria dynamically? I'm thinking I could then use dynamic SQL to build an OVER clause used in the lag/lead calls so that the application now follows whatever sort and/or filter criteria the user has put in place.
    Any help is greatly appreciated...thanks!!

    Thanks WTine!
    I took a look and determined
    - I can get the sort criteria from the APEX_APPLICATION_PAGE_IR_RPT view (SORT_COLUMN_# and SORT_DIRECTION_# columns)
    - I can get the filter criteria from the APEX_APPLICATION_PAGE_IR_COND view
    Regards, Rich

  • ADR/Software Updates - Filter Criteria on title string

    Hello,
    i want to filter software updates in the "all software updates" list or in an automatic deployment rule.
    let's start with the all software updates list. example, i want all win7 updates 64bit, but no media center updates
    a logical query would be:
    Product: Windows 7
    Title: contains "x64" AND does not contain "Media Center"
    this seems to be impossile in the SCCM2012 interface as i can't change "OR" to "AND", so i am stuck with "title contains x64 or does not contain media". naturally, all available updates fall in this search criteria, making it useless.
    is there a solution for this?
    second try, this time in an automatic deployment rule - here i have more options, as i can add several query strings to the list. the informational message states that strings can be put in quotes for exact matches, and prefixed with
    a minus symbol for exclusions. so an example filter criteria to get all x86 windows 7 updates EXCLUDING internet explorer 8 and 9 patches would look like:
    again, this does not work - the result includes all x64 updates for win7, completely ignoring my -"x64" statement, it also includes all IE8 updates - no idea how this criteria is translated in the background to an sql query, in any case, it fails to give
    me the result i want.
    is there any solution for this?

    unfortunately, even question 2 is not fully solved.
    the filter strings i can put for title filtering are all combined with OR and this is a problem.
    e.g. i want to show only .net framework updates for x64 systems.
    when i put these filters:
    x64
    -Beta
    Microsoft .NET Framework
    i get "x64 OR -Beta OR Microsoft .NET Framework" resulting in a list that contains all x64 .net AND windows 7 updates
    when i put these filters:
    x64
    -Beta
    -Microsoft .NET Framework
    i get "x64 OR -Beta OR -Microsoft .NET Framework" resulting in only x64 windows 7 updates
    when i use these filters:
    -Beta
    Microsoft .NET Framework % x64
    i get "-Beta OR Microsoft .NET Framework % x64" resulting in what i want (all .net updates for x64 systems)
    so yes, i found a way to put the filters how i want them, but not beeing able to change the AND and ORs in the query, and the confusing way the negation sign is working in OR statements, make it a bit frustrating. and if the % wildcard wouldn't work i would
    be without a solution at all.

  • Extend filter criterias in: MDS_LOAD_COCKPIT

    Hello experts,
    I'm using mds_load_cockpit for massdata replication in one-client scenario (SRM@ERP) - replication tests were successful (vendors and materials). Now I'd like to use filter criterias to get the desired vendors and material ranges because I'dont want all vendors or materials to be replicated.
    My first step was using the listed filters (listed as "fieldnames") in mds_load_cockpit.
    But there are only a few fields available which set the criterias:
    -Vendors: Account Group, VendorID, Centr.Del Flag
    -Materials: DF at client level, mat.group, mat.ID, mat.type
    These don't fit my filter requests...
    Is there there any way to extend these criterias?
    For example like in transaction R3AC1 (which i cannot use in one-client-scenario) for "r/3 material master".
    I'd like to use this for materials--> Table: MARA-MAGRV
    For vendors i'd like to make a limitation on purchsing org, but I dont know how to do this.
    Any suggestions how to proceed? Maybe there is a table where I can maintain/create new entries for my own crits listed as "Filedname" in mds_load_cockpit for filtering.
    Could anyone give me a hint?
    BR, Patrick

    hi
    i have a big problem during using mds_load_cockpit
    when i click on product category->material group and un select backround proccess and execute the transaction i have terminated in program
    Category               ABAP Programming Error
    Runtime Errors         MESSAGE_TYPE_X
    ABAP Program           SAPLMDS_LOAD_BRIDGES
    Application Component  AP-MD-BF-SYN
    Date and Time          10.06.2014 09:39:47
    Short text
         The current application triggered a termination with a short dump.
    What happened?
         The current application program detected a situation which really
         should not occur. Therefore, a termination with a short dump was
         triggered on purpose by the key word MESSAGE (type X).
    Error analysis
         Short text of error message:
         Long text of error message:
         Technical information about the message:
         Message class....... "MSI_PRODCAT_CUST"
         Number.............. 303
         Variable 1.......... 1
         Variable 2.......... 432339
         Variable 3.......... " "
         Variable 4.......... " "

  • Adding "Filter Criteria" to the XSLT List View Web Part impact on "Export to Excel" functionality within Document Library

    Hi there,
    XSLT List View displaying all the list items within the Document Library. In order to implement the Search functionality within Document library out of box "Text Filter" web part is configured as explained below. The solution is similar to
    the one suggested at
    http://www.wonderlaura.com/Lists/Posts/Post.aspx?ID=77
    "Text Filter" Web Part added to the page.
    Filter Criteria (i.e., XSLT List View columns) added to the XSLT List View where the filter parameters take the input from the "Text Filter" Web Part .
      3. Both Web Parts (XSLT List View and the Text Filter) are connected.
    When the search criteria is entered into the "Text Filter" Web Part, it is passed to the relevant Columns of the XSLT List View and the documents (List Items) that match the search criteria are shown within XSLT List View.
    Search functionality working as expected.
    Query: Selecting the "Export to Excel" icon from the ribbon generates the excel spread sheet with no data except Column Titles from the Document library. In the investigation it is
    found that adding the 'Filter Criteria' on XSLT List View is causing this bug. When the Filter Criteria is removed, then "Export to Excel" functionality is working as expected.
    But it is mandatory to add "Filter Criteria" to implement the search functionality with in the document library.
    Help: Help/input appreciated on the work around to get the "Export to Excel" functionality work when the "Filter Criteria"
    exist on the XSLT List View.
    Regards,

    Once again thanks very much for your help Scott. very much appreciated.
    In the investigation it is found that removing the 'Filter Criteria' on XSLT List View makes the "Export to Excel" functionality work. But the 'Filter Criteria' is mandatory to get the 'Document Search' functionality.
    I think that due to technical limitations it should be concluded that 'only custom development can make all work, no code solutions using the SharePoint Designer can meet all the requirements.
    If you can think of any alternative solution that could help in resolving the current issue or fix the issue without any custom implementation please inform. Otherwise this issue would be marked as resolved with your suggested response.
    Regards,

Maybe you are looking for