‎2007 May 30 2:09 PM
hi to all
my querry is as follows
how to trigger the page break for each 15 records in main window of the script.
i know one keyword is there like newpage . but tell how to use it and where to use it . pls give some sample coding.
and second querry
how to display the same output in the first and last page of one window in script .pls give coding .
points will be rewarded definitely .
pls give some sample scripts with coding
‎2007 May 30 2:14 PM
Hi
You can display the same output in first and Last pages provided you have the same PAGE windows in both pages other than MAIN window whose data changes as per the page and data.
You can trigger the NEW-PAGE but what condition you use? How you know the 15 records everytime? So it is not a good Idea
You have to keep the MAIN WINDOW size such that it will take only 15 records per page and check.
Or if you want you handle this condition in the Main Driver program ,Loop of the internal table in the program before the WRITE_FORM.
If field = <condn>.
NEW-PAGE.
endif.
Reward points if useful
Regards
Anji
‎2007 May 30 3:09 PM
Hi,
When you write to the main window (I am assume in a loop)
set an internal counter
loop at itab.
count = count + 1 .
if count = 15.
CALL FUNCTION 'CONTROL_FORM'
EXPORTING
COMMAND = new-page
EXCEPTIONS
UNOPENED = 1
UNSTARTED = 2
OTHERS = 3
.
clear count.
endif.
usual wirte_form
endloop.
This will ensure a new page for the 16th item every time.
Kindly reward points if useful
Regards,
Gaurav
‎2007 May 30 4:12 PM
you can use the "MOD" function ....which will give you the remainder when a number is divided.
ex: a mod b.
if the remainder is 0...then call control_form or even the write_form with a different
element and new-page.