Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Convert spoolfile to PDF

Former Member
0 Likes
686

Hi all,

understand that there are many references and information available for the above mentioned issue, but because the current SAP version 4.6B does not have FM such as CONVERT_ABAPSPOOLJOB_2_PDF & CONVERT_OTFSPOOLJOB_2_PDF. So making it difficult to do codings for PDF conversion.

I would like to seek any advises from experts around, is there any other methods to convert spool file (SP02) to PDF files?

Appreciate your help , thanks.

Regards,

JL

1 ACCEPTED SOLUTION
Read only

former_member194669
Active Contributor
0 Likes
657

Please look at the program RSTXPDFT4

3 REPLIES 3
Read only

former_member194669
Active Contributor
0 Likes
658

Please look at the program RSTXPDFT4

Read only

Former Member
0 Likes
657

Hi a®s,

I do understand that program RSTXPDFT4 can be used, but unfortunately, this program does not exist in my SAP system.

Possible to provide the source code for this program so that i create it manually in the system or any other methds?

Thanks.

Regards,

JL

Read only

0 Likes
657

Use the FM 'CONVERT_OTFSPOOLJOB_2_PDF' to get the PDF data from Spoll by passing the spol number if its a script or smartform related output.Or if its a list by ABAP program then use 'CONVERT_ABAPSPOOLJOB_2_PDF'. It will work.

CALL FUNCTION 'CONVERT_OTFSPOOLJOB_2_PDF'

EXPORTING

src_spoolid = v_spoolid

  • NO_DIALOG = 'X'

  • DST_DEVICE =

pdf_destination = 'C:\File.pdf'

IMPORTING

pdf_bytecount = numbytes

pdf_spoolid = pdfspoolid

  • OTF_PAGECOUNT =

btc_jobname = jobname

btc_jobcount = jobcount

TABLES

pdf = pdfdata[]

EXCEPTIONS

err_no_otf_spooljob = 1

err_no_spooljob = 2

err_no_permission = 3

err_conv_not_possible = 4

err_bad_dstdevice = 5

user_cancelled = 6

err_spoolerror = 7

err_temseerror = 8

err_btcjob_open_failed = 9

err_btcjob_submit_failed = 10

err_btcjob_close_failed = 11.

*refresh pdfdata[].

*pdfdata-tdformat = 'hello pawan'.

*append pdfdata.