Hi,
In the conditions tab dont tick 'After Main' it means it will only trigger after main window processing which is not your case. Check how many entries can display in first page say for example you can display only 15 entries(depending on your layout and window size). Then after 15 entries are processed set a flag then put the condition as flag = 'X' just as shown in the example.
You can also try the following:
Insert a CODE node in the MAIN node of the table. IN that say you increment a integer value say L_COUNT to count the Loop pass. Before that Count the number of entries in table and store in Global Variable in the smartform L_NO_OF_LIN indicating number of lines in table . Increase L_COUNT by 1 before you print the line.
IF L_COUNT is GT L_NO_OF_LIN. That means last entry in the internal table in printed. SO set a flag = 'X'. Put this in the conditions tab of COMMAND node. This will trigger command after all entries are processed.
Should help you to achieve your design
Cheers,
Arindam