Start of Content Area

Print Parameters  Locate the document in its SAP Library structure

You must set print parameters before the printing process starts.

When printing lists after creating them, the system uses the print format specified in the print parameters to split the completed list and fit it onto the print pages, truncating it if necessary.

When printing lists while creating them, the system uses the print format to actually format the list in the program.

Print parameters are set either interactively by the user or from within the program.

Print Parameters- Overview

For each print process, the spool system needs a complete and consistent set of print parameters. In ABAP, the structure PRI_PARAMS (ABAP Dictionary) represent a set of print parameters.

When passing the print parameters interactively, the system displays a dialog box after starting the report, on which the user has to enter the most important print parameters.

The table below shows which input fields of the Print List Output dialog window conform to which PRI_PARAMS components.

Input field

Component

Meaning

Output device

PDEST

Name of a printer or fax

(Default values taken from user defaults).

Number of copies

PRCOP

Number of printed copies

(Default value: 1)

Name

PLIST

Name of the spool request. Set this only if you do not want to print immediately (pre-set with report name (SY-REPID) including the first three characters of the user name (SY-UNAME)).

Title

PRTXT

Description text of the spool request. This text appears on the standard cover page. PRTXT also replaces the name PLIST in the list of print requests (System ® Services ® Print requests).

Authorization

PRBER

Authorization for the spool request. Only users with this authorization can view the contents of the request.

Print immediately

PRIMM

If you mark this field, the system sends the spool request to the Output device immediately after completing it.

(Default values taken from user defaults).

Delete after print

PRREL

If you mark this field, the system deletes the spool request immediately after outputting it on the Output device. Otherwise, it deletes the request after the Retention period expired

(Default values taken from user defaults).

New spool request

PRNEW

If you mark this field, the system creates a new spool request. Otherwise, the system tries to append this spool request to a request that is not yet completed. In this case, the Name, Output device, Number of copies, and Format must be the same.

Retention period

PEXPI

Number of days for which the system holds the spool request before deleting it. (Default value: 8).

Archiving mode

ARMOD

Specify the archiving mode. You can only select a value using the possible values help. Click on the possible entries button to choose Print, Archive, and Print and archive (ARMOD is 1, 2, or 3).

(Default value: Print)

SAP cover sheet

PRSAP

If this field contains 'X', the system creates a standard cover page containing several data. If it contains 'D', it depends on the setting of the output device whether a cover page is printed or not. If the field is empty, the system does not create a cover page.

(Default value: 'D').

Recipient

PRREC

Specify the recipient name for the SAP cover sheet. (Default value: user name).

Department

PRABT

Specify the department name for the SAP cover sheet

(Default value taken from user defaults)

Lines

LINCT

Number of list lines. This field has the same effect as the LINE-COUNT option of the REPORT statement. You cannot specify 0 (unlimited number of lines) for printing. The maximum number in this field depends on the contents of the Format field.

(Default value: Set internally).

Columns

LINSZ

Number of characters per list line. This field has the same effect as the LINE-SIZE option of the REPORT statement. The maximum number in this field depends on the contents of the Format field.

(Default value: Set internally).

Formatting

PAART

This field actually determines the page format of the output. Depending on the printer connected, you can set different formats with different maximum page length and width values in this field.

(Default value: Set internally).

The Print List Output dialog box checks the input values for consistency and completeness. You cannot print if the print parameters are inconsistent (for example, using output formats the specified output device does not support).

Caution

The print parameters LINCT and LINSZ do not overwrite the LINE-COUNT and LINE-SIZE options of the REPORT or NEW-PAGE statements. If you use these options in your program, the values you specify there fill the components LINCT and LINSZ. The corresponding input fields in the Print List Output dialog box no longer accept input then. If the values you specify exceed the maximum values in the Format field, you cannot print the list.

In addition to the print parameters, there are archiving parameters. However, you must specify them only if optical archiving is turned on (archiving mode is Archive or Print and archive). In ABAP, the structure ARC_PARAMS (ABAP Dictionary) represent a set of archiving parameters.

The table below shows which input fields of the Print List Output dialog window conform to which ARC_PARAMS components.

Input field

Component

Meaning

Object type

SAP_OBJECT

Object type of the SAP object

Document type

AR_OBJECT

Document type of the archiving object

Information

INFO

Information short form of the archiving request

Text

ARCTEXT

Description text of the archiving request

You cannot archive a list unless the entries you make in the dialog box are consistent and complete. For optical archiving it can be a good idea to write index information into the list in order support a later search in the archived list. You can only do this while you are creating the list (refer to Creating Lists with SAP ArchiveLink).

Caution

To set print and archiving parameters from within the program, you must use the function module GET_PRINT_PARAMETERS. The system does not accept any values directly assigned to the print and archiving parameters sets. If you assign values directly and use these values afterwards, a runtime error occurs.

Print Parameters - Setting Default Values

The Print List Output dialog window always appears after the user chooses

You cannot suppress the dialog box for these user actions .

However, you can set predefined values for the Print List Output dialog box from within the program using the function module SET_PRINT_PARAMETERS. Use the function module SET_PRINT_PARAMETERS. This function module has no export parameters and only takes effect when the list is printed using one of the user actions listed above.

For Execute + print on the selection screen, you must call SET_PRINT_PARAMETERS during the AT SELECTION-SCREEN event (or earlier). For Print on the list interface, you must call the function module before sending the list to the output screen (or earlier).

The table below shows how the import parameters of SET_PRINT_PARAMETERS are related to the print and archiving parameters:

Import parameters

Parameters

Meaning

IN_PARAMETERS

PRI_PARAMS

Entire set

IN_ARCHIVE_PARAMETERS

ARC_PARAMS

Entire set

ARCHIVE_MODE

PRI_PARAMS-ARMOD

Archiving mode

AUTHORITY

PRI_PARAMS- PRBER

Authorization

COPIES

PRI_PARAMS- PRCOP

Number of copies

COVER_PAGE

PRI_PARAMS-PRBIG

Selection cover page

DATA_SET

PRI_PARAMS-PRDSN

Spool file

DEPARTMENT

PRI_PARAMS-PRABT

Department name

DESTINATION

PRI_PARAMS-PDEST

Output device

EXPIRATION

PRI_PARAMS-PEXPI

Retention period

IMMEDIATELY

PRI_PARAMS-PRIMM

Print immediately

LAYOUT

PRI_PARAMS-PAART

Formatting

LINE_COUNT

PRI_PARAMS-LINCT

Lines per page

LINE_SIZE

PRI_PARAMS-LINSZ

Columns per line

LIST_NAME

PRI_PARAMS-PLIST

Name of spool request

LIST_TEXT

PRI_PARAMS-PRTXT

Description text

NEW_LIST_ID

PRI_PARAMS-PRNEW

New spool request

RECEIVER

PRI_PARAMS-PRREC

Recipient

RELEASE

PRI_PARAMS-PRREL

Delete after print

SAP_COVER_PAGE

PRI_PARAMS-PRSAP

SAP cover sheet

TYPE

PRI_PARAMS-PTYPE

Type of spool request

FOOT_LINE

PRI_PARAMS-FOOTL

Output footer line

ARCHIVE_ID

ARC_PARAMS-ARCHIV_ID

Target archive

ARCHIVE_INFO

ARC_PARAMS-INFO

Information

ARCHIVE_TEXT

ARC_PARAMS-ARCTEXT

Description text

AR_OBJECT

ARC_PARAMS-AR_OBJECT

Document type

SAP_OBJECT

ARC_PARAMS-SAP_OBJECT

Object type

You must assign structures with the structures PRI_PARAMS and ARC_PARAMS to the parameters IN_PARAMETERS and IN_ARCHIVE_PARAMETERS respectively. These field strings must either be initial or contain the results of the function module GET_PRINT_PARAMETERS.

The system only uses the FOOT_LINE parameter if the user chooses Print on the list interface. If this parameter equals 'X', the system outputs one system-defined footer line on each page.

To include the function module into your program, use Edit ® Insert statement...CALL FUNCTION in the ABAP Editor.

Setting Print Parameters from within the Program

If you use the print statements

you set the print parameters from within the program, using the corresponding options of the print statements. You can either display or suppress the Print parameters dialog box.

Function Module GET_PRINT_PARAMETERS

To ensure that the parameters are sent to the spool system properly and completely, you should always transfer the entire parameter set with the print statements. To create a parameter set, use the function module GET_PRINT_PARAMETERS.

The function module GET_PRINT_PARAMETERS has the following tasks:

The individual print and archiving parameters are tightly interconnected and must be complete. For example, for each output device, you must specify the layout format, which, in turn, requires the numbers of lines and columns to be set. Or, when setting the archiving mode Archive or Print and archive, the archiving parameters must be set.

The print statements (NEW-PAGE PRINT ON, SUBMIT <rep> TO SAP-SPOOL) support a user dialog, but with the disadvantage of not offering the Back function. Once you have started the print process using a print statement, the system cannot go back to before the print statement. The user can only end the process using End which terminates the entire program.

GET_PRINT_PARAMETERS executes the following functions:

Import Parameters of GET_PRINT_PARAMETERS

The function module GET_PRINT_PARAMETERS has the same import parameters as the function module SET_PRINT_PARAMETERS, however, with the following exceptions:

GET_PRINT_PARAMETERS has no import parameter FOOT_LINE, since you need this parameter only if the user chooses Print on the output screen of the list.

GET_PRINT_PARAMETERS has the following additional import parameters:

This affects how the module works as follows:

MODE

Effect

PARAMS

This is the default. The user can choose Print or Cancel on the dialog window.

PARAMSEL

The dialog window contains the additional checkbox Selection cover page. If the user fills this field (print parameter PRBIG), the system includes a cover page into the output that contains the selections of the selection screen.

DISPLAY

The print parameters in the dialog window are display-only.

CURRENT

Uses the function module to determine the print parameters during the current print process (after a print statement). These values correspond to the parameters set for printing. If no print process is in progress, the system uses the pre-set values.

BATCH

Uses the function module to determine the print parameters for a background job. The executable program (report) to be started must be specified in the import parameter REPORT. If the program’s REPORT statement contains the options LINE-COUNT and LINE-SIZE, the system uses them as pre-settings in the dialog window. Instead of the Print pushbutton, the system offers the Save pushbutton in the dialog window.

The value contained in REPORT always influences the predefined value for the name in the spool request (component PLIST) which, otherwise, is determined by the SY-REPID system field. This value is itself overwritten by the import parameter LIST_NAME (if used).

If MODE is set to 'BATCH', the value in REPORT specifies the name of the report you want to start as a background job. GET_PRINT_PARAMETERS determines the print parameters for that report and not for the current report.

determines whether to display the dialog box. If NO_DIALOG contains 'X', the system suppresses the dialog.

Export Parameters of GET_PRINT_PARAMETERS

The function module GET_PRINT_PARAMETERS has the following export parameters:

This parameter either contains a complete set of print parameters or it is empty (see VALID).

This parameter either contains a complete set of archiving parameters or it is empty (see VALID).

This parameter shows whether the sets OUT_PARAMETERS and OUT_ARCHIVE_PARAMETERS are completely filled or empty. If VALID contains 'X', the parameter sets are complete. You can transfer them to the spool system. If VALID contains SPACE, the parameter sets are empty. VALID is set to SPACE if the user cancels the user dialog. Therefore, after a user dialog, always check VALID. If no user dialog occurs, VALID contains 'X'.

Exception Parameters of GET_PRINT_PARAMETERS

The function module GET_PRINT_PARAMETERS has the following exception parameters:

The archiving data specified are not consistent or the archive specified does not exist in the system.

The set of print or archiving parameters is invalid. You created an invalid parameter set by directly assigning values to the individual components of the parameter field strings and by using these structures to fill the import parameter IN_PARAMETERS or IN_ARCHIVE_PARAMETERS. The parameter field strings must always be the result of a previous call of GET_PRINT_PARAMETERS. Invalid import parameters, such as lines or columns set to 0, also create invalid parameter sets.

Using GET_PRINT_PARAMETERS: Notes

The function module GET_PRINT_PARAMETERS is the only method allowed by ABAP to assign values to the print and archiving parameter sets. Transferring parameter sets filled using GET_PRINT_PARAMETERS to the spool system prevents the program from being ended abnormally. This is of special importance for background processing. However, you must ensure that the export parameter VALID is unequal to SPACE and that no exception occurred.

Note that for GET_PRINT_PARAMETERS, it is most important that the parameter sets are complete and that the system can therefore execute the print request. GET_PRINT_PARAMETERS does not execute a complete consistency check as does the Print List Output dialog window. It provides consistency only where it is needed to execute the print request. Inconsistent entries are partly ignored, partly replaced. For example, you can

To include the function module into your program, use Edit ® Insert statement...CALL FUNCTION in the ABAP Editor.

It is reasonable to call the function module GET_PRINT_PARAMETERS several times in succession. For example, you can use GET_PRINT_PARAMETERS at the beginning of the program to trigger a user dialog, prompting the user for the basic setting. You then use the export parameters OUT_PARAMETERS and OUT_ARCHIVE_PARAMETERS as import parameters for further calls of the function module, in which you modify certain parameters from within the program (for example, to print wide lists in landscape format and narrow lists in portrait format).