Return to Snippet

Revision: 40861
at February 9, 2011 02:09 by gunshit


Initial Code
*&---------------------------------------------------------------------*
*&      Form  convert_otf_pdf
*&---------------------------------------------------------------------*
form convert_otf_pdf tables itp_otf  structure itcoo
                            itp_soli structure soli.
  data: itl_tline type standard table of tline with header line,
        itl_solix type standard table of solix with header line.
  data: doc_size(12) type c.
  data: begin of isl_fich,
        cont_tot type i,
        cont_tmp type i,
        end of isl_fich.
  data: lv_bin_file type xstring.

  field-symbols: <ptr_hex> type solix.


  data: str_acp like arc_params.
  data: str_aci like toa_dara.


  call function 'CONVERT_OTF_AND_ARCHIVE'
    exporting
     arc_p                          = arc_params
     arc_i                          = toa_dara
     format                         = 'PDF'
*     ARC_TAB                        =
*     ARCHIVE_COPIES                 = ' '
*     MAX_COPIES                     = '001'
    tables
      otf                            = itp_otf
   exceptions
     error_archiv                   = 1
     error_communicationtable       = 2
     error_connectiontable          = 3
     error_kernel                   = 4
     error_parameter                = 5
     error_format                   = 6
     others                         = 7
            .

  call function 'CONVERT_OTF'
    exporting
      format                = 'PDF'
    importing
      bin_filesize          = doc_size
      bin_file              = lv_bin_file
    tables
      otf                   = itp_otf
      lines                 = itl_tline
    exceptions
      err_max_linewidth     = 1
      err_format            = 2
      err_conv_not_possible = 3
      err_bad_otf           = 4
      others                = 5.


  while isl_fich-cont_tot < doc_size.
    isl_fich-cont_tmp = isl_fich-cont_tot + 255.
    if isl_fich-cont_tmp > doc_size.
      isl_fich-cont_tmp = strlen( lv_bin_file+isl_fich-cont_tot ).
      itl_solix-line = lv_bin_file+isl_fich-cont_tot(isl_fich-cont_tmp)
      .
      append itl_solix.
      exit.
    else.
      itl_solix-line = lv_bin_file+isl_fich-cont_tot.
      isl_fich-cont_tot = isl_fich-cont_tmp.
      append itl_solix.
    endif.
  endwhile.

  loop at itl_solix.
    assign itp_soli to <ptr_hex> casting.
    move itl_solix to <ptr_hex>.
    append itp_soli.
  endloop.

endform.                    " convert_otf_pdf

Initial URL

                                

Initial Description

                                

Initial Title
ABAP - Generar OTF y Archivar

Initial Tags

                                

Initial Language
Other