cancel
Showing results for 
Search instead for 
Did you mean: 

Smartform With 2 pages

SwapnilSamel
Discoverer
0 Kudos

as per my requirement i want smart form with 2 pages.

first page is working fine alone, i want page2 for every records on page 1.

i have write COMMAND inside loop in main window for calling page 2.

and write page 1 as next page for page2.

then for 4 records it prints 9 pages, it redirects last page 2 to page 1 again.

How to stop it on second page.

How to use condition for calling page1 from page 2.

is thr any other way?

Thanks

Accepted Solutions (0)

Answers (1)

Answers (1)

former_member184675
Active Participant
0 Kudos

Hi,

I'm not sure if i understood your problem correctly but try this :

Currently, Page2 has Page1 as Next Page.

Instead try using a COMMAND in Page2 that redirects to Page1. Create a variable that keeps track when you reach End of Loop and use that variable as a condition for the Command in Page2.

Let me know what happens.

Regards,

Andrei

SwapnilSamel
Discoverer
0 Kudos

Command can be created in main window only.

I have already used command on first page.

former_member184675
Active Participant
0 Kudos

So,

Use this workaround (not probably the best solution but it should work ).

  • Create a global variable NO_LINES and fill it with the number of lines of the internal table .
  • Create a COUNT variable and use it in the LOOP  - calculations to store the loop index (set it to Before Loop ).
  • Put a condition on the Command (that goes to Page2) to run only when count <> no_lines

        Using this condition will not print LAST PAGE

  • Create a page named LAST_PAGE as copy of PAGE2
  • In Page1 create another command AFTER loop that goes to LAST_PAGE with condition

          count = lines . This will only print the last page

  • All other windows in Page1 must be conditioned to be printed Before End of Main Window

or look into SSFCOMP_CLOSE and SSFCOMP_OPEN FM's ...

regards,

Andrei