cancel
Showing results for 
Search instead for 
Did you mean: 

How to print 20 lines in one page and remaining lines in another in script?

Former Member
0 Kudos

Hi I created 2 pages in script for page1 next page is page2 , how i can print 20 lines in one page and remaining lines in another page is their any method///

Accepted Solutions (1)

Accepted Solutions (1)

former_member201227
Active Participant
0 Kudos

Hi,

Restrict the height of the main window in the first page to 20 lines and in the next page as you wish.

Regards,

Sharmila

Answers (2)

Answers (2)

Former Member
0 Kudos

hi,

You can do this in two ways.

1. loop the lines and check if the line no is 21 then call for a page break.

2. Adjust the height and width of the window such that it accumulates only 20 lines. This process will be a little cumbersome, but scripts are like this only.

Hope this helps you.

Regards,

Richa

Former Member
0 Kudos

U can handle that case in the print program.

The logic goes like this,

In the loop where the write_form for items is being is run u have to place a condition like this.

loop at itab.

if sy-tabix ge 20.

CALL FUNCTION 'CONTROL_FORM'

EXPORTING

command = 'NEW-PAGE'

EXCEPTIONS

unopened = 1

unstarted = 2

OTHERS = 3.

IF sy-subrc <> 0.

MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno

WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.

ENDIF.

endif.

write_form.

endloop.

Check out in this way and let me know the result.

Regards