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: 

Count Rows In ALV

Former Member
0 Kudos

Dear Experts

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

Regards

1 ACCEPTED SOLUTION

rosenberg_eitan
Active Contributor
0 Kudos

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:

3 REPLIES 3

jogeswararao_kavala
Active Contributor
0 Kudos

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

0 Kudos

Thanks Jogewara

I did that and its working fine , but there is no standard class to display it in the footer line as aggregation

Regards

Ghadeer

rosenberg_eitan
Active Contributor
0 Kudos

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: