Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Total pages

Former Member
0 Likes
649

Hi,

I am using the below code for printing the Total no of pages.This is working in forground,but not working in Background.can any one give idea why it is not working and How do i acheive this in background.

WRITE SY-PAGNO TO TOTAL_PAGES.

DO SY-PAGNO TIMES.

READ LINE 1 OF PAGE SY-INDEX.

REPLACE '****' WITH TOTAL_PAGES INTO SY-LISEL.

MODIFY LINE 1 OF PAGE SY-INDEX.

ENDDO.

Thanks in Advance,

Regards,

Anu.

Hi,

I am using the below code for printing the Total no of pages.This is working in forground,but not working in Background.can any one give idea why it is not working and How do i acheive this in background.

WRITE SY-PAGNO TO TOTAL_PAGES.

DO SY-PAGNO TIMES.

READ LINE 1 OF PAGE SY-INDEX.

REPLACE '****' WITH TOTAL_PAGES INTO SY-LISEL.

MODIFY LINE 1 OF PAGE SY-INDEX.

ENDDO.

Thanks in Advance,

Regards,

Anu.

4 REPLIES 4
Read only

Former Member
0 Likes
615

Hi,

Try to print the spool and check...

Thanks,

Naren

Read only

Former Member
0 Likes
615

what are you trying to achieve actually?

Read only

0 Likes
615

If I'm not wrong what ur code does is once entire report is printed it goes to each page of the report and display no. of pages in the first line.

This can't be done in background mode. The only solution I can think about is, before displaying the report find out the possible total no. of pages to be displayed using page size and no. of records in the initial table you are displaying. And use this variable wherever u want to.

Read only

Former Member
0 Likes
615

Hi,

This doesn't work in the background as nothing is actually been printed on the screen.

I think the only way is to keep track of the number of lines u r printing (may be the no. of lines in ur internal table) & then calculate the no. of pages taking total records, header space & footer into consideration.