Alv filter.

I need to create a filter in my alv, so if a get a repeated value of a field in several rows, it'll only appear the value the first time, but the other values of the rest of columns will appear anyway. I need to do it by code. Can anybody help?

hi jose,
Use the Sort table
data : it_sort type table ot SLIS_T_SORTINFO_ALV with header line.
it_sort-fieldname = 'FIELD1'.
it_sort-up = 'X'.
append it_sort.
clear it_sort.
and pass this to the parameter IT_SORT  of FM REUSE_ALV_GRID_DISPLAY

Similar Messages

  • ALV Filter : Not working for a text field - Strange problem

    Dear All,
    I have a Z-program where the ALV filter is not working on a particular text field.
    The output on that text field is as below :
    ABCD
    JKLM
    YYZZ
    ABCD
    JKLM
    ABCD
    JKLM
    YYZZ
    YYZZ
    When we try to filter on YYZZ, it gives blank list. But for other options given abobe it works fine.
    I know it is because of the negative sign , but how can we over come this problem ?
    Thanks in advance,
    Sandip.

    Hi Sandip,
    Use 'LOWERCASE' in the fieldcatalog.
    For the particular text field when you are appending the Fieldcatalog structure to the Fieldcatalog Table
    ( Suppose LS_FIELDCAT)
    Then check the LOWERCASE field.
    (LS_FIELDCAT-LOWERCASE = 'X' )
    This will serve the purpose.
    Regards,
    Sourav

  • LED in field and traffic lights in ALV filter

    Hi experts,
    Am showing LED in field of ALV(OOPs oriented)and when i click on  ALV filter for led field..it shows me Traffic lights in poup for filter.Please help me to get LED in filter popup also.
    Thanks,
    Sajay.

    Solved

  • LED in field of ALV(OOPs oriented)- Traffic lights in ALV filter popup

    Hi experts,
    Am showing LED in field of ALV(OOPs oriented)and when i click on  ALV filter for led field..it shows me Traffic lights in poup for filter.Please help me to get LED in filter popup also.
    Thanks,
    Sajay.

    Hi,
    Use the fuction module 'ICON_CREATE' as follows.
    CALL FUNCTION 'ICON_CREATE'
        "To create Red/Yellow/Green traffic icons
          EXPORTING
            name   = wrk_light
          IMPORTING
            RESULT = ip_status.
    wrk_light can be;
    'ICON_RED_LIGHT'
    'ICON_YELLOW_LIGHT'
    or 'ICON_GREEN_LIGHT' according to your scenario, that you can use the logic for your scondition.
    Use it in PBO.
    Regards,
    Renjith Michael.

  • 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.

  • 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

  • ABAP WebDynpro ALV Filter Dropdown

    Hi guys,
    Is it possbile to do the dropdown list of alv filter?
    If so , how to do that?
    Thanks in advance.
    Best regards,
    Vincent

    Hello Lakshmi,
    I did as follows.
    1. Go to WDComponent.
    2. Add SALV_WD_TABLE as Component use at Used Components tab.
    3. Go to ViewController.
    4. Add SALV_WD_TABLE as used Component and used Interface at Properties tab.
    5. Map FILTER_VALUES node from used Component of ALV to Context of ViewController at Context tab.
    6. Code as follows.
      DATA lo_nd_filter_values TYPE REF TO if_wd_context_node.
      DATA ls_filter_values TYPE REF TO if_wd_context_element.
      DATA l_wdy_key_value_table TYPE TABLE OF wdy_key_value.
      DATA l_wdy_key_value TYPE wdy_key_value.
      lo_nd_filter_values = wd_context->get_child_node( name = wd_this->wdctx_filter_values ).
      ls_filter_values = lo_nd_filter_values->create_element( ).
      ls_filter_values->set_attribute(
        name = `FIELDNAME`
        value = `ATTR1`          "Attribute name that you want to set filter.
    *Followings are filter values.
      l_wdy_key_value-key = `0`.
      l_wdy_key_value-value = ``.
      APPEND l_wdy_key_value TO l_wdy_key_value_table.
      l_wdy_key_value-key = `1`.
      l_wdy_key_value-value = `AAAA`.
      APPEND l_wdy_key_value TO l_wdy_key_value_table.
      l_wdy_key_value-key = `2`.
      l_wdy_key_value-value = `BBBB`.
      APPEND l_wdy_key_value TO l_wdy_key_value_table.
      l_wdy_key_value-key = `3`.
      l_wdy_key_value-value = `CCCC`.
      APPEND l_wdy_key_value TO l_wdy_key_value_table.
      ls_filter_values->set_attribute(
        name = `T_DROPDOWN_VALUES`
        value = l_wdy_key_value_table
      lo_nd_filter_values->bind_element( new_item = ls_filter_values set_initial_elements = abap_false ).
    Regards,
    Masaaki YANOKUCHI
    Edited by: Masaaki Yanokuchi on Jan 26, 2010 10:35 AM

  • Webdynrpo ALV filter issue

    Hi All,
    In web dynpro ALV we have one column called Article . I am trying to find the article 661-2689 by using Standard SAP filter option but the Article is getting converted to 000000000000000661-000000000000002689 . This zero appending happens when I choose the Filter/ Press enter key . It does not find the article by using Filter option .
    Our system version is SAP_BASIS 700 . Please let me know if there is any solution to this ALV Filter issue .
    Thanks in advance,
    Kiran.

    Hi Kiran,
    It depends on the attribute's data element. If it's NUMC this property is automatically displayed in the context in the bottom panel labeled "Formatting".
    But if you are trying to do it whit Article i think the data element is MATNR of type CHAR, so this property will not be displayed.
    May be, you need to convert the value assigned to your filter field before to trigger the filter. I think you have created an action for the event "onFilter" in your table, so in this action before to do "wd_this->table_filter->apply_filter( )" maybe you need to use the FM CONVERSION_EXIT_ALPHA_OUTPUT in order to quit the leading zeros.

  • 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.

  • REgarding ALv filter

    hi
    Experts
    i devloped a report in  alv, it is sucess fully gives output..
    while   i  selected one column field ( material)
    and set filter .
    when  iam selecting one material to display .
    length of the   selected field is so small.
    example
    iam having material s ( MGHJ----1234UR, HFGR-2366,  HFRJRHDL-533 ) IN OUTPUT  FIELD CATELOG ..
    i am selecting mateial  colum and set the filter
    i want display only  mghj----123 material
    while   i am  giving material  in filter   , it length will be like mghj--
    i am unable to see the 123 by drag the legnth ..
    if i executed i did n't get anything..
    please give the   filter field r field catelog  field to display  correct length
    Regards
    Spandna
    Moderator message - Moved to the correct forum
    Edited by: Rob Burbank on May 21, 2009 9:09 AM

    Hi,
        Itu2019s Very simple there are many ways to solve this problem.
    1) if you are using OOPS ALV then use GET_FILTERED_ENTRIES method and read data accorind to   
        that index
          CALL METHOD G_GRID_REFERENCE->GET_FILTERED_ENTRIES
    2) simple way - just set the fieldcatlog outputlen same as Material characteristics
        Ex: - wa_fieldcat-outputlen = 15.
    Salil...

  • Problem in ALV Filter option

    Hi Experts,
    In the ALV output we are having fields like year,period and plant.If i click on Year or period or plant and then click on filter option in ALV it is giving a select option and then click on the F4 Help in the selection option,it is giving the list of option once i select any one of the value it is displaying(for eg:Year)  as '2004####'.Then if we click ok it is showing error instead of '2004####' it should be '2004' after selection.
    Is there any way to rectify this?????Please reply ASAP.
    Thanks
    Raj.

    Hi
    If it is YEAR (type is GJAHR) .... and passing the value as '2008'.
    Hi Guys,
    Did anyone come across this situation??
    Thanks
    Raj.

  • ALV filter problem

    Hi,
    I am facing a problem with the ALV grid. Recently our system got upgraded to ECC 5.0
    There is a column in the grid for displaying message texts.If i try to set a filter for the message text column,a popup comes as usual to select the values in the message column. In that popup, suppose a F4 help is taken, texts are getting truncated.
    Could you please suggest any OSS notes need to be added for this?
    Regards,
    Raju

    Hi,
    try to use EDIT_MASK for that field and see.
    you try this way..
    <b>
    Fieldcat-edit_mask = '==ALPHA'.</b>
    for the text field.
    Regards
    vijay

  • 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.

  • 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.

  • Problem with alv filter

    Hi all,
    I have a problem when i filter ALV column, which has data type  BELNR (FI doc No). I input in filter FI doc: 40000007 (8 char long, w/o zero ahead), then i get the empty result. The really one i want to get is a ALV line with FI doc = '40000007'.
    Could u pls help me?
    Thanks and regards,
    Hung.

    Check the field catalog for field BELNR, it should have conversion exit ALPHA. (check your report or execute [The Consistency Check|http://help.sap.com/saphelp_sm32/helpdata/EN/d6/23253963143e6ae10000000a11402f/frameset.htm])
    Regards,
    Raymond

Maybe you are looking for