cancel
Showing results for 
Search instead for 
Did you mean: 

SMARTFORM printing - 2 copies of page 1 and 1 copy of page 2

Former Member
0 Kudos

Hello,

I have a requirement to develop a SMARTFORM with 2 pages, whereby both the pages have different layouts. Page 1 contains production order data and can overflow to multiple pages, while Page 2 contains confirmation ticket data, which will only be one page. I managed to trigger Page 2 by using Command 'Go to New Page' in the Main window of Page 1.

The issue that I am facing is that they want Page 1 to always be printed as 2 copies, and Page 2 should only have 1 copy printed. I am using TDCOPIES to pass in the number of copies from the print program. I have tried two alternatives, but both have issues:

Method one:

I created two pages in the form - Page 1 and Page 2. Page 1 has Command to go to Page 2 in the Main window, after the Items data loop. I defined the Window in Page 2 as Copies Window and selected radio button 'Only Original'. When I test this, for the Original Copy, I get Page 1 printed (as many pages as the data overflows) and Page 2 is printed. For the Duplicate Copy, Page 1 is printed correctly again and I get a blank page at the end (which I think is Page 2 without the text).

I changed the option by selecting radio button 'Only Copies - Copies Identical', and this reverses the output as mentioned above. Page 2 comes out as blank page for the Original copy.

I can't seem to figure out how to set a condition so that the Command to go to Page 2 triggers only for the Duplicate copy because in Main window SFSY-COPYCOUNT will always be 1. And Main window is processed last so even if I set a flag/counter in another Copies window on Page 1, it doesn't work either.

Method two:

I created three pages in the form - Page 1, Page 2 and Page 3. Page 2 has the same layout as Page 1 (to act like the duplicate copy). In Initialization, I created an internal table to store page names (1,2).

In Page 1: In the Main window, I create a loop against the Page Names internal table. Inside this loop, I create a loop against the Items data table. At the end of the Items data loop (still inside the Page Names table loop), I create a Command to go to Page 2, with Condition that current page name = 1. This works and Page 2 gets triggered correctly.

In Page 2: In the Main window, I create a loop against the Page Names internal table. I set the Sort Criteria for this loop to sort Page name in descending order, so that the loop starts from Page Name = 2. Inside this loop, I create a loop against the Items data table. At the end of the Items data loop (still inside the Page Names table loop), I create a Command to go to Page 3, with Condition that current page name = 2. This however does not work and when I debugged, it seems like the Command doesn't get triggered here. Only Page 1 and Page 2 are displayed in the output.

If anyone has any ideas on how to solve the issues on either one of the methods above or if you have any other alternatives that have worked for you, please do share with me.

Additional info: this smartform will be triggered from a std transaction using output type.

Thanks in advance!!!

Accepted Solutions (0)

Answers (1)

Answers (1)

nabheetscn
Active Contributor
0 Kudos

Hi,

Right now the simplest way i can think of doing it is create two separate forms one for the one where you want n copies and one for only one copy. First print main form followed by the second form.

I guess no extra lcomplex logic needs to be applied in this case.

Thanks

Nabheet

Former Member
0 Kudos

Hi Nabheet,

Yes, that would be my last resort if everything else fails. But they want to try and combine both into one form, which is why I want to try out every possible way, before giving up. So any helpful ideas are most welcomed

Thanks!!

Former Member
0 Kudos

Hello,

Don't know what would be the actual output, but you can do it by decreasing the size of your template size in your smartform otherwise plz do check your page settings in collaboration of your basis team. Hope this would be helpful.

Thanks & Regards,

Akg