EDIT the spool pages
My requirement is I need to run the program in the background where I have kept the changing of my header page is like PAGE X of XXXX.
This program is working fine when I keep the program in foreground mode.But when I ran the program in background only the last page is coming perfect. Means PAGE 12 of 12 but all other are came as PAGE 1 OF XXXX.
As the request is already kept in the spool so not able to edit at the end of the program.Below is my code part.
REPORT ZTEST_PSK no standard page heading line-count 30 LINE-SIZE 90
DATA L_PAGE_COUNT(5) TYPE C.
Real list output takes place here
DO 300 TIMES.
WRITE: / 'Line #', SY-LINNO.
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 'XXXX' WITH L_PAGE_COUNT INTO SY-LISEL.
MODIFY CURRENT LINE.
WRITE: /(70) 'Heading' CENTERED, 70 SY-PAGNO,'of ', 'XXXX'.
Please help me in getting to edit all the page in the background run.
Thanks in advance.