Converting Smart Forms to PDF output
In this recipe, we will see how the form output may be suppressed and returned as internal table to our calling program and then how a PDF is generated within the program. We will set values to some fields in the control structure of the Smart Form and use it with the CONVERT_OTF_2_PDF
function module.
How to do it...
For generating PDF output without showing the Smart Form on the screen, follow these steps:
First, we define two structures
cont_parameters
andmyoutput
based on the dictionary structuresssfctrlop
andssfcrescl
respectively.Then, we assign
'X'
to thesetotf
andno_dialog
fields of the control structure.The dynamic call of the Smart Form function module is then carried out.
Appropriate variables are then defined. The most important is the internal table
pdf_content
used for storing the converted PDF output of the form. Thefilesize
anddoc_archive
tables are necessary for calling the function moduleCONVERT_OTF_2_PDF
.The function module
CONVERT_OTF_2_PDF...