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: 

ALV - from where can I retrieve the number of currently displayed entries

marcin_makowski
Explorer
0 Kudos

Dear experts,

I am using OO ALV in my application. I would like to display in list header, the number of currently DISPLAYED (not selected) entries. For example after usage of on screen filter with already selected values, when number of displayed entries is changed, I would like to refresh this value in list header.

Thanks in advance for your replies.

Marcin

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hello,

I think u caan do it using the foolowing FM..

REUSE_ALV_LIST_LAYOUT_INFO_GET Read current ALV list information

REUSE_ALV_LIST_LAYOUT_INFO_SET Set current ALV list information

If useful reward points.

Regards,

Vasanth

5 REPLIES 5

Former Member
0 Kudos

Hello,

I think u caan do it using the foolowing FM..

REUSE_ALV_LIST_LAYOUT_INFO_GET Read current ALV list information

REUSE_ALV_LIST_LAYOUT_INFO_SET Set current ALV list information

If useful reward points.

Regards,

Vasanth

0 Kudos

Hi,

Thanks for your hint. Do you know in which export parameter I can find the number of currently DISPLAYED values? Maybe you know some method of OO ALV with similar functionality, which can provide this information to me?

Best regards,

Marcin

0 Kudos

Hi,

Check this code to find the rows in ALV after filter method:

DATA : x_totrows type i,

x_filrows type i,

x_remrows type i.

if you are displaying the ALV with x_output internal table.

find the total rows like :

describe table x_output rows x_totrows.

use method 'get_filtered_entries' to send the filtered entries into a table.

DATA : x_fidx TYPE lvc_t_fidx.

FIELD-SYMBOLS: <pt> TYPE ANY.

DATA: x_fltr(10) TYPE n.

CALL METHOD x_grid->get_filtered_entries

IMPORTING

et_filtered_entries = x_fidx.

LOOP AT x_fidx ASSIGNING <pt>.

WRITE <pt> TO x_fltr.

MOVE x_fltr TO x_fix.

APPEND x_fix.

ENDLOOP.

find the count of the filtered entries

describe table x_fix rows x_filrows.

<b>remaining records will be</b>

x_remrows = x_totrows - x_filrows

Regards

Appana

0 Kudos

Guys,

thanks a lot for your quick answers. Points rewarded.

best regards

Marcin

Former Member
0 Kudos

You can call the method GET_FILTERED_ENTRIES which can give you the no. of rows filtered. Then you can get the total row count from the internal table that you are using for displaying the data. The total row count - filtered row count will be displayed row count.

You can get the row count of a internal table usine

DESCRIBE TABLE ITAB LINES W_COUNT.

Regards,

Ravi

Note : Please mark all the helpful answers