cancel
Showing results for 
Search instead for 
Did you mean: 

Generating Page break in SCRIPTS

Former Member
0 Kudos

Hi experts..

I am working on SCRIPTS.

I have one internal tabl.

I want to generate PAGE-BREAK depending upon 3 fields.

How to generate page break.

assume those fields as Field1, Field2, field3.

thanks

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi ,

I think start_form is not neccesary. but try that FM with no form name ,then it will consider the previously activated form.

Thanks,

suma.

Former Member
0 Kudos

ya its working..

no need of "start_form".

but one problem is coming, if my field is changed, its only generating the new page,

but all data is not printing on page.

header got printed, but main window data is not printiong.

what should b solution for that.

Former Member
0 Kudos

Hi,

write below code in the driver program.

sort itab by field1 field2 field3.
LOOP AT ITAB.
  AT NEW  field3.
            CALL FUNCTION 'CONTROL_FORM'
              EXPORTING
                COMMAND   = 'NEW-PAGE LIST'  " LIST would be the new page
              EXCEPTIONS
                UNOPENED  = 1
                UNSTARTED = 2
                OTHERS    = 3.
  ENDAT.
ENDLOOP.

Thanks,

Suma.

naimesh_patel
Active Contributor
0 Kudos

In your driver program you can call the FM CONTROL_FORM to generate a new page.


LOOP AT ITAB.
  ON CHANGE OF ITAB-FIELD1.
            CALL FUNCTION 'CONTROL_FORM'
              EXPORTING
                COMMAND   = 'NEW-PAGE LIST'  " LIST would be the new page
              EXCEPTIONS
                UNOPENED  = 1
                UNSTARTED = 2
                OTHERS    = 3.
  ENDON.
ENDLOOP.

Regards,

Naimesh Patel

Former Member
0 Kudos

Thanks Naimesh..

But one error is coming as "START_FORM is missing".

is it necessory.

shall i use START_FORM?