Hello,
I think that it should work, this construction of an loop node including all relevant items and at the event TAB event sort field only these items are copied in the OUTPUT_TAB which should be printed in a separate table on the form. After having printed the table, the content of the internal table is cleared.
I suppose that you first should check if this TAB "event sort field" includes the correct criteria for the necessary group change. If this event is really defined correctly, then I only have one hint for you.
I know that the only possibility to define a page break in a table in the Window MAIN is to use the following technique:
Define an outside loop node and in this loop node a table node, but this table does not have a internal table to be looped through. It includes only the fields to be printed, maybe you have to re-design your table node.
By the way only then you can define a command node including a page break during the processing of an internal table.
Regards
Juergen