‎2008 Aug 05 2:55 PM
I have been reading about PDF forms and it says you can create interactive fillable PDF forms using Adobe PDF forms.
But can you not use Smart forms and generate a PDF document using it ?
‎2008 Aug 05 3:05 PM
‎2008 Aug 05 3:00 PM
Hi,
You can create pdf file from smartform,
PARAMETERS:lifnr like lfa1-lifnr.
DATA:number(3) TYPE n value 90.
DATA:ktab TYPE TABLE OF lfa1.
DATA:ltab TYPE TABLE OF ekko.
DATA:w_fmodule TYPE rs38l_fnam,
w_cparam TYPE ssfctrlop,
w_outoptions TYPE ssfcompop,
w_bin_filesize TYPE i,
w_file_name type string,
w_file_path type string,
w_full_path type string.
Internal table to hold the OTF data
DATA:t_otf TYPE itcoo OCCURS 0 WITH HEADER LINE,
Internal table to hold OTF data recd from the SMARTFORM
t_otf_from_fm TYPE ssfcrescl,
Internal table to hold the data from the FM CONVERT_OTF
t_pdf_tab LIKE tline OCCURS 0 WITH HEADER LINE.
SELECT * from lfa1 into TABLE ktab where lifnr = lifnr.
IF sy-subrc = 0.
SELECT * from ekko into TABLE ltab FOR ALL ENTRIES IN ktab WHERE
lifnr = ktab-lifnr.
ENDIF.
w_cparam-no_dialog = 'X'.
w_cparam-preview = space. " Suppressing the dialog box
" for print preview
w_cparam-getotf = 'X'.
Printer name to be used is provided in the export parameter
OUTPUT_OPTIONS
w_outoptions-tddest = 'LP01'.
CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
EXPORTING
FORMNAME = 'ZBHSFORM'
IMPORTING
FM_NAME = w_fmodule.
CALL FUNCTION w_fmodule
EXPORTING
ARCHIVE_INDEX =
ARCHIVE_INDEX_TAB =
ARCHIVE_PARAMETERS =
CONTROL_PARAMETERS = w_cparam
MAIL_APPL_OBJ =
MAIL_RECIPIENT =
MAIL_SENDER =
OUTPUT_OPTIONS = w_outoptions
USER_SETTINGS = 'X'
IMPORTING
DOCUMENT_OUTPUT_INFO =
JOB_OUTPUT_INFO = t_otf_from_fm
JOB_OUTPUT_OPTIONS =
TABLES
ITAB = ktab
JTAB = ltab
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.
START-OF-SELECTION.
t_otf[] = t_otf_from_fm-otfdata[].
Function Module CONVERT_OTF is used to convert the OTF format to PDF
CALL FUNCTION 'CONVERT_OTF'
EXPORTING
FORMAT = 'PDF'
MAX_LINEWIDTH = 132
IMPORTING
BIN_FILESIZE = w_bin_filesize
TABLES
otf = t_otf
lines = t_pdf_tab.
To display File SAVE dialog window
CALL METHOD cl_gui_frontend_services=>file_save_dialog
CHANGING
filename = w_file_name
path = w_file_path
fullpath = w_full_path.
Use the FM GUI_DOWNLOAD to download the generated PDF file onto the
presentation server
CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
BIN_FILESIZE = w_bin_filesize
filename = w_full_path
FILETYPE = 'BIN'
tables
data_tab = t_pdf_tab.
Regards,
Harish
‎2008 Aug 05 3:05 PM