8. ... PRINT
ON ...
... PARAMETERS params
... ARCHIVE PARAMETERS arparams
... NEW-SECTION
... NO DIALOG
... PRINT ON ...
...
PARAMETERS params (Structure with print parameters)
...
ARCHIVE PARAMETERS arparams
(Structure with archiving parameters)
...
NEW-SECTION (Beginning of a new section)
... NO DIALOG (Skip print control screen)
The syntax check performed in an ABAP Objects context is stricter than in other ABAP areas. See Print Parameters Missing in NEW-PAGE Statement.
Page break and redirection of output to the SAP spool.
Starting with the new page, all WRITE statements
(and also SKIP, ULINE, ...) are interpreted as print statements
(see Printing in ABAP).
Before the first page is printed, the user
sees a screen for setting the print parameters unless the addition NO
DIALOG
has been specified. The print parameters are passed through the structure
params. This structure must have the structure of PRI_PARAMS.
The structure can be filled and modified using the function module GET_PRINT_PARAMETERS.
If you specify
arparams with ARCHIVE
PARAMETERS, the structure of ARC_PARAMS must
be used. You should only edit this parameter using the function module GET_PRINT_PARAMETERS.
If you specify the addition NEW-SECTION, the
page count is reset to 1. If data is being printed, the current spool request is closed. If the print
parameters specified are compatible with those set earlier, the new spool request is attached to the spool request just closed.
It is not possible to add records to the spool on a cross-event basis (AT
LINE-SELECTION, AT PFx, AT USER-COMMAND). In such cases, NEW-PAGE PRINT OFF (see addition 10) is processed even if this has not been coded explicitly.
* Printing without archiving
DATA PARAMS LIKE PRI_PARAMS.
DATA: DAYS(1) TYPE
N VALUE 2,
COUNT(3) TYPE N VALUE 1,
VALID TYPE
C.
CALL FUNCTION 'GET_PRINT_PARAMETERS'
EXPORTING DESTINATION
= 'LT50'
COPIES =
COUNT
LIST_NAME
= 'TEST'
LIST_TEXT
= 'Test NEW-PAGE PRINT ON'
IMMEDIATELY
= 'X'
RELEASE
= 'X'
NEW_LIST_ID
= 'X'
EXPIRATION =
DAYS
LINE_SIZE
= 79
LINE_COUNT =
23
LAYOUT =
'X_PAPER'
SAP_COVER_PAGE =
'X'
RECEIVER =
'SAP*'
DEPARTMENT =
'System'
NO_DIALOG
= ' '
IMPORTING OUT_PARAMETERS = PARAMS
VALID
= VALID.
IF VALID <> SPACE.
NEW-PAGE PRINT ON PARAMETERS PARAMS NO DIALOG.
WRITE / 'First line'.
ENDIF.
* Printing with archiving
DATA: PARAMS LIKE PRI_PARAMS,
ARPARAMS
LIKE ARC_PARAMS,
DAYS(1) TYPE N VALUE 2,
COUNT(3)
TYPE N VALUE 1,
VALID TYPE C.
CALL
FUNCTION 'GET_PRINT_PARAMETERS'
EXPORTING DESTINATION =
'LT50'
COPIES
= COUNT
LIST_NAME =
'TEST'
LIST_TEXT =
'Test NEW-PAGE PRINT ON'
IMMEDIATELY =
'X'
RELEASE =
'X'
NEW_LIST_ID =
'X'
EXPIRATION
= DAYS
LINE_SIZE =
79
LINE_COUNT
= 23
LAYOUT
= 'X_PAPER'
SAP_COVER_PAGE
= 'X'
RECEIVER
= 'SAP*'
DEPARTMENT
= 'System'
SAP_OBJECT
= 'RS'
AR_OBJECT =
'TEST'
ARCHIVE_ID
= 'XX'
ARCHIVE_INFO
= 'III'
ARCHIVE_TEXT
= 'Description'
NO_DIALOG =
' '
IMPORTING OUT_PARAMETERS = PARAMS
OUT_ARCHIVE_PARAMETERS =
ARPARAMS
VALID
= VALID.
IF VALID <> SPACE.
NEW-PAGE PRINT ON PARAMETERS PARAMS
ARCHIVE
PARAMETERS ARPARAMS
NO DIALOG.
WRITE / 'First line'.
ENDIF.
Printing Lists