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 breaks in report..

Former Member
0 Kudos

hi experts,

in classical report i got out put like this,

accno desc dr cr

1000 sfkkckdk 4512 89651

kfjklvjkldjkvj 4755 65897

sojiovil 5698 89565

1001 agfgsjaggk 7895 56987

kfjklvjkldjkvj 4755 65897

sojiovil 5698 89565

here my question is when ever account number changed

that account number data should be display in new page.

that means whenever account number changed new page will be triggered. so how can i accomplish this?

please help me regarding this.

regards,

nagarjuna.

11 REPLIES 11

Former Member
0 Kudos

Hello Nagarjuna,

This is achieved using the Page command.

For this sort the internal table by account. Whenever the account changes ,use this command and you will have every account on a new page.

When you see the output in the output list, it will appear as if it is contiguous, but dont worry ,if you actually print the list, you will get teh page breaks exactly the way you want.

cheers,

Sushil Joshi

0 Kudos

Hi Sushil,

Check this code....

Report Zrep LINE-COUNT (6).

AT NEW accno.
RESERVE 5 Lines.
write : / accno.
ENDAT.

TOP-OF-PAGE.
write: / 'Account details'.

As there is standard page heading it occupies 2 lines and then after that left is 3 lines in which print the necessary lines before to be printed and change the no of lines to be reserved accordingly..

RESERVE is such that if it finds the no of lines in the page then it

write command executes in that pages else it will write in next page.

Change the logic accordingly.

Hope this would help you.

Best Regards

Narin Nandivada.

Former Member
0 Kudos

hi,

do this way ...


loop at itab.
  at end of <accno>.
    new-page.   " For new Page 
    write : itab-field1 , ......
  endat. 
endloop.

Former Member
0 Kudos

Hi,

for this u can use 'onchange of' statment

loop at it.

onchange of accno.

new screen.

endon.

endloop.

Former Member
0 Kudos

Hi,

i think this wil help u...

TABLES: SFLIGHT.

DATA: itab LIKE sflight OCCURS 0 WITH HEADER LINE.

select * FROM sflight INTO TABLE itab.

LOOP AT itab.

WRITE: / itab-carrid,itab-connid.

on CHANGE OF itab-carrid.

new-PAGE.

WRITE: / itab-carrid,itab-connid.

endon.

ENDLOOP.

Former Member
0 Kudos

hi,

You can code like this,

loop at it_itab.

at new acc_no.

NEW-PAGE [page_options] [print_options].

< further processing steps >

endat.

endloop.

here the statement New-Page allows you to create a new page in the current list and to write the subsequent list output into a print list. The additions page_options determine general properties of the new page. The additions print_options control the print list output.

0 Kudos

i have data in out put table. once data comes into output internal table where i need to use the events.

shall i use in display subroutine or in some other place?

please give some code with explanation.

thnx,

nag

0 Kudos

After filling the internal table, U actually loop that to write 'WRITE statements' .

Do this way...

loop at it_itab.

at new field.
new-page.
endat.

write: fields.

endloop.

Thanks,

Shailaja

former_member188685
Active Contributor
0 Kudos

If it is Noraml report then you can use NEW-PAGE. butif it is ALV report then you can use SORT option.

when you populating the sort table

you have option called GROUP

you Specify

GROUP = '*'. "* for new page

0 Kudos

hi,

i got the solution..

thanks for ur suggestions..

rgds,

nag.

Former Member
0 Kudos

Hi,

Here you can use the control break statement and also you have to call new-page command.

loop at itab.

at new belnr.

new-page. " For new Page

write : itab-belnr ,itab-sgtxt, itab-dmbtr, itab-dmbtr.

endat.

endloop.

hope this helps you.

Reward points if helpfull.

Thanks & Regards,

Y.R.Prem Kumar