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: 

total no of pages in the end of list in alv

Former Member
0 Kudos

Hi all,

Not able to get the total no of pages in alv through end_of_ list event .

plz go through my code :

FORM alv_event_end_of_list .

DATA: x_footer TYPE slis_listheader.

  • Page Number

CLEAR x_footer.

x_footer-typ = 'S'.

x_footer-key = 'End of List'.

x_footer-info = sy-pagno.

APPEND x_footer TO gt_footer.

CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'

EXPORTING

it_list_commentary = gt_footer

  • I_LOGO = <<If you want to set a logo, please,

  • uncomment and edit this line>>

  • I_END_OF_LIST_GRID = 'X'

  • I_ALV_FORM =

.

ENDFORM. " ALV_EVENT_END_OF_LIST

cheers,

sravan.

2 REPLIES 2

former_member156446
Active Contributor
0 Kudos

To use from the beginning of your report, you will have to loop through your report once before display. ABAP does not provide

an easy "read-ahead" method of doing this, so this is the "cludgy" way of making it work if needed.

FORM GET_TOTAL_PAGENO.

WRITE SY-PAGNO TO NUM_PAGES_C LEFT-JUSTIFIED.

DO SY-PAGNO TIMES.

READ LINE 2 OF PAGE SY-INDEX.

REPLACE '*****' WITH NUM_PAGES_C INTO SY-LISEL.

MODIFY LINE 2 OF PAGE SY-INDEX.

ENDDO.

ENDFORM. " GET_TOTAL_PAGENO

Former Member
0 Kudos

hi Sravan,

check it.

saptechnical.com/Tutorials/ALV/PageNumbers/Demo.htm

hope it may help you.

thanks

Sachin