Application Development 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: 

Page no in Classical & in ALV Reports

Former Member
0 Kudos

Hi All,

I need to know how do I print the page no in the following format in Classical & in ALV Reports.

Eg: "Page 1 of 10 " and for next page it should be

"Page 2 of 10 " and lat last

.

.

.

"Page 10 of 10"

Points will be rewarded for all useful answers.

Regards,

Vinodh.

5 REPLIES 5

RichHeilman
Developer Advocate
Developer Advocate
0 Kudos

Here is a sample program for classical reports.



report zrich_0004
       line-size 80
       line-count 65
       no standard page heading.

data: imara type table of mara with header line.

selection-screen begin of block b1 with frame title text-001 .
parameters: p_check type c.
selection-screen end of block b1.

start-of-selection.

  perform get_data.
  perform write_report.

top-of-page.

  perform top_of_page.

************************************************************************
*  FORM GET_DATA
************************************************************************
form get_data.

  select * into corresponding fields of table imara
        from mara up to 300 rows.

endform.

************************************************************************
*  FORM WRITE_REPORT
************************************************************************
form write_report.

  data: xpage(4) type c.

  loop at imara.
    write:/ imara-matnr.
  endloop.

  write sy-pagno to xpage left-justified.
  do sy-pagno times.
    read line 1 of page sy-index.
    replace '****' with xpage into sy-lisel.
    modify current line.
  enddo.

endform.

************************************************************************
*  Form  top_of_page
************************************************************************
form top_of_page.

  write:/32 'Test Program',
        at 62 'Page:', at 67 sy-pagno, 'of', '****'.

endform.

Regards,

Rich Heilman

Former Member
0 Kudos

Hi Rich,

Thank you very much for your code to display page no. in classical reports. Is it possible to do it so in ALV???

0 Kudos

Not sure, I really haven't tried this with an ALV.

Regards,

RIch Heilman

Former Member
0 Kudos

HI Vinod,

Check out this thread for the same..

Regards,

Santosh

former_member223537
Active Contributor
0 Kudos

Hi,

Please refer the following thread :

Best regards,

Prashant