Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Sap script to pdf

Hi,

We have a sap script and I want that script to be converted into a pdf...so can you please tell me how can I do that.

Thannks.

Rjaeev

Former Member
Former Member replied

hi,

see example code from my print program:

  DATA: otf_data       LIKE itcoo OCCURS 0 WITH HEADER LINE,
        doctab_archive LIKE docs  OCCURS 0 WITH HEADER LINE,
        pdf_lines      LIKE tline OCCURS 0 WITH HEADER LINE.

  DATA: bin_filesize TYPE i.

    CALL FUNCTION 'CLOSE_FORM'
      IMPORTING
        RESULT  = i_itcpp
      TABLES
        otfdata = otf_data
      EXCEPTIONS
        OTHERS  = 1.

    CALL FUNCTION 'CONVERT_OTF_2_PDF'
      IMPORTING
        bin_filesize           = bin_filesize
      TABLES
        otf                    = otf_data
        doctab_archive         = doctab_archive
        lines                  = pdf_lines
      EXCEPTIONS
        err_conv_not_possible  = 1
        err_otf_mc_noendmarker = 2
        OTHERS                 = 3.

    CALL FUNCTION 'SCMS_DOWNLOAD'
      EXPORTING
        filename = 'C:\TEST_PDF.PDF'
        filesize = bin_filesize
        binary   = 'X'
        frontend = 'X'
      TABLES
        data     = pdf_lines
      EXCEPTIONS
        error    = 1
        OTHERS   = 2.

regards,darek

0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question