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

script

Former Member
0 Likes
412

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

3 REPLIES 3
Read only

Former Member
0 Likes
390

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

Read only

Former Member
0 Likes
390

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

Read only

Former Member
0 Likes
390

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.