Hi Krishna,
First you create pages with mentioning next pages in PAGE GENERAL ATTRIBUTES as you mentioned in your query. For last page, mention next page as last page only. (PAGE 4 > Next page = PAGE 4).
And you cannot use multiple main window in smartforms. If you are printing something in MAIN Windows of 2, 3 and 4 pages, that will not be printed. It prints blank. Only 1 Main window will be executed in Smartforms.
So, just you give command line for Page 1 and mention Next page as Page 2. That is enough. If you are mentioning Command for further pages like 2, 3 and 4 in Main windows that will not be executed. And to navigate Main window is needed. Just create Empty main window at any empty place with same width as in First page (don't print any content in it).
To print different contents in different pages, Use Secondary window instead Main Window.
Regards,
Vijay