cancel
Showing results for 
Search instead for 
Did you mean: 

Convert Smartform to PDF

former_member720137
Active Participant
0 Kudos

Hi All

I am getting a blank screen when i am trying to convert a smartform into PDF. Following are the steps i am using:

1 ) I have created a FM which gives me data in OTF format.

2) Then i called 'SSFCOMP_PDF_PREVIEW' FM.

3) Finally i called 'CONVERT_OTF' FM

CALL FUNCTION 'CO*NVERT_OTF'

EXPORTING

FORMAT = 'PDF'

IMPORTING

BIN_FILESIZE = p_bin_filesize ( i )

BIN_FILE = p_bin_file ( xstring )

TABLES

otf = p_job_output_info ( SSFCRESCL-otfdata )

lines = p_lines ( tline )

While debugging i checked that p_lines values was coming as '0' , rest values are coming fine.

4) I binded p_bin_file to a context of type xstring and binded this context to Interactive Form UI.

Please tell me if i missed something.

Regards,

Puneet

Accepted Solutions (0)

Answers (2)

Answers (2)

alejandro_bindi
Active Contributor
0 Kudos

Use this tutorial as a checklist:

https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/f0de1eb8-0b98-2910-7996-8a3c2fcf...

Edited by: Alejandro Bindi on Oct 26, 2008 6:31 PM

Sorry I didn't notice it was already posted.

Former Member
0 Kudos

Hi

you may use the FUNCTION 'CONVERT_OTFSPOOLJOB_2_PDF' to convert the fom

into PDF.

But first to get the printed form from the spool, use FUNCTION

'RSPO_FIND_SPOOL_REQUESTS'.

Then you may send it to your PC, email, fax, etc by reading the record in

the lines of table IT_PDF_OUTPUT.

Note: You may also use program RSTXPDFT4 as a reference to get code

examples which uses different functions to perform the creation of PDFand

download the form to the PC,etc.

An example:

CALL FUNCTION 'RSPO_FIND_SPOOL_REQUESTS'

EXPORTING

RQOWNER = SY-UNAME

TABLES

SPOOLREQUESTS = SPOOL_REQUESTS.

READ TABLE SPOOL_REQUESTS INDEX 1.

GD_SPOOL_NR = SPOOL_REQUESTS-RQIDENT.

CALL FUNCTION 'CONVERT_OTFSPOOLJOB_2_PDF'

EXPORTING

SRC_SPOOLID = GD_SPOOL_NR

NO_DIALOG = C_NO

IMPORTING

PDF_BYTECOUNT = GD_BYTECOUNT

PDF_SPOOLID = PDFSPOOLID

BTC_JOBNAME = JOBNAME

BTC_JOBCOUNT = JOBCOUNT

TABLES

PDF = IT_PDF_OUTPUT

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.

CHECK SY-SUBRC = 0.

Hope this will help send you in the right direction.

or you may use this link it might solve your query

https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/f0de1eb8-0b98-2910-7996-8a3c2fcf...

Edited by: anand prakash rai on Oct 23, 2008 11:55 AM