Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

ALV Grid Filter

Former Member
0 Kudos

Hi,

i tried to send a filter options to alv grid with 'it_filter' but it didn't work.

can somebody help me pls?

Thanks,

my code is

data:
      gt_filter   TYPE LVC_T_FILT     ,
      gs_filter   TYPE LVC_s_FILT     .
.....
    gs_filter-fieldname  = 'VBELN' .
    gs_filter-sign       = 'E'     .
    gs_filter-option     = 'BT'    .
    gs_filter-low        = '0000000001'     .
    gs_filter-high       = '0000000003'     .
    APPEND gs_filter TO gt_filter  .

..........

  call method gr_alvgrid->set_table_for_first_display
    exporting
      is_variant           = variante
      i_save               = 'X'
      i_default            = 'X'
      is_layout            = gs_layout
*        it_toolbar_excluding = lt_excl_func
    changing
      it_outtab            = table
      it_fieldcatalog      = fcat
      IT_FILTER            = gt_filter[]
.

7 REPLIES 7

former_member188685
Active Contributor
0 Kudos

from your code i can see one thing the layout variant(default one) may be overriding the filter settings. do you have any Default variant ..? try to comment that i_default = 'X'

call method gr_alvgrid->set_table_for_first_display
    exporting
     " is_variant           = variante "remove these three 
     " i_save               = 'X'
     " i_default            = 'X'
      is_layout            = gs_layout
*        it_toolbar_excluding = lt_excl_func
    changing
      it_outtab            = table
      it_fieldcatalog      = fcat
      IT_FILTER            = gt_filter[]

0 Kudos

Thank you Vijay,

it worked now. i must send a variant to alv grid, what can i do ?

thanks again.

0 Kudos

Variant is especially for displaying the columns the way we want. if you want both then you have to create a variant considering the Filter also. so try create a variant which holds the filter data also. then see.

i tested from my end. it is working fine.

0 Kudos

Vijay, Thanks again.

is there another way to do it ?

0 Kudos

I don't think you can do it other than including the Filter , and creating the variant. Since you need both at a time.

0 Kudos

Okay Vijay, Thank you very much.

Former Member
0 Kudos

solved