Skip to Content
author's profile photo Former Member
Former Member

Strange Behaviour of Abap Report

In my report , I am displaying the page number in the top of the report in the format page 1 of n .

The code i am using is ...

DATA l_page_count(5) TYPE c.

FORM page_display .

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.

ENDFORM.

top-of-page.

write: 'PAGE:',(3) sy-pagno LEFT-JUSTIFIED,'of',(3) '___'

I am performing the form page_display in the right place and i am getting the desired output .. But though it works properly in foreground, it behaves strangely if its run in background... ie. In spool, the its displaying page 5 of ___... where as in foreground its showing page 5 of 12.. like that . However, in the last page of the spool, its showing this properly ..

I dont know why its happening ..I noticed that the same thing happens in all the reports ..

Why is this happening ? Can anybody give me a solution and explain the same ?

Thanking you in advance..

Add a comment
10|10000 characters needed characters exceeded

Related questions

2 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Feb 23, 2005 at 02:26 PM

    Hello Shankar,

    For the Report Statement, please include the option no standard page heading.

    I'm not sure this would solve the problem but just give it a try.

    Also, I think it is a better practice to use the temporary variables instead of using the system variables directly.

    Regards,

    Anand Mandalika.

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Feb 23, 2005 at 02:30 PM

    Hi!

    This is not possible in such a easy way.

    Follow topic page n of n

    (and especially my comments 😊

    Regards,

    Christian

    Add a comment
    10|10000 characters needed characters exceeded

    • Hi,

      obviously I should repeat something:

      it is <b>NOT</b> possible.

      Two work-arounds (as mentioned already in other topic):

      - calculate output pages based on number of lines in your internal table

      - create spool; re-read spool; get total number; replace page number on all pages in spool (this are mainly file operations - very complicated, the effort not worth the result).

      Regards,

      Christian

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.