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

System variable

Former Member
0 Likes
447

Hi Guys,

Help in this ....pls

The system variable for the Total No of pages of a report to display on header.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
429

Hi,

We do not have the system field for the total number of pages in report ..

Here is the formula for the total number of pages


REPORT YPAGECOUNT NO STANDARD PAGE HEADING LINE-COUNT 65.
    DATA L_PAGE_COUNT(5) TYPE C.

TOP-OF-PAGE.
    WRITE: /(70) 'Heading' CENTERED, 70 SY-PAGNO,'of ', '-----'.
    ULINE.

START-OF-SELECTION.
*   Real list output takes place here
    DO 300 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.

Regards

Sudheer

3 REPLIES 3
Read only

Former Member
0 Likes
429

SYST-PAGNO

Thanks,

SKJ

Read only

Former Member
0 Likes
430

Hi,

We do not have the system field for the total number of pages in report ..

Here is the formula for the total number of pages


REPORT YPAGECOUNT NO STANDARD PAGE HEADING LINE-COUNT 65.
    DATA L_PAGE_COUNT(5) TYPE C.

TOP-OF-PAGE.
    WRITE: /(70) 'Heading' CENTERED, 70 SY-PAGNO,'of ', '-----'.
    ULINE.

START-OF-SELECTION.
*   Real list output takes place here
    DO 300 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.

Regards

Sudheer

Read only

Former Member
0 Likes
429

Are u trying to find out total no. pages ur smartform would generate ?