Please do NOT post the question in multiple forums, you have already posted this in the FORM printing forum
Regards,
Ravi
Note Please close this thread
Hi Santosh,
You can just just print a smart form & that will generate a spool no. You can use that spool no as an input to the report RSTXPDFT4 to display the from in acrobat format.
Regards,
Chetan.
PS: Reward points if you find this helpful.
Hi,
Call this function module immediately after you get the output from your smart form function module.
Your smartform function module will have an output parameter <b>job_output_info </b>
this field is a nested internal table and contain a internal table <b>OTF_DATA</b>
CALL FUNCTION 'HR_IT_DISPLAY_WITH_PDF'
TABLES
otf_table = lt_otf_data (This table is the output from your smartform function module).
Hi Santosh,
<b>1.</b> In the smartform form function module make use of <b>JOB_OUTPUT_INFO</b> which is of type ssfcrescl.
CALL FUNCTION <SMARTFORM_FUNC_NAME>
EXPORTING
control_parameters = ws_ctrlpara
output_options = ws_opoption
user_settings = 'X'
IMPORTING
<b> job_output_info = ws_opinfo</b>
EXCEPTIONS
formatting_error = 1
internal_error = 2
send_error = 3.
After this your WS_OPINFO table gets populated with OTF output for smartform.
<b>2.</b> Now pass <b>WS_OPINFO-OTFDATA[]</b> to function module
<b>CONVERT_OTF_2_PDF</b>.
This will convert OTF output to PDF form.
CALL FUNCTION 'CONVERT_OTF_2_PDF'
EXPORTING
use_otf_mc_cmd = 'X'
IMPORTING
bin_filesize = wl_filesize
TABLES
otf = wi_otfdata
doctab_archive = wi_docs
<b> lines = WI_MTAB_PDF</b>
EXCEPTIONS
err_conv_not_possible = 1
err_otf_mc_noendmarker = 2
OTHERS = 3.
Here <b>WI_MTAB_PDF</b> will contain pdf output which can be downloaded.
WI_MTAB_PDF is declared LIKE tline OCCURS 0 WITH HEADER LINE.
<b>3.</b> This WI_MTAB_PDF can now be downloaded in pdf format using GUI_DOWNLOAD function module.
CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
bin_filesize = wl_mi_bytecount
filename = wl_mc_filename "Path where pdf file is to be downloaded
<b> filetype = 'BIN'</b>
TABLES
<b> data_tab = WI_MTAB_PDF</b>
EXCEPTIONS
file_write_error = 1
no_batch = 2
gui_refuse_filetransfer = 3
invalid_type = 4
Hope this helps you ....
Let me know if you nedd more inputs on this...
Enjoy SAP.
Pankaj Singh.
Add a comment