cancel
Showing results for 
Search instead for 
Did you mean: 

how can i use page break for every 5 records in sap scripts

Former Member
0 Kudos

on every 5 lines of records i have go for a new page so what is procedure to do this .if possible send me with coding .

Accepted Solutions (0)

Answers (2)

Answers (2)

varma_narayana
Active Contributor
0 Kudos

Hi John..

this is the way..

IN THE PRINT PROGRAM...

DATA : V_MOD TYPE I.

loop at Itab.

V_MOD = SY-TABIX / 5.

IF V_MOD = 0.

CALL FUNCTION 'CONTROL_FORM'

EXPORTING'

COMMAND = 'NEW-PAGE' .

ENDIF.

CALL FUNCTION 'WRITE_FORM'

ENDLOOP.

<b>reward if Helpful.</b>

former_member196280
Active Contributor
0 Kudos

USE SAPSCRIPT-COUNTER_0 and increment it like this use + for incrementing the counter...

EX: &SAPSCRIPT-COUNTER_0(+)&

IF &SAPSCRIPT-COUNTER_0& EQ 5.

NEW-PAGE "PAGE BREAK

&SAPSCRIPT-COUNTER_0(-5)& "Initialising back to Zero

ENDIF.

Close the thread if your question is answered.

Regards,

Sairam