Skip to Content
Author's profile photo Former Member

Converting Print spool output in to a PDF in SAP

When can this be used:

1)      Whenever one triggers a print output in SAP it either gets immediately printed or will be saved as buffer in print spool.

2)      It might require that at some point user want to convert this output in to a PDF file .

SAP provides two ways in which a print output can be converted in to a PDF format.

  1. Directly from print preview of output. Steps involved for the same is as below.

A.)   Goto the print preview of the document which needs to be converted in to pdf format.

B.)    Execute the command ‘PDF!’ in the command line as shown below. This will convert print preview of output in to PDF which can be saved.

Converting Spool output into a PDF format

This section can be further divided in to two.

  1. When the spool output contains less than 99 pages.
  2. When the spool output contains more than 99 pages.

When spool output contains less than 99 pages:

When a spool has less than 99 pages we can run a SAP report RSTXPDFT4 in SE38 to convert the output to PDF. We can also have a Z t-code made for the program made for the same .


a)      Execute the program RSTXPDFT4 in SE38  by entering the spool number which is to be converted to PDF.

b)      Enter the path for the file to be saved.

c)      You will receive success message once file is saved.

When spool output contains more than 99 pages: The above steps are only useful if number of pages is less than 99. When the number of pages in spool is more than 99 in addition to RSTXPDFT4 program we need to run one additional program RSTXPDFT5. Steps are as explained below.


Step 1 :-  Spool number identified which has more than 99 pages in it.

Step 2:-  Run the program RSTXPDFT4 with the Spool number.

Step 3:- There will be message pop up “PDF convertion in Back ground?”. Click on Yes.

Step 4:- On clicking ‘Yes’ a batch job will be created and scheduled.

Step 5:- Go to sm37 and you can see the batch job running. Note down the spool number from the batch job.

Step 6:- Run the Second program( using se38) – RSTXPDFT5 and enter the Second spool number(the one got in background job) in the selection screen and execute.

Step 7 :- On executing there will be pop up for entering the file name. Name the file and path for saving the file. The file name extension would be .pdf

PDF File downloaded will be downloaded to the path specified in save as screen

Assigned Tags

      You must be Logged on to comment or reply to a post.
      Author's profile photo Pradeep Mani
      Pradeep Mani

      Good one..

      Author's profile photo Former Member
      Former Member

      Thanks Very useful note

      Author's profile photo Santosh Sharma
      Santosh Sharma

      Thanks for sharing...very useful.

      Author's profile photo Former Member
      Former Member

      Not sure if any of you can help, I have the following problem

      we are converting our purchase order in pdf format and the content of the file does not match what we see in the print preview...

      any idea of what the problem can be?

      Author's profile photo G Lakshmipathi
      G Lakshmipathi

      Roberto Cotechino

      Post your query in the following forum

      Output Management

      Author's profile photo Phanikumar Valiveti
      Phanikumar Valiveti

      Dear Roberto,

      your technical guy is right person here, to get it resolved.


      Author's profile photo Shareeq Hussain K M
      Shareeq Hussain K M

      Dear Krishna Prasad

      Thanks for sharing. My out put is more than 200 pages. It is around 5000 pages. RSTXPDFT5 is not creating the PDF file. It is working fine if it is 199 pages.

      Kindly help.



      Author's profile photo Former Member
      Former Member

      Usefull information. Thanks for sharing.

      Author's profile photo John Vo
      John Vo

      Noted this, very useful. Thanks.

      Author's profile photo Former Member
      Former Member

      Hi Krishna Prasad,

      I have tried the local drive as well as AL11 path. I'm getting the message "xxxxxx bytes transferred" but I do not see any file in the path. Please let me know is there anything I missed.

      Author's profile photo Former Member
      Former Member

      Another alternate way could be using LOCL printer as any PDF writer.

      Author's profile photo Former Member
      Former Member

      We had a P1 ticket for printing some HR documents for year closure.

      The documents had to be sent to government officials in a couple of hours and the user was not able to print via SAP.

      So next step was printing via Windows.

      I tried above steps for converting to pdf but did not work.

      Maybe it was print via SapScript.

      Work around was exporting it to pdf


      Specify the location.

      In our case there were 1058 pages without extensionPDF.jpg

      Easier way to change the extension to pdf is via CMD command "ren * *.pdf"


      Later merge the pages into 1 pdf using 3rd party tools like adobe.

      I used PDFSAM.

      Hope this helps someone 🙂

      Author's profile photo Anitha Paul
      Anitha Paul

      Good one! I followed the steps and it worked!

      Author's profile photo Chris Bermel
      Chris Bermel


      Could someone tell me if they know if what is the magic number of pages to export the spool file to a PDF? The job is cancelling when I run RSTXPDFT4 in back ground with the - "PDF data of length 95698316 created"

      Author's profile photo Former Member
      Former Member

      When I execute the command ‘PDF!’ in the command line, SAP will only convert the print preview of the quote output to PDF if the quote is not longer than 1 page.  How would you print a quote containing multiple pages? Many quotes exceed 1 page and I need to figure out how to convert them to PDF.

      Author's profile photo Maheshkumar Gattu
      Maheshkumar Gattu

      How can i disable the print button when i use pdf! ?

      Author's profile photo John Higgins
      John Higgins

      I would also be interested in how to disable.  The only workaround I've found is to go into the messages output and type NONE as my printer.  I still get an output to use the PDF! method but no wasting of paper.

      Author's profile photo Sean Noel
      Sean Noel

      I found this way for background pdf printing,  very easy.



      I needed it for converting Invoice list output to PDF.   Saved the invoice list number to the spool title, referenced that to find the spool number, put it into the function and poof....a pdf xstring.   I was then able to zip them all to a file and email it off to the users.  No popups, no page counts, the function does it all for you.

      Hope it works for someone.


      Sean D.