Get Example source ABAP code based on a different SAP table
• PRINT ON NEW-PAGE • NEW-SECTION NEW-PAGE • PARAMETERS NEW-PAGE PRINT ON • ARCHIVE PARAMETERS NEW-PAGE PRINT ON • NO DIALOG NEW-PAGE PRINT ON • PRINT OFF NEW-PAGE
NEW-PAGE>, spool_options> Short Reference >
ABAP_SYNTAX ... ${ PRINT ON $[NEW-SECTION$] PARAMETERS pri_params> $[ARCHIVE PARAMETERS arc_params$]> NO DIALOG $}> $| ${ PRINT OFF $} ...>
What does it do? The addition PRINT ON> writes all subsequent output statements to a spool list>. The additions $[ARCHIVE$] PARAMETERS > are used to define the spool parameters and the archiving parameters of the spool request>. The addition PRINT OFF> closes a spool list that has been started with the addition PRINT ON>.
ABAP Addition
What does it do? The addition PRINT ON> creates a new spool list level>. The first output statement after NEW-PAGE PRINT ON> opens a new spool request> and writes to a spool list> in the SAP spool system>. The number of the spool request is placed after sy-spono> by the first output statement. While it is being created, the spool list is sent page by page to the SAP spool system.
If the current list is a screen list, its creation is interrupted, and the new spool list level is stacked.
If the current list is a spool list> not created with NEW-PAGE PRINT ON>, its creation is interrupted and the new spool list level is stacked.
If the current list is a spool list> created using NEW-PAGE PRINT ON> and the addition NEW-SECTION> is not used, a catchable exception of the class CX_SY_NESTED_PRINT_ON> is raised.
If the current list is a spool list> created using NEW-PAGE PRINT ON>, the addition NEW-SECTION> is used, the specified spool parameters match those of the newly created list, and the spool parameter PRNEW> in the structure pri_params> is initial, no new spool request is created and the output is written to the current spool list. If the spool parameters define the output of a cover sheet, the cover sheet is spooled again before the following output as a spacer sheet.
If the current list is a spool list> created using NEW-PAGE PRINT ON>, the addition NEW-SECTION> is used, and the specified spool parameters do not match those of the newly created list or the spool parameter PRNEW> in structure pri_params> is not initial, the current spool request is closed implicitly by NEW-PAGE PRINT OFF> and a new spool request is created. It is not possible to use NEW-PAGE PRINT ON> to stack another spool list level directly on to a spool list level created using NEW-PAGE PRINT ON>. A spool list level created using NEW-PAGE PRINT ON> can be closed by either NEW-PAGE PRINT OFF>, NEW-PAGE PRINT ON NEW-SECTION >, the end of the program, or by leaving a dynpro sequence.
Latest notes:
Each statement NEW-PAGE PRINT ON> should be closed explicitly using NEW-PAGE PRINT OFF> before the program end or before leaving a dynpro sequence.
The addition NEW-SECTION> can be used to avoid the exception CX_SY_NESTED_PRINT_ON>. When using NEW-SECTION>, the output can also be continued into the previous spool list, which is not possible when an exception is handled with CATCH>.
Besides the addition NEW-SECTION>, the obsolete statement NEW-SECTION>> can also be used outside of classes. However, it does not enable spool parameters to be specified. ABAP_HINT_END
What does it do? These additions provide the spool request with spool parameters and archiving parameters> . The latter are necessary if the spool list is archived using ArchiveLink>. The addition PARAMETERS> passes the spool parameters in a structure pri_params> of data type PRI_PARAMS>> from the ABAP Dictionary. If archiving is specified in pri_params>, archiving parameters must be passed using the addition ARCHIVE PARAMETERS> in a structure arc_params> of data type ARC_PARAMS>> from the ABAP Dictionary. Structures of data types PRI_PARAMS> and ARC_PARAMS> must be filled by the function module GET_PRINT_PARAMETERS>>. When the function module is called, either individual spool parameters or all spool parameters can be set in the program and/or a spool dialog box displayed. The function module creates a set of valid spool and archiving parameters for use as pri_params> and arc_params> and adds these to its output parameters. If the structures pri_params> or arc_params> are initial, the spool parameters or archiving parameters created by a call of the function modules GET_PRINT_PARAMETERS> with initial input values are used. The addition NO DIALOG> suppresses the spool dialog box that by default appears when using the addition PRINT ON>.
Latest notes:
These additions must always be used as shown here. It is particularly important that the standard spool dialog box is suppressed. When using the default spool dialog box, the Back> function is not available because the system cannot return to before a statement after spooling has been switched on by such a statement. Printing can only be exited using Exit>, which ends the entire program. If the user exits the GUI window by choosing Cancel>, inconsistent spool parameters can be produced. Instead, the spool dialog box can be displayed by calling the function module GET_PRINT_PARAMETERS>>. This function module has an output parameter VALID> that indicates the consistency of the spool parameters created.
The use of the addition NO DIALOG> without simultaneously passing spool parameters is allowed only outside of ABAP Objects and produces a warning in the syntax check. In other objects, the spool parameters are derived from the user master record, if possible.
Besides the additions shown here, there is a range of other additions for an obsolete specification of spool parameters>, which should no longer be used. ABAP_HINT_END
Example ABAP Coding
Creates spool lists during the list event AT LINE-SELECTION>>. The spool parameters are defined by the function module GET_PRINT_PARAMETERS> before the basic list is created. ABEXA 00453 ABAP_EXAMPLE_END