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

Smartform OTF data table always empty

Former Member
0 Likes
6,662

Hi,

Whenever I call the below function the OTF table in the job_output_info is always empty. This means I can't proceed to calling FM 'CONVERT_OTF' for convering to PDF.

All the other XML output tables are populated correctly and smartform can be sent via e-mail.  I have seen a good few threads here, some people have said they've solved it themselves without giving the solution, and I saw one that said the Smartform attributes needed to change? I thought setting the getotf flag to 'X' was all I needed.

Any ideas would be greatly appreciated. Thanks

  ls_output_options-tdimmed = space.
  ls_output_options-tdnewid = space.
  ls_control_parameters-no_dialog = 'X'.
  ls_control_parameters-getotf = 'X'.
  ls_control_parameters-langu     = sy-langu.
  ls_control_parameters-preview = space.

    CALL FUNCTION l_fm_name
    EXPORTING
      control_parameters = ls_control_parameters
      output_options     = ls_output_options
      user_settings      = space
      ls_input           = gt_detail
      i_count            = l_count
      l_entry            = '10/12'
      l_entry1           = '01.01.2013'
      lt_header          = lt_newrpt
      ls_vendor          = gs_lfa1
    IMPORTING
      job_output_info    = ls_output_data
    EXCEPTIONS
      formatting_error   = 1
      internal_error     = 2
      send_error         = 3
      user_canceled      = 4
      OTHERS             = 5.

** ls_output_data-otfdata[] empty.

5 REPLIES 5
Read only

Former Member
0 Likes
3,083

Hi,

Change the variable

  ls_output_options-tdimmed = 'X'.
  ls_output_options-tdnewid =
'X'.

Read only

PeterJonker
Active Contributor
0 Likes
3,083

Are you sure that there is data to output in your parameter ls_output_data. Also did you check sy-subrc after the fm call ? Is it 0 ?

According to SAP Help the otf should Always be filled. Therefore I think you might have no data in otfdata[], because there is nothing to output or an error occurred in the processing of the smartform.

Regards,

Peter Jonker

Read only

Former Member
0 Likes
3,083

Success at last! I needed to set the below two flags in order for OTF to work. Sai, the reason I don't set the flags you mentioned is because this will all happen in the background so I don't want the print popup. Thanks for the replies

  ls_output_options-xdfcmode = 'X'.
  ls_output_options-xsfcmode = 'X'.

Read only

Former Member
0 Likes
3,083

Hi,

DATA:
t_otf
TYPE itcoo OCCURS0WITHHEADERLINE,

t_otf_from_fm TYPE ssfcrescl,

w_cparam TYPE ssfctrlop.

w_cparam-getotf = 'X'.

CALL FUNCTION w_fmodule
EXPORTING
* ARCHIVE_INDEX =
* ARCHIVE_INDEX_TAB =
* ARCHIVE_PARAMETERS =
control_parameters = w_cparam
* MAIL_APPL_OBJ =
* MAIL_RECIPIENT =
* MAIL_SENDER =
*output_options = w_outoptions
* USER_SETTINGS = 'X'
IMPORTING
* DOCUMENT_OUTPUT_INFO =
job_output_info = t_otf_from_fm
* JOB_OUTPUT_OPTIONS =
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.

t_otf[] = t_otf_from_fm-otfdata[].

Hope your problem will be solved....

Thanks

Sabyasachi