Skip to Content

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

To report this post you need to login first.


You must be Logged on to comment or reply to a post.

    1. Roberto Cotechino

      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?

  1. 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.



  2. Puttu G

    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.

  3. Arvin Poulose

    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 🙂

  4. 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”


Leave a Reply