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

ALV Records Count

I am using ABAP Objects ALV GRID. And I want to display the total number of record after I make the filtering to the list displayed in the ALV.

Is that possible? If yes how?

Add a comment
10|10000 characters needed characters exceeded

Related questions

3 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Oct 13, 2004 at 07:04 AM

    It's not an ALV standard function.

    If you want it, you have to program it yourself.

    You can add a new button for filtering and disable the standard button.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Oct 14, 2004 at 04:21 PM

    Hi,

    Just add a new field to your ALV list and put 1 on every line. The totals line will give number of records displayed after filtering.

    Raj

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Oct 15, 2004 at 08:29 AM

    If you use the method "get_filtered_entries" you get all entries that the standard ALV filter hides.

    If you substract the number of entries in this table from your total number of records (i.e. using describe table or similar) you will get your number of displayed entries.

    CALL METHOD <ref.var. to

    CL_GUI_ALV_GRID>->get_filtered_entries

    IMPORTING ET_FILTERED_ENTRIES =

    <internal table of type LVC_T_FIDX>.

    Add a comment
    10|10000 characters needed characters exceeded

    • Hi Ulrich

      <b><u>e.g.</u></b>

      DATA lt_filtered_entries TYPE LVC_T_FIDX .
      CALL METHOD gr_alvgrid->get_filtered_entries
        IMPORTING
           ET_FILTERED_ENTRIES = lt_filtered_entries . 

      OR

      DATA lt_filtered_entries TYPE LVC_T_FIDX 
           WITH HEADER LINE .
      CALL METHOD gr_alvgrid->get_filtered_entries
        IMPORTING
           ET_FILTERED_ENTRIES = lt_filtered_entries[] . 

      *--Serdar

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.