Skip to Content
author's profile photo Former Member
Former Member

Filtering a list

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?

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

5 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Jan 08, 2007 at 10:33 AM

    hi,

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

    sy-listi = sy-listy - 1.

    br

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 08, 2007 at 10:36 AM

    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

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 08, 2007 at 10:39 AM

    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

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 08, 2007 at 10:52 AM

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

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 08, 2007 at 11:00 AM

    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.

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.