Problem solve Get help with specific problems with your technologies, process and projects.

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.

This was last published in February 2003

Dig Deeper on SAPscript and Smart Forms

PRO+

Content

Find more PRO+ content and other member only offers, here.

Start the conversation

Send me notifications when other members comment.

By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Please create a username to comment.

-ADS BY GOOGLE

SearchManufacturingERP

SearchOracle

SearchDataManagement

SearchAWS

SearchBusinessAnalytics

SearchCRM

SearchContentManagement

SearchFinancialApplications

Close