SAP Message QG158 - Impermissible page format

Diagnosis
In a spool job defined by the function modules OPEN_FORM and CLOSE_FORM,only layout sets with identical page formats may be used.
The new layout set has a page format that differs from the previouslayout sets used in this spool job.

System Response
This causes the program to terminate.

Procedure
The problem can only be rectified by a program change.