Search code examples
printinginvoicesap-basissap-smart-forms

How can I turn spool requests into PDF files on the application server?


I'm currently doing Invoicing and Printing setup on a SAP demo system. I've managed to create Smart Forms based on the standard ones. The problem starts with printing using FPCOPARA transaction and LP01 as Output device. I was able to generate a spool (was able to view it as well) but not printed (no actual file).

as you would see in this screenshot, it only keeps on that status

I just want to have a file from that Smart Form stored in AL11 and be able to archive it later on. Do you have idea on how can I proceed with this?

Thanks


Solution

  • We actually have an inhouse-developed program for this exact task. I don't have permission to publish the sourcecode of the program, but it involves:

    • Reading the list of spool requests from database table TSP01
    • Using the function module RSTS_GET_ATTRIBUTES to obtain the type of the spool request.
    • Calling the function modules CONVERT_OTFSPOOLJOB_2_PDF or CONVERT_ABAPSPOOLJOB_2_PDF, depending on the type determined by the previous function module. They return a table containing the content of the spool request in the PDF format.
    • Writing the table returned by the previous function modules to a file using the ABAP statements OPEN DATASET and TRANSFER