Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Problem in Smart Forms

Hi all,

The issue is as follows:

We have a custom designed Smart form. Whenever I execute that form generated FM, it gets executed and shows the print preview. But once if I use this FM in any other custom FM as shown below, it gives error message and gets terminated. The error text I get is An SQL error occurred while accessing a table. When I execute it via a Break Point, it gets terminated just at the call of the FM /1BCDWB/SF00000357. I have included the code for reference, below. Pls give me your valuable ideas.

data: l_pdf_xstring  type xstring,
      lt_lines       type table of tline,
      ls_line        type tline,
      l_pdf_len      type i.

data: output_options      type ssfcompop,
      control_parameters  type ssfctrlop,
      output_data         type ssfcrescl,
      devtype             type rspoptype.

data: lt_sys type table of ZHEADER1.

control_parameters-langu = sy-langu.
control_parameters-no_dialog = 'X'.
control_parameters-getotf    = 'X'.

select VBELN
       AUART
       VKORG
       VTWEG
       SPART from vbak into table lt_sys.

call function 'SSF_GET_DEVICE_TYPE'
  EXPORTING
    i_language             = sy-langu
  IMPORTING
    e_devtype              = devtype
  EXCEPTIONS
    no_language            = 1
    language_not_installed = 2
    no_devtype_found       = 3
    system_error           = 4
    others                 = 5.

* set device type in output options
output_options-tdprinter = devtype.

call function '/1BCDWB/SF00000357'
  EXPORTING
    user_settings      = space
    control_parameters = control_parameters
    output_options     = output_options
  IMPORTING
    job_output_info    = output_data
  TABLES
    zsystems           = lt_sys
  EXCEPTIONS
    formatting_error   = 1
    internal_error     = 2
    send_error         = 3
    user_canceled      = 4
    others             = 5.


call function 'CONVERT_OTF'
  EXPORTING
    format                = 'PDF'
  IMPORTING
    bin_filesize          = l_pdf_len
    bin_file              = l_pdf_xstring
  TABLES
    OTF                   = OUTPUT_DATA-OTFDATA
    LINES                 = LT_LINES
  EXCEPTIONS
    err_max_linewidth     = 1
    err_format            = 2
    err_conv_not_possible = 3
    err_bad_otf           = 4
    others                = 5.

if sy-subrc EQ 0.

  l_pdf_len = xstrlen( l_pdf_xstring ).
  write:/ l_pdf_len.

ENDIF.

Thanks & Regards,

Ravikiran.C

Tags:
Not what you were looking for? View more on this topic or Ask a question