cancel
Showing results for 
Search instead for 
Did you mean: 

Getting run time error while calling smartform

Former Member
0 Kudos

hi,

Am getting run time error "please maintain output device in your master data" while calling smart form.

I have hardcoded the printer name in output options as shown:-

outputoptions-xsfcmode = 'X' .

p_output_options-xsf = space .

p_output_options-xdfcmode = 'X' .

p_output_options-xdf = space .

p_output_options-tddest = 'LP01'.

p_output_options-tdnewid = 'X'.

p_output_options-tddelete = SPACE.

p_control_parameters-no_dialog = 'X' .

p_control_parameters-getotf = 'X' .

p_control_parameters-DEVICE = 'PRINTER'.

and then am calling function module

CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'

EXPORTING

FORMNAME = form_name

  • VARIANT = ' '

  • DIRECT_CALL = ' '

IMPORTING

FM_NAME = fm_name

  • EXCEPTIONS

  • NO_FORM = 1

  • NO_FUNCTION_MODULE = 2

  • OTHERS = 3

.

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Neha,

I dont know how to workout this....

but I have displayed smartforms using different method :

i.e.using InteractiveForms UI Element:

It is quiet simple

Download PDF file from liunk below:

https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/f0de1eb8-0b98-2910-7996-8a3c2fcf...

Award points If found useful.

Former Member
0 Kudos

i have used the same method using same PDF still am getting this error.i will show the whole code to you:-

method DISPLAY_PDF .

DATA : wa_it_display type ZHPAYSLIP ,

GI_it_display type table of ZHPAYSLIP,

p_output_options type ssfcompop ,

p_job_output_info type ssfcrescl ,

p_control_parameters type ssfctrlop .

DATA : p_bin_filesize type i ,

p_bin_file type xstring ,

p_otf type table of itcoo ,

p_lines type table of tline .

p_output_options-xsfcmode = 'X' .

p_output_options-xsf = space .

p_output_options-xdfcmode = 'X' .

p_output_options-xdf = space .

  • p_output_options-tddest = 'LP01'.

p_output_options-tdnewid = 'X'.

p_output_options-tddelete = SPACE.

p_output_options-tddest = 'LOCL'.

p_output_options-tdprinter = 'PDF1'.

p_control_parameters-no_dialog = 'X' .

p_control_parameters-getotf = 'X' .

p_control_parameters-preview = space.

  • wa_it_display-zz_start_date = '20050401' .

  • wa_it_display-zz_end_date = '20050430' .

wa_it_display-zz_emp_num = '44444' .

append wa_it_display to gi_it_display .

data: lv_pernr type pernr-pernr ,

lv_begda type p0105-begda ,

lv_endda type p0105-endda .

data : form_name type tdsfname value 'ZMAINPAYSLIP',

fm_name type rs38l_fnam.

CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'

EXPORTING

FORMNAME = form_name

  • VARIANT = ' '

  • DIRECT_CALL = ' '

IMPORTING

FM_NAME = 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 fm_name

EXPORTING

  • ARCHIVE_INDEX =

  • ARCHIVE_INDEX_TAB =

  • ARCHIVE_PARAMETERS =

CONTROL_PARAMETERS = p_control_parameters

  • MAIL_APPL_OBJ =

  • MAIL_RECIPIENT =

  • MAIL_SENDER =

OUTPUT_OPTIONS = p_output_options

  • USER_SETTINGS = 'X'

IMPORTING

  • DOCUMENT_OUTPUT_INFO =

JOB_OUTPUT_INFO = p_job_output_info

  • JOB_OUTPUT_OPTIONS = tab_otf_data

TABLES

GI_DISPLAY = gi_it_display

  • 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.

p_otf[] = p_job_output_info-otfdata[].

CALL FUNCTION 'SSFCOMP_PDF_PREVIEW'

EXPORTING

I_OTF = p_otf[]

EXCEPTIONS

CONVERT_OTF_TO_PDF_ERROR = 1

CNTL_ERROR = 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 'CONVERT_OTF'

EXPORTING

FORMAT = 'PDF'

  • MAX_LINEWIDTH = 132

  • ARCHIVE_INDEX = ' '

  • COPYNUMBER = 0

  • ASCII_BIDI_VIS2LOG = ' '

  • PDF_DELETE_OTFTAB = ' '

IMPORTING

BIN_FILESIZE = p_bin_filesize

BIN_FILE = p_bin_file

TABLES

OTF = p_otf[]

LINES = p_lines

  • EXCEPTIONS

  • ERR_MAX_LINEWIDTH = 1

  • ERR_FORMAT = 2

  • ERR_CONV_NOT_POSSIBLE = 3

  • ERR_BAD_OTF = 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.

DATA lo_nd_cn_pdf TYPE REF TO if_wd_context_node.

DATA lo_el_cn_pdf TYPE REF TO if_wd_context_element.

  • DATA ls_cn_pdf TYPE wd_this->element_cn_pdf.

  • navigate from <CONTEXT> to <CN_PDF> via lead selection

lo_nd_cn_pdf = wd_context->get_child_node( name = wd_this->wdctx_cn_pdf ).

  • get element via lead selection

lo_el_cn_pdf = lo_nd_cn_pdf->get_element( ).

  • get all declared attributes

lo_el_cn_pdf->set_attribute(

EXPORTING

name = 'CA_PDF'

value = p_bin_file ).

endmethod.

Former Member
0 Kudos

Hi Neha,

Try only with these many parameters I have specified belw:

As It works for me.

data outop TYPE ssfcompop,

cparam TYPE ssfctrlop.

outop-tdprinter = 'PDF1'.

cparam-no_dialog = 'X' .

cparam-preview = 'X'.

cparam-getotf = 'X'.

Even though If it does not work ,

then in SU01, for the same user outputdevice

Path : SU01=>Defaults=>OutputDevice

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

Could the problem possibly be related to the usage of LP01. LP01 generally is used as frontend printing as the output type. This output type will only work with a connection to the SAPGUI so that it can print via the desktop print spooler. In Web Dynpro you would not have any connection to the SAPGUI, and usage of any frontend based printer would fail. Try using a printer that is setup to print via the ABAP spooler instead.