Generating a Print Form with Preview

Use

To generate a print form, you must first specify the form design file (the template) and the data you want to merge with the form. In the absence of data, you can omit the SET_DATA method. This example demonstrates how you only need to start ADS once to generate a PDF and its print output. For the print output, ADS requires the printer language specified in the PDLTYPE parameter. You can use the function module ADS_GET_PRINTER_ATTRIBUTES to determine the value of this parameter for each device type.

SET_TEMPLATE( template, FILLABLE = ABAP_FALSE ). // a non-interactive PDF

SET_DATA( data ).

SET_TASK_RENDERPDF( ).

SET_TASK_RENDERPDL( pdltype ).

EXECUTE( ).

GET_PDF( ).

GET_PDL( ).