Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

CONVERT_OTFSPOOLJOB_2_PDF

Former Member
0 Kudos
3,044

Hi,

    I am using function module CONVERT_OTFSPOOLJOB_2_PDF to convert spool request to pdf format. Everything work fine when the spool is little but when my spool is big I still have return parameters sy-subrc = 0 but the file resulting from the conversion is empty. Here is the code I use for the function call.

CALL FUNCTION 'CONVERT_OTFSPOOLJOB_2_PDF'

EXPORTING

src_spoolid = i_rspoid

no_dialog = 'X'

IMPORTING

pdf_bytecount = ltpi_bytes

TABLES

pdf = lta_pdf

EXCEPTIONS

err_no_otf_spooljob = 1

err_no_spooljob = 2

err_no_permission = 3

err_conv_not_possible = 4

err_bad_dstdevice = 5

user_cancelled = 6

err_spoolerror = 7

err_temseerror = 8

err_btcjob_open_failed = 9

err_btcjob_submit_failed = 10

err_btcjob_close_failed = 11.

Regards,

2 REPLIES 2

surajarafath
Contributor
0 Kudos
392

Try to pass PDF_DESTINATION = 'X' in the FM and see whether you can see the BIN_FILE(Xstring) in the exporting parameter.

If xstring shows something, then convert the xstring to pdf table

*Get tab PDF
  CALL FUNCTION 'SCMS_XSTRING_TO_BINARY'
    EXPORTING
      buffer     = xstring
    TABLES
      binary_tab =  lta_pdf.

Former Member
0 Kudos
392

Hi ,

Please try using Function module

      call function 'CONVERT_OTF_2_PDF'
        importing
          bin_filesize           = lv_binfilesize
        tables
          otf                    = lv_job_output_info-otfdata
          doctab_archive         = lt_docs
          lines                  = lt_lines
        exceptions
          err_conv_not_possible  = 1
          err_otf_mc_noendmarker = 2
          others                 = 3.

Regards,