Skip to Content
0
Former Member
Dec 21, 2007 at 08:44 AM

Print tpage number/total page number in a report with width more than 240

30 Views

Dear all,

I need to display total page number as following code sample.

But I need to put it after position 240.

this program can print total page number if it is placed at postion 239 or before.

WRITE: /234(10) 'Heading', 239 SY-PAGNO,'of ', '-----'.

Whenever I put 240 or more WRITE: /234(10) 'Heading', 240 SY-PAGNO,'of ', '-----'.

Total page num could not be displayed.

Please tell me the solution.

thanks

REPORT YPAGECOUNT NO STANDARD PAGE HEADING LINE-SIZE 276 LINE-COUNT 65.

DATA L_PAGE_COUNT(5) TYPE C.

TOP-OF-PAGE.

  • WRITE : /234(10) 'PAGE', SY-PAGNO,'/ ','-----', ''.

WRITE: /234(10) 'Heading', 239 SY-PAGNO,'of ', '-----'.

ULINE.

START-OF-SELECTION.

  • Real list output takes place here

DO 1000 TIMES.

WRITE: / 'Line #', SY-LINNO.

ENDDO.

  • 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.