The code below shows how to display the total number of pages in a report like "Page 1 of 8." However, it doesn't work if you execute the program as a background jobs.
* Declare a variable
DATA L_PAGE_COUNT(5) TYPE C.
* Copy this code to the end of program
* Page count will be printed on each page
here
WRITE SY-PAGNO TO L_PAGE_COUNT LEFT-JUSTIFIED.
DO SY-PAGNO TIMES.
READ LINE 1 OF PAGE SY-INDEX.
REPLACE '-----' WITH L_PAGE_COUNT
INTO SY-LISEL.
MODIFY CURRENT LINE.
ENDDO.
TOP-OF-PAGE.
WRITE: /(70) 'Heading' CENTERED, 70 SY-PAGNO,'of
', '-----'.
Return to :-
SAP ABAP/4 Programming, Basis Administration,
Configuration Hints and Tips
(c) www.sap-basis-abap.com All material on this site is
Copyright.
Every effort is made to ensure the content integrity.
Information used on this site is at your own risk.
All product names are trademarks of their respective
companies. The site www.sap-basis-abap.com is in no way affiliated
with SAP AG.
Any unauthorised copying or mirroring is prohibited.