on 12-05-2007 2:26 PM
Hi,
I have followed the steps for converting a smartform to a PDF file. But the OTF data table is initial.
Can someone point me to what i am doing wrong?
Best regards
Lisa M Simonsen
Hi,
Try this code in the initialisation of the code.
DATA: ws_ctrlpara TYPE ssfctrlop,
ws_opoption TYPE ssfcompop,
ws_opinfo TYPE ssfcrescl,
wi_otfdata TYPE tsfotf.
CLEAR ws_ctrlpara.
ws_ctrlpara-getotf = 'X'.
ws_ctrlpara-no_dialog = 'X'.
ws_ctrlpara-preview = space.
ws_opoption-tdprinter = text-element.
While calling smartform you call it like this:
CALL FUNCTION v_frmname
EXPORTING
ARCHIVE_INDEX =
ARCHIVE_INDEX_TAB =
ARCHIVE_PARAMETERS =
control_parameters = ws_ctrlpara
MAIL_APPL_OBJ =
MAIL_RECIPIENT =
MAIL_SENDER =
output_options = ws_opoption
user_settings = 'X'
IMPORTING
DOCUMENT_OUTPUT_INFO =
job_output_info = ws_opinfo
JOB_OUTPUT_OPTIONS =
TABLES
wi_invoice = wi_invoice1(table where data is stored)
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.
Then you write this:
MOVE ws_opinfo-otfdata[] TO wi_otfdata[].
Then you can use this FM:
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
lines = wi_mtab_pdf
EXCEPTIONS
err_conv_not_possible = 1
err_otf_mc_noendmarker = 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.
This will convert smartform into PDF.
Now the table wi_mtab_pdf will contain the PDF form and you can download it using gui_download fm.
Hope this help.
Reward if useful.
Sushil
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
it helps when one uncomments the expoting parameters of the FM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Lisa Mari,
Do you parameter this ( <i>At the Samrtforms FM call</i> 😞
st_ssfctrlop-getotf = 'X'
?
And do you retrieve in the following table : st_ssfcrescl-otfdata. ?
Erwan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
78 | |
9 | |
9 | |
7 | |
7 | |
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.