Page numbers in report output lists
This is an old tip which is used for showing the total page number in all the pages, say in the format Page X of Y.
This is an old tip which is used for showing the total page number in all the pages, say in the format Page X of Y.
The code was written in 3.1H and has been successfully used up until 4.6C.
* Write this line in Top-of-page event write : /50(3) sy-pagno, 'of', '***' right-justified. * Call this form from the start-of-selection or End-of-selection event AFTER completing all the writing all the output. I.e, this form should be called at the end. perform display_total_page_no. *&---------------------------------------------------------------------* *& Form display_total_page_no *&---------------------------------------------------------------------* * text *----------------------------------------------------------------------* * --> p1 text * <-- p2 text *----------------------------------------------------------------------* form display_total_page_no. data: num_pages_c(3). write sy-pagno to num_pages_c left-justified. do sy-pagno times. * Read the line on which *** appears. * Here the first like is assumed * because the Page X of Y was written *in the first line in top-of-page event. read line 1 of page sy-index. replace '***' with num_pages_c into sy-lisel. modify line 1 of page sy-index. enddo. endform.