Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Output device tddest in smartforms

soumya_jose3
Active Contributor
0 Likes
3,540

Hi,

I am using smartforms to convert the otf data to pdf. The coding is as follows:



* Set the Parameters of smartform
  l_s_ssfctrlop-no_dialog   = 'X'.
  l_s_ssfctrlop-getotf      = 'X'.
  l_s_output_options-tdnoprint = 'X'.


* call FM to get the name of the FM of smart for smart form
  CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
    EXPORTING
      formname           = g_form_name
    IMPORTING
      fm_name            = l_fm_name
    EXCEPTIONS
      no_form            = 1
      no_function_module = 2
      OTHERS             = 3.

  IF sy-subrc <> 0.
    MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
            WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
  ENDIF.

  CALL FUNCTION l_fm_name
    EXPORTING
      control_parameters = l_s_ssfctrlop
      output_options     = l_s_output_options
      user_settings      = ' '
    IMPORTING
      job_output_info    = l_s_job_output_info
    TABLES
      g_t_datatab        = g_t_datatab
    EXCEPTIONS
      formatting_error   = 1
      internal_error     = 2
      send_error         = 3
      user_canceled      = 4
      OTHERS             = 5.
  IF sy-subrc <> 0.
    MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
            WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
  ENDIF.

  REFRESH g_t_pdf_tab.
*Convert to OTF Format
  CALL FUNCTION 'CONVERT_OTF'
    EXPORTING
      format                = 'PDF'
    IMPORTING
      bin_filesize          = l_byte_count
    TABLES
      otf                   = l_s_job_output_info-otfdata[]
      lines                 = g_t_pdf_tab
    EXCEPTIONS
      err_max_linewidth     = 1
      err_format            = 2
      err_conv_not_possible = 3
      OTHERS                = 4.
  IF sy-subrc <> 0.
    MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
            WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
  ENDIF.

I am not passing tddest (output device) to 'l_s_output_options' as I don't want to print it.

I just want to convert the otf data obtained to pdf and use it for further processing.

Will there be any problem if I don't assign any ouput device.

Please note that in the system ouput device 'LOCL' is not maintained.

Thanks,

Soumya.

Hi,

I am using smartforms to convert the otf data to pdf. The coding is as follows:



* Set the Parameters of smartform
  l_s_ssfctrlop-no_dialog   = 'X'.
  l_s_ssfctrlop-getotf      = 'X'.
  l_s_output_options-tdnoprint = 'X'.


* call FM to get the name of the FM of smart for smart form
  CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
    EXPORTING
      formname           = g_form_name
    IMPORTING
      fm_name            = l_fm_name
    EXCEPTIONS
      no_form            = 1
      no_function_module = 2
      OTHERS             = 3.

  IF sy-subrc <> 0.
    MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
            WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
  ENDIF.

  CALL FUNCTION l_fm_name
    EXPORTING
      control_parameters = l_s_ssfctrlop
      output_options     = l_s_output_options
      user_settings      = ' '
    IMPORTING
      job_output_info    = l_s_job_output_info
    TABLES
      g_t_datatab        = g_t_datatab
    EXCEPTIONS
      formatting_error   = 1
      internal_error     = 2
      send_error         = 3
      user_canceled      = 4
      OTHERS             = 5.
  IF sy-subrc <> 0.
    MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
            WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
  ENDIF.

  REFRESH g_t_pdf_tab.
*Convert to OTF Format
  CALL FUNCTION 'CONVERT_OTF'
    EXPORTING
      format                = 'PDF'
    IMPORTING
      bin_filesize          = l_byte_count
    TABLES
      otf                   = l_s_job_output_info-otfdata[]
      lines                 = g_t_pdf_tab
    EXCEPTIONS
      err_max_linewidth     = 1
      err_format            = 2
      err_conv_not_possible = 3
      OTHERS                = 4.
  IF sy-subrc <> 0.
    MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
            WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
  ENDIF.

I am not passing tddest (output device) to 'l_s_output_options' as I don't want to print it.

I just want to convert the otf data obtained to pdf and use it for further processing.

Will there be any problem if I don't assign any ouput device.

Please note that in the system ouput device 'LOCL' is not maintained.

Thanks,

Soumya.

2 REPLIES 2
Read only

Former Member
0 Likes
1,560

Hi Soumya,

Even if you put the printer for output_options, as long as control parameter-getotf was marked as 'X', it will not print the output.

Let me know if you still have question.

Val

Read only

0 Likes
1,560

Hi Valerie,

I am using below code to get the printer name by default , even i want to skip that screen that asks for the printer name. But am unable to get this requirement. I have tried with various combinations but its not working. Please suggest.

control-preview = 'X'.

control-no_dialog = SPACE.

output_options-tddest = 'LP01'.


  CALL FUNCTION lv_fmname
EXPORTING
output_options     = output_options
contol             = control

  p_matnr            = p_matnr
  user_settings      = 'X'
    TABLES
  gt_stpo            = gt_stpo
  EXCEPTIONS
    formatting_error   = 1
    internal_error     = 2
     send_error         = 3

     user_cancelled     = 4
     OTHERS             = 5.

Thanks & Regards

Jatin