cancel
Showing results for 
Search instead for 
Did you mean: 

smart forms in web dynpro abap

ankit_jain3
Member
0 Kudos

how to use smart forms in web dynpro abap ????

what are the steps??

Accepted Solutions (1)

Accepted Solutions (1)

former_member229979
Participant
0 Kudos

Dear Ankit,

Follow the steps:

1. Call the Smartform FM to get the output of the form.

2. Convert the form output in PDF form. Use FM 'CONVERT_TO_OTF'.

3. Bind this PDF data to context element.

4. On WD view layout, set the interactive form UI element.

5. Bind this UI element with the context element to which PDF source was mapped.

6. Save and activate.

Mark points if helpful.

Former Member
0 Kudos

hello Megha,

I tried the same method and way but no output is coming in lv_ssf_output.

IMPORTING
    JOB_OUTPUT_INFO            lv_ssf_output.

and sy-subrc = 1.

can you help me in this.

Thanks in Advance.

BR

chandra.

Answers (3)

Answers (3)

Former Member
0 Kudos

I have created the webdynpro application using the above method. I want to navigate between the pdf pages using webdynpro buttons rather than the inbuilt pdf arrows for navigation......Is it possible ?

Former Member
0 Kudos

Hi Ankit,

1.create a node(Eg:PDF) with attribute(SOURCE type xstring )

2.use Interactiveform UI element in the view

3.Bind the pdfSource property of the UI to the attribute SOURCE

4.in method write logic for call the smart form

Pass the output of the smartform function call to

function module CONVERT_OTF to convert it to PDF data.

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.

Thanks

Chinnaiya P

Former Member
0 Kudos

Hi,

I m using the same what u have mentioned here. It is working fine in development server. But in Quality Server it was throwing a emplty screen with sy-subrc = 1. Please help me to solve this..

Former Member
0 Kudos

Hi Ankit,

Search the sdn you will ge tlot of post,wikis,documents on this.

one of the link i could find out

Hope this might help you.

Pooja