Skip to Content
Author's profile photo Mohamed Hani

Step by Step tutorial of Copies Window

Hi All,
This document is for people who are new to SAP ABAP esp. SMARTFORMS. Here I have explained with screenshot about Copies Window which is one of the four windows type available in SMARTFORMS. I am showing end to end in detail so that even a novice can understand.
Windows are similar to containers where you can put your data. There are four type of WINDOWS:
  1. Main Window
  2. Secondary Window
  3. Copies Window
  4. Final Window
1. Main window.
     You can identify only one window of a form as main window. You use the main window to spread output over several print pages, which is a prerequisite for printing tables.
2. Secondary window.
     For output with a fixed length.
3. Copies window.
     You use the copies window to define an output area for the print output, whose content you want to appear either only on the copy or only on the original. This allows you to flag copies as copies when the form is printed. In this document we will see more about copies window.
4. Final window.
       This is also a special type of window for the details that has to be processed only at the end of the form processing . eg. Total amount of a PO
Step By Step Tutorial for Copies window
Scenario: You have been asked to create a Smart Form where the form will be printed with multiple copies. First Copy should have header “Flight Copy” Second copy should have header “Office Copy” and other copies should have header “Extra Copies”.
1. Open Smart Forms txn SMARTFORMS. Type the form name and click on create.
2. You will be Navigated to this screen.
3. Create Import Parameter for the Form. Goto Form Interface->Import
4. Create Global Data for the Form. Goto Global Definition->Global Data.
Note: Create a Global variable where you can save the page name. Here in this example I have created GV_PAGE
5. Write Code to select data from table.
6. Create a new window and select Copies Window in the window type.
7. Create a Program Line in the Copies Window.
8. Insert the code to differentiate different sheets.
Note: Find the code below.

GV_PAGE = ‘Flight Copy’.
gv_page = ‘Office Copy’.
gv_page = ‘Extra Copies’.
System field SFSY-COPYCOUNT is used to identify query whether the current output is the original or, respectively, which number

the copy has. This helps us to label the sheet.

9. Create a Text in the copies window.


10. Insert the variable which is holding the Page name in between ampersand (&).

Note: To open this editor click on the Txt Editor icon present near the Text area and then navigate to Goto-> Change Editor. To navigate back press F3 or Click on ‘Back’ icon


11. Now your smartform is ready. To test the smartform you can directly click on the Test icon or F8 which will generate the Function Module and further running the Function Module will display you the form. But as I want to show and end to end of how Smartforms work, we will create a Z Program in SE38.

Note: Download attached “ZWINDOWSDEMO_DRIVER.TXT” file for the driver program.


12. Activate and press F8 to execute the driver program. You will be navigated to the below screen. Where you can enter the parameter value and execute.


13. This is the print parameters screen where you can enter the Printing options and copies you want. I have selected 3 here. Click on print preview to preview the output or print to print the output.


14. Output:




Hope I was able to explain copies window in detail. If any queries please leave it on the comments. I will respond as early as possible.



Assigned Tags

      You must be Logged on to comment or reply to a post.
      Author's profile photo Former Member
      Former Member

      Have you had any luck emailing a document with a copies window?  I have attempted to email a native smartform, and a smartform converted to PDF, but I only get the first copy in the email.  Yet, I can print all 4 copies of the smartform without any problems.

      Author's profile photo Mohamed Hani
      Mohamed Hani
      Blog Post Author

      Hi Smith,

      Apologies for a late reply. Did yu specify no. of copies in the print params function module.

      Please let me know if you did so, I will try some work around for you.