Issues with copy window in Smartform and its solutions

Scenario : We got the scenario in which client wants 4 copies of the form with 4 different texts  or multiple copies of smartform .

As we all know,  this can be easily handled by using the copy window in the smartform.

Issue : But some times the concept of copy window does not work. And we get the various copies of smartform with the same content. That is 4 copies of same content and not the 4 different copies with the different content .

Analysis : This issue happens due to  a program error, the system no longer reads any of the parameters that are saved in the table TSP02A. This problem occurs due to the Kernel . Due to this kernel  error, various parameters that are set in a Smart Form does not work. Following are impacted areas.

1.     In a Smart Form, you can use a window of the type “Copies Window”. You can use this to control that the system outputs different texts in the various copies of the form. Due to the kernel error, the system prints the various copies with the same content.

2.     In the print parameters, you can set the “Group (1-1-1, 2-2-2,…)” indicator. The system ignores this indicator.

3.     If you use the Zebra device types mentioned in SAP Note 750002(Support for Zebra label printer (ZPL2))/750772(Information about the ZPL-II printer driver for Smart Forms), you can set attributes such as, S_LZPL_SETUP in the Smart Form using a command node. These no longer work.

There are 2 solutions for the same issue.

Solution  1 : Check the kernel level in the system.

Step  1 :  Goto  transaction SM51.

Step  2 : Click on the ‘Release Notes’.

/wp-content/uploads/2013/11/1_321880.png

Step 3 : Check the kernel patch number .

/wp-content/uploads/2013/11/1_321880.png

For removing the error, apply the corresponding sap patch levels corrected kernel as specified below. And use the copy window to print the different data on different pages.

Software Component Version

Support Package

SP Patch Level

SAP KERNEL 7.20 32-BIT

SP215

000215

SAP KERNEL 7.20 32-BIT UNICODE

SP215

000215

SAP KERNEL 7.20 64-BIT

SP215

000215

SAP KERNEL 7.20 64-BIT UNICODE

SP215

000215

SAP KERNEL 7.21 32-BIT

SP007

000007

SAP KERNEL 7.21 32-BIT UNICODE

SP007

000007

SAP KERNEL 7.21 64-BIT

SP007

000007

SAP KERNEL 7.21 64-BIT UNICODE

SP007

000007

SAP KERNEL 7.21 EXT 32-BIT

SP007

000007

SAP KERNEL 7.21 EXT 32-BIT UC

SP007

000007

SAP KERNEL 7.21 EXT 64-BIT

SP007

000007

SAP KERNEL 7.21 EXT 64-BIT UC

SP007

000007

Solution  2 : Generate multiple  smartforms  in a single spool request.

For this use two function modules ‘SSF_OPEN’ and ‘SSF_CLOSE’.

SSF_OPEN is used for triggering the output device like printers. 

SSF_CLOSE is for closing the output device application.

Following is the general code .

First call the FM ‘SSF_OPEN’.

    CALL FUNCTION ‘SSF_OPEN’
      EXPORTING
        user_settings           = ‘ ‘
        output_options         = ls_outopt     ” SAP Smart Forms: Smart Composer (transfer) options            
        control_parameters  = is_ssfctrlop  “  Smart Forms: Control struct

      EXCEPTIONS
       
formatting_error       = 1
        internal_error           = 2
        send_error               = 3
        user_canceled         = 4
        OTHERS                 = 5.

Then call the smartform in the loop for the number of copies we want.

IS_FMNAME is the FM name generated from smart form from FM ‘SSF_FUNCTION_MODULE_NAME’.

 

WHILE l_copy_count < 4 .
      l_copy_count = l_copy_count + 1.

lv_copy_count  contains the count of the copy .

      

CALL FUNCTION  is_fmname
        EXPORTING          control_parameters  = is_ssfctrlop
          output_options         = ls_outopt
          lv_copy_count          = l_copy_count

       EXCEPTIONS          formatting_error       = 1
          internal_error           = 2
          send_error               = 3
          user_canceled         = 4
          OTHERS                  = 5.

ENDWHILE

Use the secondary window to print the differentiated text on the basis of copy to be printed on the basis of l_copy_count data .

And then use the FM SSF_CLOSE to close the output device application.

Call ‘SSF_CLOSE’
    CALL FUNCTION ‘SSF_CLOSE’
      EXCEPTIONS        formatting_error     = 1
        internal_error         = 2
        send_error             = 3
        OTHERS               = 4.

To report this post you need to login first.

1 Comment

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

Leave a Reply