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: 

Defining filters for REUSE_ALV_GRID_DISPLAY_LVC

luis_rod
Participant
0 Kudos
394

Hi all,

I´m trying to define a filter in a report program using REUSE_ALV_GRID_DISPLAY_LVC. The filter is defined as:

gt_filter TYPE lvc_t_filt.

The ALV call is really simple:

  CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY_LVC'
    EXPORTING
      i_callback_program       = gv_repid
      i_callback_user_command  = 'USER_COMMAND'
      i_callback_pf_status_set = 'SET_PF_STATUS'
      is_layout_lvc            = w_layout
      it_fieldcat_lvc          = i_fieldcat
      it_filter_lvc            = gt_filter
    TABLES
      t_outtab                 = gt_alv
 

The problem is that, when I call the 'REUSE_ALV_GRID_DISPLAY_LVC' function, the program displays the filtered info correctly but every time the function is called the ALV grid “stack” grows, so I need to press F3 (Back) several times in order to return to the main Selection-screen screen.

How can I avoid this?

Any ideas?

TIA,

Luis

3 REPLIES 3

Eduardo-CE
Active Participant
0 Kudos
337

Hi,

Why not just fill gt_filter if it's empty?

Regards, Eduardo.

0 Kudos
337

Eduardo:

My apologies. When I wrote "defined" I meant the type of variable. GT_FILTER has values. After all, the data gets filtered properly. It´s something like this:

  gt_filter = VALUE #(
    ( fieldname = 'MTART'
      tabname   = 'MARA'
      sign     = 'I'
      option    = 'CP'
      low       = wa_ifields-value )
    ).

My problem is the "stacking" of the ALV.

0 Kudos
337

Hi Luis,

Could it be that you are constantly calling REUSE_ALV_GRID_DISPLAY_LVC?

Also, why not use ALV OO or CL_SALV_TABLE?