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: 

Filtering a list

Former Member
0 Kudos

I have an output list displayed to screen. I wish to filter the displayed output depending on a set of rules entered by the user.

For example

Person Name date of birth

Smith 1.12.1979

Jones 15.12.1979

Doe 22.6.1980

A user wishes to redisplay the list showing all those born during 1979. Simply re-outputting does not work as the original list still sits below. I somehow need to clear the original list before re-outputting. I know ALV gives me this facility, but in this case ALV is not an option. Any suggestions?

5 REPLIES 5

Former Member
0 Kudos

hi,

before outputing the new list set the system field sy-listi:

sy-listi = sy-listy - 1.

br

Former Member
0 Kudos

Hi

U can insert a filter button, this filter should be a popup showing a ranges (select-options) with all fields you display in the screen.

The ruotine to display the data should be like this:

LOOP AT ITAB WHERE (FILTER).

ENDLOOP.

In this way if the filter isn't setted all data will be printed else only the data in according to the filter.

The routine to be listed the data should be called every times the data are re-displayed.

Max

Former Member
0 Kudos

here you have to go for interactive reporting give the hotspot to your date of birth field.

after writing the fields in the basic list use hide itab-dob.

now

at line-selection

data : year(5).

year = itab-dob(4).

concatenate year '%' into year

refresh itab.

select f1 f2 from dbtab into table itab where dob like year.

sy-lsind = 0.

loop at itab.

write : / itab....

endloop.

regards

shiba dutta

Former Member
0 Kudos

now, move contents to temp internal table. refresh original internal table. move contents from temp table based on filter.

Former Member
0 Kudos

Thanks all,

Shiba, unfortunately my user do not want to use hotspots. However, combining bits of all suggestions has given me the solution I was looking for. Thanks.