on 06-06-2012 1:16 PM
Hi guru's
While execting smartform from driver program its working properly.
but while calling smartform from webdynpro by using fucction module name its turns to formattiing error in sy-subrc.
Is any settings need to do?
Regards,
Meena
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Meena,
There is setting we need to do in SU01.
Try to maintain default output device for the user who is running that WD.
Thanks,
Vengadesh R
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
May be this helps you:
Call the Smartform FM to get the output of the form.
Convert the form output in PDF form. Use FM 'CONVERT_TO_OTF'.
Bind this PDF data to context element.
On WD view layout, set the interactive form UI element.
Bind this UI element with the context element to which PDF source was mapped.
Save and activate.
Example Code:
method displaypdf .
data : l_x(1) value 'X'.
data: lv_text type char3,
lv_syucomm type char1,
ls_pdf type xstring,
lv_fm_name type rs38l_fnam,
lv_control_parameters type ssfctrlop,
lv_output_options type ssfcompop,
lv_ssf_output type ssfcrescl,
lt_otfdata type table of itcoo.
data:
node_input1 type ref to if_wd_context_node,
elem_input1 type ref to
if_wd_context_element,
stru_input1 type
ig_componentcontroller=>element_zinput.
* navigate from <CONTEXT> to <INPUT1> via lead selection
node_input1 = wd_context->get_child_node( name
ig_componentcontroller=>wdctx_zinput ).
* get element via lead selection
elem_input1 = node_input1->get_element( ).
* get all declared attributes
elem_input1->get_static_attributes(
importing
static_attributes = stru_input1 ).
call function 'SSF_FUNCTION_MODULE_NAME'
exporting
formname = 'ZSMARTFORM_NAME'
importing
fm_name = lv_fm_name
exceptions
no_form = 1
no_function_module = 2
others = 3
.
if sy-subrc <> 0.
* Error MESSAGE
endif.
* Set relevant control parameters
lv_control_parameters-getotf = l_x. "OTF output
lv_control_parameters-no_dialog = l_x. "No print dialog
lv_control_parameters-preview = space. "No preview
* Set relevant output options
lv_output_options-tdnewid = l_x. "Print parameters,
lv_output_options-tddelete = space. "Print parameters,
call function lv_fm_name
exporting
* ARCHIVE_INDEX * ARCHIVE_INDEX_TAB *
ARCHIVE_PARAMETERS control_parameters = lv_control_parameters
* MAIL_APPL_OBJ * MAIL_RECIPIENT * MAIL_SENDER
output_options = lv_output_options
user_settings = space
pernr = stru_input1-zpernr
reinr = stru_input1-zreinr
pdvrs = stru_input1-zpdvrs
importing
* DOCUMENT_OUTPUT_INFO job_output_info = lv_ssf_output
* 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.
refresh lt_otfdata.
lt_otfdata[] = lv_ssf_output-otfdata[].
call function 'SSFCOMP_PDF_PREVIEW'
exporting
i_otf = lt_otfdata
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.
data: l_dummy type standard table of tline,
pdf_data type xstring,
pdf_size type i.
clear: pdf_data, pdf_size.
* convert otf to pdf
call function 'CONVERT_OTF'
exporting
format = 'PDF'
importing
bin_filesize = pdf_size
bin_file = pdf_data
tables
otf = lt_otfdata[]
lines = l_dummy
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.
data:
node_pdf type ref to if_wd_context_node,
elem_pdf type ref to
if_wd_context_element,
stru_pdf type
if_componentcontroller=>element_pdf ,
item_source like stru_pdf-source.
* navigate from <CONTEXT> to <PDF> via lead selection
node_pdf = wd_context->get_child_node( name if_componentcontroller=>wdctx_pdf ).
* get element via lead selection
elem_pdf = node_pdf->get_element( ).
* set single attribute
elem_pdf->set_attribute(
exporting
name = `SOURCE`
value = pdf_data ).
endmethod.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
89 | |
10 | |
9 | |
9 | |
9 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.