30.1.11

SAP Note 19965 - Print controls in ABAP programs

Symptom:

Print controls are to be relocated from an ABAP program.

Reason and Prerequisites

Frequent customer request.

Solution

You have to do the following:

    1. Call transaction SPAD. Choose "Copy device type". Copy the used device type to a new device type whose name has to begin with Z.
    2. Choose "Print control" and select the new device type.
    3. As example for a printer action, trigger a tray selection. Now position the cursor on any line in the first column of the table and enter a five-digit ID code to identify the action. Examples: Scha1, Scha2.
    4. Insert the corresponding hexadecimal sequence from the printer manual in the last column and save it.
    5. The target printer must be instructed of the new device type.
    6. Now insert a statement of the following form at the required position in the ABAP report: PRINT-CONTROL FUNCTION ''. Here, for example, PRINT-CONTROL FUNCTION 'ZSCH1'.
    7. The report must be written directly into the spool. Possible methods:
    + Execute SE38 and print
    + With the command NEW-PAGE PRINT ON...
    + Report runs in batch
    When a report is formatted for the screen, the print controls are lost and do not return if you later decide to print the screen list.

No comments:

Post a Comment