09-01-2005 5:43 AM
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.
09-01-2005 5:47 AM
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
09-01-2005 5:56 AM
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
03-16-2006 10:59 PM
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?