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

Simple CLASSICAL REPORT doubt....!!!

Former Member
0 Likes
609

Hi Friends,

I have a small doubt in reports.

In a simple report out put How can we give the page footer as 1 of 10 ..in first page 2 of 10 in second page and ....so on for say 10 page out put.

Thanks in advance.

Regards,

Ram.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
587

Hi Ram,

Check this 'Rich' code.

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.

Thanks,

Vinay

4 REPLIES 4
Read only

Former Member
0 Likes
587

Current Page is in SY-PAGNO.

I presume you would have to compute the overall pages based on the number of entries in your internal table. Also taking into account any extra spacing.

Read only

Former Member
0 Likes
587

Hello,

Check this thread.

Vasanth

Read only

Former Member
0 Likes
587

For the current page no problem, you write the SY-PAGNO parameter.

I think that the major problem is to know in advance the overall number of pages.

For that, you should use an algorithm that computes the row numbers and then divides per number of lines per pages... I think this could be quite difficult. it depends on the report type, if it simple to have in advance the occupied rows or not...

Read only

Former Member
0 Likes
588

Hi Ram,

Check this 'Rich' code.

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.

Thanks,

Vinay