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

Count Rows In ALV

Dear Experts

Kindly is there class to add count of column at the ALV footer as cl_salv_aggregations ?

Regards

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • Best Answer
    Posted on Aug 30, 2015 at 08:14 AM

    Hi,

    If you refer to cl_salv_table .

    DATA: ob_salv_table TYPE REF TO cl_salv_table .

    In the output table define:

    TYPES: count TYPE sysrows .

    At pbo:

    DATA: ob_salv_columns TYPE REF TO cl_salv_columns_table .

    ob_salv_columns = ob_salv_table->get_columns( ) .

    ob_salv_columns->set_count_column( 'COUNT' ).

    Regards.

    Output:


    pastedImage_2.png (119.6 kB)
    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Aug 30, 2015 at 08:05 AM

    Hello Ghadeer,

    I always do like this:

    DATA: ld_lines TYPE i,

    ld_linesc(10) TYPE c.


    DESCRIBE TABLE it_out LINES ld_lines.

    ld_linesc = ld_lines.

    CONCATENATE ld_linesc 'Rows selected.' INTO msg SEPARATED BY space.

    The above code is at the end of select query and before start of Filed catalogs form.(it_out is the final internal table) . And just before then end of field catalog form put this code

    FORM fill_field_cat.

    .......................

    ......................

    ......................

    MESSAGE msg TYPE 'S'.

    ENDFORM.

    This displays the number of Rows in the status bar of the ALV.

    Hope this helps

    KJogeswaraRao

    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.