• ABAP FORM打印转PDF/pdf 预览


    function ZSTXBC_SSFCOMP_PDF_PREVIEW.
    *"--------------------------------------------------------------------
    *"*"Local Interface:
    *"  IMPORTING
    *"     REFERENCE(I_OTF) TYPE  TSFOTF
    *"  EXCEPTIONS
    *"      CONVERT_OTF_TO_PDF_ERROR
    *"      CNTL_ERROR
    *"--------------------------------------------------------------------
    data: l_dummy type standard table of tline.
    
      clear: pdf_data, pdf_size.
    
    * convert otf to pdf
      call function 'CONVERT_OTF'
           exporting
                format                = 'PDF'
           importing
                bin_filesize          = pdf_size
                bin_file              = pdf_data
           tables
                otf                   = i_otf[]
                lines                 = l_dummy
           exceptions
                err_max_linewidth     = 1
                err_format            = 2
                err_conv_not_possible = 3
                others                = 4.
    
      if sy-subrc <> 0.
        raise convert_otf_to_pdf_error.
      endif.
    
      call screen 0300 starting at 1 1.
    
    endfunction.
    

    *&+++转换成PDF
            LT_OTF[] = LS_OTFDATA-OTFDATA[].
            CALL FUNCTION 'CONVERT_OTF'
              EXPORTING
                FORMAT                'PDF'
                MAX_LINEWIDTH         132
    *           ARCHIVE_INDEX         = ' '
    *           COPYNUMBER            = 0
    *           ASCII_BIDI_VIS2LOG    = ' '
    *           PDF_DELETE_OTFTAB     = ' '
    *           PDF_USERNAME          = ' ' "don't exist
    *           PDF_PREVIEW           = ' ' "don't exist
    *           USE_CASCADING         = ' ' "don't exist
              IMPORTING
                BIN_FILESIZE          = L_BIN_FILESIZE
    *           BIN_FILE              =
              TABLES
                OTF                   = LT_OTF
                LINES                 = LT_LINES "t_pdf_tab
              EXCEPTIONS
                ERR_MAX_LINEWIDTH     1
                ERR_FORMAT            2
                ERR_CONV_NOT_POSSIBLE 3
                ERR_BAD_OTF           4
                OTHERS                5.

    *&PDF 预览
            CALL FUNCTION 'ZSTXBC_SSFCOMP_PDF_PREVIEW'
              EXPORTING
                I_OTF                    = LT_OTF[]
              EXCEPTIONS
                CONVERT_OTF_TO_PDF_ERROR 1
                CNTL_ERROR               2
                OTHERS                   3.

    *&*********************************************************

     

     

  • 相关阅读:
    Knative Serving 进阶: Knative Serving SDK 开发实践
    从求生存到修体系,我在阿里找到了技术人的成长模式
    K8s 学习者绝对不能错过的最全知识图谱(内含 56个知识点链接)
    P1197 [JSOI2008]星球大战
    P1311 选择客栈
    P2822 组合数问题
    贪心 加工生产调度
    P3375 【模板】KMP字符串匹配
    P1025 数的划分
    P1019 单词接龙
  • 原文地址:https://www.cnblogs.com/rainysblog/p/6279488.html
Copyright © 2020-2023  润新知