Skip to Content
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.
/wp-content/uploads/2013/02/1_181247.jpg
2. You will be Navigated to this screen.
/wp-content/uploads/2013/02/2_181248.jpg
3. Create Import Parameter for the Form. Goto Form Interface->Import
/wp-content/uploads/2013/02/2_1_181249.png
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
/wp-content/uploads/2013/02/2_2_181254.png
5. Write Code to select data from table.
/wp-content/uploads/2013/02/2_3_181255.png
6. Create a new window and select Copies Window in the window type.
/wp-content/uploads/2013/02/3_181256.png
7. Create a Program Line in the Copies Window.
/wp-content/uploads/2013/02/7_181257.png
8. Insert the code to differentiate different sheets.
Note: Find the code below.
/wp-content/uploads/2013/02/8_181258.png

IF SFSY-COPYCOUNT = 001.
GV_PAGE = ‘Flight Copy’.
ELSEIF SFSY-COPYCOUNT = 002.
gv_page = ‘Office Copy’.
ELSE.
gv_page = ‘Extra Copies’.
ENDIF.
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.

/wp-content/uploads/2013/02/9_181259.png

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

/wp-content/uploads/2013/02/10_181260.png

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.

/wp-content/uploads/2013/02/11_181261.png

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.

/wp-content/uploads/2013/02/11_1_181262.png

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.

/wp-content/uploads/2013/02/11_2_181263.png

14. Output:

/wp-content/uploads/2013/02/12_181267.png

/wp-content/uploads/2013/02/13_181271.png

/wp-content/uploads/2013/02/14_181272.png

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.

Regards,

Hani

To report this post you need to login first.

2 Comments

You must be Logged on to comment or reply to a post.

  1. 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.

    (0) 
    1. Mohamed Hani 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.

      Thanks,

      Hani

      (0) 

Leave a Reply