cancel
Showing results for 
Search instead for 
Did you mean: 

Smartform Copies to PDF

Former Member
0 Kudos

Hello experts.

Here is my problem,

I print a Smartform, and this form has 6 identical copies of it, and only a disclaimer at the foot is variable. Everything at this point is OK, the problem begins when I want to convert the Smartform into a PDF file.

I use the parameter job_output_info that returns the FM that calls my Smartform. And then I use the FM CONVERT_OTF, like this:


* Here I call my smartform 
  CALL FUNCTION l_fm_name
    EXPORTING
      control_parameters = w_cparam
      output_options        = w_output_options
      w_zesd_001          = w_zesd_001
    IMPORTING
      job_output_info    = w_otf_from_fm
    TABLES
      t_zesd_002         = t_zesd_002
    EXCEPTIONS
      formatting_error   = 1
      internal_error     = 2
      send_error         = 3
      user_canceled      = 4.
  IF sy-subrc <> 0.

    MESSAGE ID sy-msgid
      TYPE sy-msgty
    NUMBER sy-msgno
      WITH sy-msgv1
           sy-msgv2
           sy-msgv3
           sy-msgv4.
  ENDIF.

data w_otf type ITCOO.

* Here I obtain my OTF table
  t_otf[] = w_otf_from_fm-otfdata[].

* Convert from OTF to PDF
  call function 'CONVERT_OTF'
       exporting
            format                = 'PDF'
            COPYNUMBER            = 1
       importing
            bin_filesize          = pdf_size
            bin_file              = pdf_data
       tables
            otf                   = t_otf[]
            lines                 = t_docs
       exceptions
            err_max_linewidth     = 1
            err_format            = 2
            err_conv_not_possible = 3
            others                = 4.

The problem is that the FM only prints 1 of the 6 copies of the Smartform. I send in the parameter COPYNUMBER the FM CONVERT_OTF the number of the copy I want to print (by default 0), but the FM does not print all of the 6 copies.

Any suggestions? Or any other method to print a Smartform and all of its copies as a PDF file?

Best Regards!

Accepted Solutions (0)

Answers (1)

Answers (1)

satyajit_mohapatra
Active Contributor
0 Kudos

Try using field TDCOPIES of parameter OUTPUT_OPTIONS of the smartform FM instead of using the COPYNUMBER parameter of FM CONVERT_OTF.