BASIS Function module Used the same way in S/4HANA

CONVERT_ABAPSPOOLJOB_2_PDF Convert ABAP Spool Request to PDF

Converts an ABAP list spool request to PDF and returns the result as a TLINE table or as binary data (BIN_FILE). It is used to e-mail the report output of background jobs as PDF attachments or to archive it. It only handles ABAP list spools (use CONVERT_OTFSPOOLJOB_2_PDF for SmartForms/SAPscript output); for large spools the conversion may be moved to a background job, which NO_BACKGROUND prevents.

Function group
STXW
Remote-enabled (RFC)
No
Type
Function module

Importing parameters

ParameterTypeDescriptionRequired
SRC_SPOOLIDTSP01-RQIDENTSource spool request numberYes
NO_DIALOGCNo dialog—
DST_DEVICETSP03-PADESTTarget output device—
PDF_DESTINATIONCPDF destination—
NO_BACKGROUNDCDo not move to background job—
GET_SIZE_FROM_FORMATCGet size from format—
USE_CASCADINGCUse cascading fonts—

Exporting parameters

ParameterTypeDescription
PDF_BYTECOUNTIPDF byte count
PDF_SPOOLIDTSP01-RQIDENTPDF spool request number
LIST_PAGECOUNTIPage count
BTC_JOBNAMETBTCJOB-JOBNAMEBackground job name
BTC_JOBCOUNTTBTCJOB-JOBCOUNTBackground job count
BIN_FILEXSTRINGPDF binary data

Tables parameters

ParameterTypeDescriptionRequired
PDFTLINEPDF lines—

Exceptions

  • ERR_NO_ABAP_SPOOLJOB — Not an ABAP spool request
  • ERR_NO_SPOOLJOB — No spool request
  • ERR_NO_PERMISSION — No permission
  • ERR_CONV_NOT_POSSIBLE — Conversion not possible
  • ERR_BAD_DESTDEVICE — Invalid target device
  • USER_CANCELLED — Cancelled by user
  • ERR_SPOOLERROR — Spool error
  • ERR_TEMSEERROR — TemSe error
  • ERR_BTCJOB_OPEN_FAILED — Background job open failed
  • ERR_BTCJOB_SUBMIT_FAILED — Background job submit failed
  • ERR_BTCJOB_CLOSE_FAILED — Background job close failed

Call template (ABAP)

A skeleton generated from the interface. It lists mandatory importing parameters, exporting parameters and tables; declare the variables with suitable types in your own program.

CALL FUNCTION 'CONVERT_ABAPSPOOLJOB_2_PDF'
  EXPORTING
    src_spoolid = lv_src_spoolid
  IMPORTING
    pdf_bytecount = lv_pdf_bytecount
    pdf_spoolid = lv_pdf_spoolid
    list_pagecount = lv_list_pagecount
    btc_jobname = lv_btc_jobname
    btc_jobcount = lv_btc_jobcount
    bin_file = lv_bin_file
  TABLES
    pdf = lt_pdf
  EXCEPTIONS
    err_no_abap_spooljob = 1
    err_no_spooljob = 2
    err_no_permission = 3
    err_conv_not_possible = 4
    err_bad_destdevice = 5
    user_cancelled = 6
    err_spoolerror = 7
    err_temseerror = 8
    OTHERS = 9.

Related tables

Can't find the report you need?

We also build anything that is not in the catalog. Describe it briefly and we will suggest the right solution.

Request a custom report