Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

for displaying page numbers at the bottom of page

Hi all,

i have written the following code for dispplaying the page number at the top. Now i want to displkay the pagenumber at the bottm of each page.

instead of top-of-page i have mentioned end-of-page.but in the output i am getting like : 1 / -


.

what changes i have to do for my code to display the page numbers at the bottom pf the each page.

Note: i am displayig page numbers as 1 / 10, 2 / 10 etc. format.

REPORT ZDEMO_EOF NO STANDARD PAGE HEADING LINE-SIZE 100 line-count 28(2).

types: BEGIN OF t_mara,

matnr TYPE mara-matnr,

ernam type mara-ernam,

end of t_mara.

data: itab TYPE TABLE OF t_mara,

wa TYPE t_mara.

select matnr ernam FROM mara INTO TABLE itab

WHERE matnr BETWEEN '000000000000000001' and '000000000000000756'.

sort itab by matnr.

delete itab WHERE matnr is INITIAL.

LOOP AT itab INTO wa .

WRITE:/ sy-tabix,'!', wa-matnr, wa-ernam.

ENDLOOP.

DATA L_PAGE_COUNT(5) TYPE C.

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.

*end-OF-PAGE.

WRITE: /(70) SY-PAGNO,'/', '-----'.

Thanks in advance

krupali.

Tags:
replied

Hi,

Use this code:

  • zlines number of lines in the table

  • sy-srows number of lines in screen

  • sy-cpage current page

  • zpages total number of pages type i

  • temp temporary number type f

describe table itab lines zlines.

temp = zlines / sy-srows.

zpages = trunc( temp ).

temp = frac( temp ).

if temp > 0.

zpages = zpages + 1.

endif.

  • zpages is the number of pages

write: /'Page ',sy-cpage, ' of ', zpages.

Make sure that you consume the 26 Lines..so that Footer should get print....

0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question