SAP PRINT ON OFF



Get Example source ABAP code based on a different SAP table
  



ABAP_LIST - Switching Spooling <(>On<)> and <(>Off<)>
If spooling is switched off, all list output is written to the list buffer for the current screen list. When spooling is switched on, a spool list is created. Spooling can be switched on as follows:
Using the statement NEW-PAGE PRINT ON.
Choosing the function Execute + Print on the standard selection screen of an executable program.
Calling an executable program with the addition TO SAP-SPOOL of the statement SUBMIT.
Scheduling an executable program in a background job using the additions VIA JOB and TO SAP-SPOOL of the statement SUBMIT.
If NEW-PAGE PRINT ON is used, spooling is switched on explicitly in the program. With the other three options, spooling is switched on from the start of execution of an executable program. Switching on spooling opens a new spool list level .
Only spooling switched on with NEW-PAGE PRINT ON can be switched off again using NEW-PAGE PRINT OFF. Spooling that is switched on at the start of a program cannot be switched off within this same program. In particular, spooling is always switched on when executing a program in background processing .

Examples



Example ABAP Coding

Switches on spooling explicitly.
ABEXA 01548
ABAP_EXAMPLE_END



Example ABAP Coding

Switching optical archiving on explicitly.
ABEXA 01549
ABAP_EXAMPLE_END



Example ABAP Coding

Calling the program
DATA: params TYPE pri_params,
valid TYPE c.

CALL FUNCTION 'GET_PRINT_PARAMETERS'
IMPORTING out_parameters = params
valid = valid.

IF valid <> space.
SUBMIT myreport TO SAP-SPOOL WITHOUT SPOOL DYNPRO
SPOOL PARAMETERS params.
ENDIF.
ABAP_EXAMPLE_END



Example ABAP Coding

Scheduling a background job.
DATA: params TYPE pri_params,
valid TYPE c.

CALL FUNCTION 'GET_PRINT_PARAMETERS'
EXPORTING mode = 'BATCH'
report = 'MYREPORT'
IMPORTING out_parameters = params
valid = valid.

IF valid <> space.
CALL FUNCTION 'JOB_OPEN' .... EXPORTING jobcount ...
SUBMIT myreport VIA JOB 'MY_JOB' NUMBER jobcount
TO SAP-SPOOL WITHOUT SPOOL DYNPRO
SPOOL PARAMETERS params.
CALL FUNCTION 'JOB_CLOSE' ...
ENDIF.
ABAP_EXAMPLE_END