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: 

End-of-page problem

Former Member
0 Kudos

HI guys I have one reqiurment,

In clasical reports In I am displaying output,

Here For every page I am adding header and footer at top and bottom

My Problem is for last page my client wants to save gap ,

In last page If the output data completed for the first 3 lines then he wants display fotter with gap of 3 lines.

7 REPLIES 7

Former Member
0 Kudos

HI Raju,

Welcome To SDN.

Consider the following case:

Report zdemo1 line count 20(1).
Start-of-selection.
Data: m type i.
Write: / u2018this is first lineu2019.
Do 3 times.
Write: / u2018the number isu2019, sy-index.
Enddo.
M = sy-linct, sy-linno u2013 1.
Skip x.
End-of-page.
Write: / u2018page endu2019.

The output of above example is as follows :

This is first line.

The number is 1

The number is 2

The number is 3

After skipping 3 lines

Page end

In this case, with all write statement, you donu2019t reach to the end of page. After all write statement, m is calculated in this case:

3 lines are skipped after write statement and end of page is reached.

If you dont want to END THE PAGE you can make your required coding overthere .

Hope this solves your problem.

Have a great day ahead,

Pavan.

Former Member
0 Kudos

any inputs.

Former Member
0 Kudos

Hello Raju

to achieve your requirement ,we first need to calculate the total nuumber of pages ,which will give us the last page

i dont think there is any direct way of calculating the total number of pages please refer to these links to understand how to calculate the page numbers

http://www.sapfans.com/forums/viewtopic.php?t=29597

once we have the last page number

we can use the condition in END-OF-PAGE .

if sy-pagno = last_page.

skip 3 line

endif.

Hope it will solve your problem..

Thanks & Regards

Rohit

0 Kudos

Hi Rohit thanks for your inputs,

Upto this point I did.

I caliculated total no of pages and suppressed ,

In the last page t End-of-page is triggering normally ( at page last , footer is displaying But I want to bring that one up , But I am unable do that one).

0 Kudos

Hi

So the requirement is to bring the footer up in th last page

so that there is a blank gap Below the footer

I am not aware if this can be done , it would have been easy if it was SCRIPT or smartform .

never the less logically one thing can be done

Do not execute the "statements" in the end-of-page for the last page condition

i.e

execute the "statements" just below the part where your display end for the last page condition

if

sy-pagno = last_page .

statements

endif.

end-of-page.

if sy-pagno <> last_page .

statements

endif.

if u search google u will get some posts where top of page is disabled and lines are shifted up

there could be an alternative solution to this

but u can try this for now .

Thanks

Former Member
0 Kudos

Hi Raju,

here is the link go through this i hope this will provide some help to u...

http://help.sap.com/search/highlightContent.jsp

thanks

Ashu

Former Member
0 Kudos

Hi Raju,

you should maintain line-count in declaration as

Report zdemo1 no standard page heading line-count 65(5)

line size 255.

Hope this will help you.

Regards,

Vijay