Print Background Job’s Spool to the File System as a TEXT File

If you want to save your background job’s spool output to the file system as a text file or you want to print any SAP screen to the file system as a text file also then you can check the following steps…

First you have to create a SAP printer like below ;

SPAD –> Switch to Change Mode –> Create

ZPRINTFILE

Choose ;

- Device Type : “ASCIIPRI : Some generic ASCII printer”

Print Background Job's Spool to the File System as a TEXT File

- Host Spool Access method : “L : Print Locally Using LP/LPR”

Print Background Job's Spool to the File System as a TEXT File

Edit –> Command Set

You will see a new “Box” and write “A” character to the “Command Set ID”

Now new box will apper and you have to input datas like below ;

Description : Print to File

Command to transfer print data : Commands of operation

For our example ;

\\o\sapmnt\o\DVEBMGS00\spool\print.cmd &F \\o\sapmnt\o\DVEBMGS00\spool\

It means that  , execute the “print.cmd” and copy the file (&F) to location under “\\o\sapmnt\o\DVEBMGS00\spool\”

PRINT.CMD

@echo off
rem %1 file name
set target=F:\usr\SAP\O\DVEBMGS00\spool
REM copy file
cmd /c copy %1 %target% >> error.log

Command to query job status : echo OK

Print Background Job's Spool to the File System as a TEXT File

Now let’s try ;

For example screen SCC4

SCC4 –> Ctrl+P Print –> Select Output Device : ZPRINTFILE and print IMMEDIATELY

Print Background Job's Spool to the File System as a TEXT File

Now check the file system ;

Print Background Job's Spool to the File System as a TEXT File

Printout created as a text file on the OS

So you can use this printer for your background job’s spool outputs also…

 

 

3 Responses to "Print Background Job’s Spool to the File System as a TEXT File"

  1. khoe says:

    This really solved my problem, thank you!

  2. Paul says:

    This is very close to solving an issue with scheduled background jobs we have which are generating as .txt files. How would you adjust print.cmd so the generated filename could contain more than the spool number? For instance some additional characters identifying the specific spool request name or title which are in the overview tab of the Spool Request Attributes in Background Print Parameters (T-code SQ01).

    Regards,

  3. Chai Wing says:

    Keep on writing, great job!

Leave a Reply


three × = 3

Blogroll