cancel
Showing results for 
Search instead for 
Did you mean: 

Saving the Smartform in PDF or any other format from print preview screen

Former Member
0 Kudos
1,821

Hi Gurus

Is there any way to save a smartform output as a file (preferably pdf) from the print preview screen?

The customer wants to save the file from that screen itself and want to avoid multiple steps.

To Add on to it, I am using HRFORMS. That means, I would not be able to write any code in the driver program as it is system generated on each server whenever you activate the HRFORMS.

Hence, although I know about the function module "HR_IT_DISPLAY_WITH_PDF" which can be used to convert the output of the smartforms to pdf in print preview, I cannot use it in the driver program as it is not editable.

Any suggestions/solutions would be appreciated.

Thanks

sapper.

Edited by: d sappanese on Aug 9, 2011 5:52 PM

View Entire Topic
aidan_black
Advisor
Advisor
0 Kudos

Hi,

You can use report RSTXPDFT4 to convert the spool number to a PDF file.

Regards,

Aidan

Former Member
0 Kudos

Hi Aidan,

Thanks for the response. But as I said, The customer wants to download the form staying on the print preview screen.

They don't want another program for downloading.

Regards,

sapper.

0 Kudos

you can use this code

data: wa_OTF_DATA TYPE TSFOTF.

CALL FUNCTION GV_FMNAME

EXPORTING

CONTROL_PARAMETERS = wa_CONTROL

OUTPUT_OPTIONS = wa_OUTOPTIONS

USER_SETTINGS = SPACE

GS_HEAD = wa_HEAD

GS_DATA = wa_FORM

GV_COMPANY = v_COMP_NAME

GV_CHECK = wa_QMEL-MAWERK

T_MOREDEF = v_MOREDEF

GV_LANGU = T_LANGU

IMPORTING

JOB_OUTPUT_INFO = wa_JOB_OUT.

IF SY-SUBRC = 0.

wa_OTF_DATA = wa_JOB_OUT-OTFDATA[].

CALL FUNCTION 'SSFCOMP_PDF_PREVIEW'

EXPORTING

I_OTF = wa_OTF_DATA[]

EXCEPTIONS

CONVERT_OTF_TO_PDF_ERROR = 1

CNTL_ERROR = 2

OTHERS = 3.

IF SY-SUBRC NE 0.

MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

ENDIF.

Former Member
0 Kudos

Hi Rajat

Thanks for the response. But, as I said, I cannot change the driver program. Any clue if I can write the code in any enhancement point or some other place?

Regards,

Sapper.