Show TOC

 Creating Print Previews

Use

Using the print preview, you can check the formatting of a document before it is actually printed.

Prerequisites

The prerequisites for creating and outputting correspondence requests are met.

Procedure

The correspondence tool does not include end user activities in the print preview, such as printing and/or archiving documents. Therefore, it is not possible for the system to decide, based on the print preview, if the correspondence request for the document being output or archived is to be made persistent on the database or not. Since the print preview is meant to enable you to assess the results of processing a business object, it should still be possible to process the business object after the print preview. Storing the correspondence request is not allowed for this kind of interim version of a document reflecting an incomplete business process.

Therefore, the I_DONT_WRITE_TO_DB parameters is set for the correspondence request that is necessary for creating the print preview. This takes place when the FKK_WRITE_CORR function module is called as non-persistable in the local buffer of the buffer model with instance management. The correspondence requests with this designation are not transferred to the global buffer when confirmed.

The print preview is realized in the form of immediate printing, but with output immediately after the correspondence request is created. To make it possible to identify the correspondence request when it is output, so that the print preview can be generated, your correspondence type and correspondence key must be transferred in the I_COTYP or T_COTYP and T_COKEY parameters when the FKKCORR_PRINT_DFKKCOH_SET function module is called. For output, the TDPREVIEW switch has to be set in the SAPscript output interface (structure ITCPO, part of the print option of the print workbench, structure EPRINTPARAMS). This switch requests the print preview. You also have to set the TDNOPRINT switch there, in order to prevent printing and/or archiving in the print preview.

You can make the print options of the print workbench available by calling the FKK_CORR_GET_PRINT_PARAMETERS function module. You have to allow the selection of a print preview by not setting the X_NO_PREVIEW parameter.

Sequence Diagram 5: Creating a Print Preview

You can nest the creation of print previews and creation – or creation and output – of correspondence requests in an LUW. Use the buffer model with instance management. If you want to generate correspondence after generating a print preview, you have to create a new correspondence request.

Result

The formatted document is output to the screen.

Example

In report RFKKCORR_EXP_CREATE_REQUEST, a print preview was created using the procedure described above. You can request a print preview in the output parameters by choosing with the quick info text More Parameters (appears next to the output device). When you make this selection, the system sets Print correspondence immediately in the output parameters. When the report is executed, the system displays the print preview on the screen. To prevent the creation of documents that were not entered in the system, both output and archiving are suppressed in the print preview.