Application Development and Automation 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:Ā 
Read only

How to get a default layout filter settings in to program.

Former Member
0 Likes
2,378

Hello Experts,

In my requirement let say the output has 100 records before displaying the ALV. During the default layout filter setting in the GUI for that report 5 records are getting filtered out and only 95 records are shown to the user. Is there a way to know to read the filter settings in the program so that I can display that 5 records out of 100 got filtered in the header portion of the report.

Thanks!

2 REPLIES 2
Read only

SwadhinGhatuary
Active Contributor
0 Likes
1,011

Hello Abaper,

you can set the filtering condition in program level.

declare

w_fil TYPE lvc_s_filt,

t_fil TYPE lvc_t_filt.

----------------------------------------------------------------------------------------------fill the field

w_fil-fieldname = 'CARRID'.  " ---->( Field name )

w_fil-sign = 'E'. " -->( Give sign E for excluding the set, I for including the set )

w_fil-option = 'BT'.  "----> ( Give 'EQ' for only single value , 'BT' for ranges )

w_fil-low = 'JL'. " ----> ( Mention value u want to exclude or include )

w_fil-high = 'LH'. "----> ( Mention value u want to exclude or include )

APPEND w_fil TO t_fil.

CLEAR w_fil.

w_fil-fieldname = 'CITYFROM'.

w_fil-sign = 'E'.

w_fil-option = 'EQ'.

w_fil-low = 'NEW YORK'.

APPEND w_fil TO t_fil.

CLEAR w_fil.

----------------------------------------------------------------------------------------------------------pass in alv

CALL METHOD r_alv_grid->set_table_for_first_display

EXPORTING

i_structure_name = 'FS' " -------->( Pass structure name )

is_layout = w_lay " ----> (Pass layout structure )

CHANGING

it_outtab = itab "----> (Pass internal table  which holds data )

it_fieldcatalog = t_cat  "----->( Pass field catalogue)

it_sort = t_sort " -----> ( Pass Sort internal table)

it_filter = t_fil "----> ( Pass filter internal table ).

for details  check below link

http://wiki.scn.sap.com/wiki/display/ABAP/Alv+with+sort+and+filter

hope you use oo alv report.

Hope this will Help you

Read only

Former Member
0 Likes
1,011

Hi Uday,

Check if you have set any ALV filters in your code while calling the ALV.

Or go to filters and see if any filter is active.

ALV call will not do any filtering unless its been explicity coded or set.

Debug your program to see if any other filtering in done on  your internal table.