Skip to Content
0
Former Member
May 12, 2011 at 07:54 AM

Smartform to PDF - incomplete!!

63 Views

Dear experts,

I have a smartform and i want to convert to PDF. I use the following control, but the problem is that the converting is incomplete: the smartforms only convert the main table, logo and the nº page. I have another windows and text that it doesnt' appear:

any idea?

thank you.


      CALL FUNCTION g_name_form
        EXPORTING
          CONTROL_PARAMETERS = st_control_parameters
          OUTPUT_OPTIONS     = st_output_options
          USER_SETTINGS      = ' '
          XEKKO              = ty_po_data-xekko
          is_nast            = nast
          t_portes           = t_portes
        IMPORTING
          document_output_info  = st_document_output_info
          job_output_info       = st_job_output_info
          JOB_OUTPUT_OPTIONS = ls_output_options

        TABLES
          it_main            = t_main
          it_lines           = t_lines
        EXCEPTIONS
          FORMATTING_ERROR   = 1
          INTERNAL_ERROR     = 2
          SEND_ERROR         = 3
          USER_CANCELED      = 4
          OTHERS             = 5.


DATA: v_filename               TYPE string,
      v_bin_filesize           TYPE i,
      v_fm_name                TYPE rs38l_fnam,
          v_name                   TYPE string,
      v_path                   TYPE string,
      v_fullpath               TYPE string,
      v_filter                 TYPE string.

DATA: it_otf      TYPE STANDARD TABLE OF itcoo,
      it_docs     TYPE STANDARD TABLE OF docs,
      it_lines    TYPE STANDARD TABLE OF tline,
       v_uact                   TYPE i,
      v_guiobj                 TYPE REF TO cl_gui_frontend_services.
*.........................CONVERT TO OTF TO PDF.......................*

  CALL FUNCTION 'CONVERT_OTF_2_PDF'
    IMPORTING
      bin_filesize   = v_bin_filesize
    TABLES
      otf            = st_job_output_info-otfdata
      doctab_archive = it_docs
      lines          = it_lines
    EXCEPTIONS
      err_conv_not_possible  = 1
      err_otf_mc_noendmarker = 2
      OTHERS                            = 3.
*........................GET THE FILE NAME TO STORE....................*
  CONCATENATE 'smrt' '.pdf' INTO v_name.
  CREATE OBJECT v_guiobj.
  CALL METHOD v_guiobj->file_save_dialog
    EXPORTING
      default_extension  = 'pdf'
      default_file_name  = v_name
      file_filter        = v_filter
    CHANGING
      filename           = v_name
      path               = v_path
      fullpath           = v_fullpath
      user_action        = v_uact.
  IF v_uact = v_guiobj->action_cancel.
    EXIT.
  ENDIF.
*..................................DOWNLOAD AS FILE....................*

  MOVE v_fullpath TO v_filename.
  CALL FUNCTION 'GUI_DOWNLOAD'
    EXPORTING
      bin_filesize     = v_bin_filesize
      filename         = v_filename
      filetype         = 'BIN'
    TABLES
      data_tab         = it_lines
    EXCEPTIONS
      file_write_error        = 1
      no_batch                = 2
      gui_refuse_filetransfer = 3
      invalid_type            = 4
      no_authority            = 5
      unknown_error           = 6
      header_not_allowed      = 7
      separator_not_allowed   = 8
      filesize_not_allowed    = 9
      header_too_long         = 10
      dp_error_create         = 11
      dp_error_send           = 12
      dp_error_write          = 13
      unknown_dp_error        = 14
      access_denied           = 15
      dp_out_of_memory        = 16
      disk_full               = 17
      dp_timeout              = 18
      file_not_found          = 19
      dataprovider_exception  = 20
      control_flush_error     = 21
      OTHERS                  = 22.

Edited by: Markus C. on May 12, 2011 9:55 AM