ABAP - Generar OTF y Archivar


/ Published in: Other
Save to your folder(s)



Copy this code and paste it in your HTML
  1. *&---------------------------------------------------------------------*
  2. *& Form convert_otf_pdf
  3. *&---------------------------------------------------------------------*
  4. form convert_otf_pdf tables itp_otf structure itcoo
  5. itp_soli structure soli.
  6. data: itl_tline type standard table of tline with header line,
  7. itl_solix type standard table of solix with header line.
  8. data: doc_size(12) type c.
  9. data: begin of isl_fich,
  10. cont_tot type i,
  11. cont_tmp type i,
  12. end of isl_fich.
  13. data: lv_bin_file type xstring.
  14.  
  15. field-symbols: <ptr_hex> type solix.
  16.  
  17.  
  18. data: str_acp like arc_params.
  19. data: str_aci like toa_dara.
  20.  
  21.  
  22. call function 'CONVERT_OTF_AND_ARCHIVE'
  23. exporting
  24. arc_p = arc_params
  25. arc_i = toa_dara
  26. format = 'PDF'
  27. * ARC_TAB =
  28. * ARCHIVE_COPIES = ' '
  29. * MAX_COPIES = '001'
  30. tables
  31. otf = itp_otf
  32. exceptions
  33. error_archiv = 1
  34. error_communicationtable = 2
  35. error_connectiontable = 3
  36. error_kernel = 4
  37. error_parameter = 5
  38. error_format = 6
  39. others = 7
  40. .
  41.  
  42. call function 'CONVERT_OTF'
  43. exporting
  44. format = 'PDF'
  45. importing
  46. bin_filesize = doc_size
  47. bin_file = lv_bin_file
  48. tables
  49. otf = itp_otf
  50. lines = itl_tline
  51. exceptions
  52. err_max_linewidth = 1
  53. err_format = 2
  54. err_conv_not_possible = 3
  55. err_bad_otf = 4
  56. others = 5.
  57.  
  58.  
  59. while isl_fich-cont_tot < doc_size.
  60. isl_fich-cont_tmp = isl_fich-cont_tot + 255.
  61. if isl_fich-cont_tmp > doc_size.
  62. isl_fich-cont_tmp = strlen( lv_bin_file+isl_fich-cont_tot ).
  63. itl_solix-line = lv_bin_file+isl_fich-cont_tot(isl_fich-cont_tmp)
  64. .
  65. append itl_solix.
  66. exit.
  67. else.
  68. itl_solix-line = lv_bin_file+isl_fich-cont_tot.
  69. isl_fich-cont_tot = isl_fich-cont_tmp.
  70. append itl_solix.
  71. endif.
  72. endwhile.
  73.  
  74. loop at itl_solix.
  75. assign itp_soli to <ptr_hex> casting.
  76. move itl_solix to <ptr_hex>.
  77. append itp_soli.
  78. endloop.
  79.  
  80. endform. " convert_otf_pdf

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.