Wednesday, February 24, 2010

Dealing With Multiple Copies

Scenario: There are times when the client wanted to print 4 copies for each of their Delivery Order (DO) form (all with the same DO number). They want different texts to be printed on each of the 4 copies.

Solution:

1. Create a new window with the Window Type - 'Copies Window'.

2. Select 'Only Copies - Copies Differ'.

3. Insert program lines or texts under the node, as in my case:

    - page 1 should print 'Delivery Copy'
    - page 2 should print 'Warehouse Copy'
    - page 3 should print 'Vendor Copy'
    - page 4 should print 'Area Manager Copy'

4. The current 'Copy Number' can be obtained using &SFSY-COPYCOUNT&.

5. Or if you don't want to refer to it directly so you can manipulate it in you program line, just declare a global variable and move the value to your own variable, e.g:

    @Global Definitions:
        gv_copycount LIKE sfsy-copycount.

    @Program Lines:
       MOVE sfsy-copycount TO gv_copycount. 
       IF gv_copycount = '001'.
         gv_copytext = 'Delivery Copy'.
       ENDIF.


With Much Love,
The Rookie ABAPer

No comments:

Post a Comment