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

Problem with page break

Former Member
0 Likes
1,038

Hi All

I need to display page number at end of every page in report output.

I am not getting it in proper format. Also in the last page the page number is missing.

Pls look at the code:

FORM Display_final_report USING FP_I_FINAL type ty_t_final.

Data: l_wa_final type ty_final.

Data: l_v_wrbtr type char16,

l_v_serno type char4,

CNT TYPE I.

CLEAR CNT.

loop at FP_I_FINAL into l_wa_final.

CNT = CNT + 1.

l_wa_final-rwbtr = l_wa_final-rwbtr * -1.

l_v_wrbtr = l_wa_final-rwbtr.

l_v_serno = l_wa_final-ser_num.

condense l_v_serno.

  • Babita

  • write : /6 sy-vline, l_v_serno ,11 sy-vline,12 l_wa_final-chect,18 sy-vline ,19 l_wa_final-zaldt,29 sy-vline ,30 l_v_wrbtr,45 sy-vline ,

  • 46 l_wa_final-znme1,87 sy-vline.

write : /6 sy-vline, l_v_serno ,

11 sy-vline, 12 l_wa_final-chect,

18 sy-vline ,19 l_wa_final-zaldt,

29 sy-vline ,30 l_v_wrbtr left-justified,

45 sy-vline ,46 l_wa_final-znme1,

87 sy-vline.

IF CNT > 40.

NEW-PAGE.

CLEAR CNT.

WRITE :/50'PAGE:' , SY-PAGNO.

ENDIF.

endloop.

I am not very clear with new-page, reserve , and end-of-page event. Can anybody help me correct the code.

exactly where should we put the end-of-page?

Regards

Babita

write:/6(82) sy-uline.

skip 1.

write:/6 Text-013.

write:/6 Text-014.

skip 2.

write:/6 Text-015.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,011

Hi ,

To display the page number at the end of the page , use the END-OF-PAGE event

e.g.

END-OF-PAGE.
  ULINE.
  WRITE: /30 'Page', sy-pagno.

and what is the problem with the format.

Regrads

Arun

Hi All

I need to display page number at end of every page in report output.

I am not getting it in proper format. Also in the last page the page number is missing.

Pls look at the code:

FORM Display_final_report USING FP_I_FINAL type ty_t_final.

Data: l_wa_final type ty_final.

Data: l_v_wrbtr type char16,

l_v_serno type char4,

CNT TYPE I.

CLEAR CNT.

loop at FP_I_FINAL into l_wa_final.

CNT = CNT + 1.

l_wa_final-rwbtr = l_wa_final-rwbtr * -1.

l_v_wrbtr = l_wa_final-rwbtr.

l_v_serno = l_wa_final-ser_num.

condense l_v_serno.

  • Babita

  • write : /6 sy-vline, l_v_serno ,11 sy-vline,12 l_wa_final-chect,18 sy-vline ,19 l_wa_final-zaldt,29 sy-vline ,30 l_v_wrbtr,45 sy-vline ,

  • 46 l_wa_final-znme1,87 sy-vline.

write : /6 sy-vline, l_v_serno ,

11 sy-vline, 12 l_wa_final-chect,

18 sy-vline ,19 l_wa_final-zaldt,

29 sy-vline ,30 l_v_wrbtr left-justified,

45 sy-vline ,46 l_wa_final-znme1,

87 sy-vline.

IF CNT > 40.

NEW-PAGE.

CLEAR CNT.

WRITE :/50'PAGE:' , SY-PAGNO.

ENDIF.

endloop.

I am not very clear with new-page, reserve , and end-of-page event. Can anybody help me correct the code.

exactly where should we put the end-of-page?

Regards

Babita

write:/6(82) sy-uline.

skip 1.

write:/6 Text-013.

write:/6 Text-014.

skip 2.

write:/6 Text-015.

7 REPLIES 7
Read only

Former Member
0 Likes
1,012

Hi ,

To display the page number at the end of the page , use the END-OF-PAGE event

e.g.

END-OF-PAGE.
  ULINE.
  WRITE: /30 'Page', sy-pagno.

and what is the problem with the format.

Regrads

Arun

Read only

0 Likes
1,011

Hi

After executing my code, I'm getting page break but there is some blank space on each page just above the page number which is not required.

Any help?

Regards

Babita

Read only

0 Likes
1,011

Hi,

Try to set the LINE-COUNT parameter :

E.g. : REPORT XXXXXX LINE-COUNT 65.

Regards,

Mathieu

Read only

0 Likes
1,011

Hi

I have already done this declaration.

REPORT Z_BANK_LETTER_PRINT NO STANDARD PAGE HEADING

LINE-SIZE 90

LINE-COUNT 65

Message-ID ZFI.

I can see that sy-pagno is getting incremented in debug mode but cannot see the same in final output.

Regards

Babita

Read only

0 Likes
1,011

hi babita,

TRY THIS....

REPORT Z_BANK_LETTER_PRINT NO STANDARD PAGE HEADING

LINE-SIZE 90

LINE-COUNT <b>65(3)</b>

Message-ID ZFI.

END-OF-PAGE.

write:/50 'page no.:', sy-pagno.

may i know y r u using a counter cnt.??

hope this helps,

priya.

Message was edited by:

Priya

Read only

0 Likes
1,011

Hi Priya

The problem got solved. Thanks. I am no longet user the cnt.

That was just for testing purpose.

Thanks to everyone for their replies..

Regards

Babita

Read only

Former Member
0 Likes
1,011

You can simply add a

WRITE :/50'PAGE:' , SY-PAGNO.

At the end of your code, but, with your method, you will have a new break each 50 lines... It may change.

Use the "END-OF-PAGE" block :

END-OF-PAGE.

WRITE :/50'PAGE:' , SY-PAGNO.

Regards,

Mathieu