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: 

Report programming.

Former Member
0 Kudos

Hi!

Can anyone please tell as to whether it is possible to have filters in SAP reports on individual columns similar to excel. And is this possible in ALV GRIDs.

Thanks,

SuB.

3 REPLIES 3

Former Member
0 Kudos

Hope it is possible. But u have keep filter icon in tool bar and have to code the entire logic based on the operation of icon.

regards

gv

Former Member
0 Kudos

Hi,

Filtering is possible in ALV Grids.

Filtering:

The procedure is like the one in sorting. Here, the type of the table you must fill is LVC_T_FILT. Filling this table is similar to filling a RANGES variable.

Preparing the table for filter settings

DATA:pt_filt TYPE lvc_t_filt.

DATA: ls_filt TYPE lvc_s_filt .

ls_filt-fieldname = 'FLDATE' .

ls_filt-sign = 'E' .

ls_filt-option = 'BT' .

ls_filt-low = '20030101' .

ls_filt-high = '20031231' .

APPEND ls_filt TO pt_filt .

Pass pt_filt Filter Table to the ALV Grid Display.

CALL METHOD gr_alvgrid->set_table_for_first_display

EXPORTING

I_DEFAULT = 'X'

is_layout = gs_layout

CHANGING it_outtab = gt_list[]

it_fieldcatalog = gt_fieldcat

  • IT_SORT =

IT_FILTER = pt_filt

EXCEPTIONS

invalid_parameter_combination = 1

program_error = 2

too_many_lines = 3

OTHERS = 4 .

You can get and set filtering criteria applied whenever you want by using methods GET_FILTER_CRITERIA and SET_FILTER_CRITERIA, respectively.

Hope This helps u.

Thanks&Regards,

Ruthra.R

Message was edited by: Ruthra

Message was edited by: Ruthra

0 Kudos

Ruthra,

Could you please tell me if I am passing a dynamic table, can I still use the IT_FILTER? I am trying and it does not seem to have any effect on the output?