Skip to Content

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

page number not printing on last page

Hi all,

I am ablt to print the total no of pages in all pages ecept the last page.

whats wromg in my code ?

REPORT ZDEMO_EOF NO STANDARD PAGE HEADING LINE-SIZE 100 line-count 27(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 '000000000000000777'.

sort itab by matnr.

delete itab WHERE matnr is INITIAL.

LOOP AT itab INTO wa .

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

ENDLOOP.

data: v TYPE n.

v = sy-linct - sy-linno.

skip v.

end-OF-PAGE.

data: zline type i,

temp TYPE f,

zpages TYPE i,

temp1 TYPE i.

CLEAR: zline,temp,zpages,temp1.

DESCRIBE TABLE itab LINES zline.

temp = zline / sy-srows.

zpages = TRUNC( temp ).

temp1 = FRAC( temp ).

if temp1 > 0.

zpages = zpages + 1.

endif.

write: /'Page ',sy-pagno, ' of ', zpages RIGHT-JUSTIFIED.

Thanks in advance

krupali

Tags:
Former Member
replied

Hi KR ,

In my system it is printing end of page for the last page.

DATA: v TYPE n. "-------> change 'n' to i.

Thanks and Regards

Edited by: Always Learner on Oct 17, 2008 2:16 PM

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