cancel
Showing results for 
Search instead for 
Did you mean: 

Script printing problem

kesavadas_thekkillath
Active Contributor
0 Kudos

PERFORM OPEN_FORM.

DATA:PAGE_FLAG TYPE I.

PAGE_FLAG = 0.

DATA:INDEX_CNT TYPE I.

DATA:EXPLICIT_FLAG TYPE C.

INDEX_CNT = 0.

LOOP AT T_FINAL[] INTO ST_FINAL.

ADD 1 TO INDEX_CNT.

IF INDEX_CNT = 7.

EXPLICIT_FLAG = 'X'.

ELSE.

CLEAR EXPLICIT_FLAG.

ENDIF.

IF PAGE_FLAG = 0.

PERFORM WRITE_FORM USING 'A' 'HEADER1'.

PERFORM WRITE_FORM USING 'B1' 'HEADER2'.

PAGE_FLAG = 1.

ENDIF.

PERFORM WRITE_FORM USING 'B' 'MAIN'.

AT LAST.

PERFORM WRITE_FORM USING 'C' 'FOOTER'.

PERFORM CLOSE_FORM.

EXIT.

ENDAT.

IF INDEX_CNT = 7.

PERFORM WRITE_FORM USING 'C' 'FOOTER1'.

PAGE_FLAG = 0.

INDEX_CNT = 0.

ENDIF.

ENDLOOP.

IN the main part of the script i have given

IF &EXPLICIT_FLAG& EQ 'X'.

NEW-PAGE.

ENDIF.

But the problem is after printing 7 records the 8 record is getting over written on the 1st record of the same page

I need the 8 and rest in the second page..

can any body help me in solving this problem

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

HI,

The decalrations what you have mentioned in the FORM_OPEND should be declared in the global, so please declare those variabls above the FORM_OPEN

Sudheer