10-11-2007 6:39 AM
Hi,
I have an internal table it_account with the following pattern of data.
71 data data
71 data data
71 data data
72 data data
72 data data
72 data data
73 data data
73 data data.
i am looping at this internal table and printing the values in sapscript.
ie in the main window.
loop at it.
write from.
endloop.
My requirement is that the data corresponding to 71 should be printed in one page
72 in another page and so on...a new-page should be fired on number change...
Please help ...
Thankyou..
10-11-2007 6:42 AM
in SAP Script...
after printing ITAB contents...
use NEW-PAGE cmd....
e.g. /E ITAB
P1 &ITAB-fld1& &ITAB-fld2&
/: NEW-PAGE
10-11-2007 6:43 AM
Hi,
Try this..
loop at it.
ON CHANGE OF it-first field.
* call the function module CONTROL_FORM to force a new page.
CALL FUNCTION 'CONTROL_FORM'
EXPORTING
COMMAND = 'NEW-PAGE'
EXCEPTIONS
UNOPENED = 1
OTHERS = 3
ENDON.
write from.
endloop.
Thanks
Naren
10-11-2007 6:52 AM
Hi,
1.Sort your internal table....
2. At new <field1>
Use command statement NEW-PAGE
Make sure for the first loop pass (index) this new page is not triggering
If the hint is useful Say thanks by reward .
Regards,
Prabhu Rajesh
10-11-2007 7:16 AM
U must hav used function START_FORM..
place it inside the loop after AT-NEW <fieldname>
Loop at it.
AT NEW <>
START_FORM
..
endat.
AT END OF <>
CLOSE_FORM.
enloop.
Hope it answers ur doubt.
Reward if helpful