07-15-2008 5:17 AM
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.
07-15-2008 5:20 AM
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
07-15-2008 5:25 AM
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.
07-15-2008 5:22 AM
hi,
do this way ...
loop at itab.
at end of <accno>.
new-page. " For new Page
write : itab-field1 , ......
endat.
endloop.
07-15-2008 5:23 AM
Hi,
for this u can use 'onchange of' statment
loop at it.
onchange of accno.
new screen.
endon.
endloop.
07-15-2008 5:59 AM
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.
07-15-2008 6:27 AM
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.
07-15-2008 8:34 AM
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
07-15-2008 8:47 AM
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
07-15-2008 8:50 AM
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
07-18-2008 6:26 AM
07-18-2008 6:42 AM
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