‎2007 Feb 22 4:52 PM
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.
‎2007 Feb 22 5:11 PM
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
‎2007 Feb 22 4:55 PM
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.
‎2007 Feb 22 4:56 PM
‎2007 Feb 22 4:59 PM
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...
‎2007 Feb 22 5:11 PM
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