Skip to Content
0
Former Member
Oct 17, 2006 at 10:34 AM

printing total pages in report in Background

46 Views

Hi all,

I have a report that show the total pages in the following format 1/5, 2/5,3/5 ....when we run the program in mode foreground.

But my problem is that when I run the report in mode background the report shows the page in wrong mode: 1/**, 2/**, 3/3

and only show the total pages in mode correctly to the last page.

I have seen some topics with similar question, but neither of them is regarding in mode background.

Could anyone please help me with this question?

Thanks.

The code that I use is the following:

REPORT Z_TEST

NO STANDARD PAGE HEADING

LINE-COUNT 65

LINE-SIZE 80.

DATA: NUM_PAGES_C(10) TYPE C.

PERFORM WRITE.

PERFORM GET_TOTAL_PAGENO.

TOP-OF-PAGE.

WRITE:/(SY-LINCT) 'TEST - TEST' CENTERED.

WRITE: / SY-DATUM, 60 SY-PAGNO,'of', '*****'.

SKIP.

&----


*& Form WRITE

&----


  • text *

----


  • --> p1 text

  • <-- p2 text

----


FORM WRITE.

DO 200 TIMES.

WRITE:/ 'TEST', SY-LINNO.

ENDDO.

ENDFORM. " WRITE

&----


*& Form GET_TOTAL_PAGENO

&----


  • text *

----


  • --> p1 text

  • <-- p2 text

----


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_P