cancel
Showing results for 
Search instead for 
Did you mean: 

Printer output to PDF format

Former Member
0 Kudos

Hello Everyone,

I would first like to apologize if this is the incorrect area for this topic however I saw related material which helped me a little.

I have an interesting problem which I am looking for some assistance or insight into.

Currently running 4.6D version of SAP and am trying to take some old reports printing on a Xerox to be saved on a network location however having a hard time figuring out how to approach the issue. Right now I can use SAP conversion method from 4.6C by having a print queue setup example being IT40 and have that alias a print to file printer. This as you can already tell is creating a lot of manual process to occur which is what I am trying to avoid.

These reports vary in size and amounts from 1 to 30 individual reports and totally around 2,300 pages. I am mainly trying to eliminate the Xerox so that is one less expense which the department has to deal with.

Thank you very much in advance, if this is the wrong place I apologize again.

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

hi,

According to your title

This is Code to convert Smartfoms to PDF & download to ur PC.

PARAMETERS : p_werks TYPE t001w-werks.

PARAMETERS : p_file LIKE rlgrap-filename DEFAULT 'C:\temp\1.pdf'.

DATA : v_fnam TYPE rs38l_fnam.

DATA : flag TYPE char1.

DATA : file TYPE string.

DATA : mi_bytecount TYPE i.

DATA : lines LIKE tline OCCURS 100 WITH HEADER LINE.

*Control Parameters

DATA : it_ssfctrlop TYPE TABLE OF ssfctrlop.

DATA : wa_ssfctrlop TYPE ssfctrlop.

*Output Options

DATA : it_output_options TYPE TABLE OF ssfcompop.

DATA : wa_output_options TYPE ssfcompop.

*Job Output Info

DATA : it_job_output_info TYPE TABLE OF ssfcrescl.

DATA : wa_job_output_info TYPE ssfcrescl.

*Job Output Options

DATA : it_job_output_options TYPE TABLE OF ssfcresop.

DATA : wa_job_output_options TYPE ssfcresop.

CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'

EXPORTING

formname = 'ZSAMPLE_FORM'

IMPORTING

fm_name = v_fnam.

wa_ssfctrlop-no_dialog = 'X'.

wa_ssfctrlop-getotf = 'X'.

wa_ssfctrlop-preview = 'X'.

APPEND wa_ssfctrlop TO it_ssfctrlop.

wa_output_options-tdnoprev = 'X'.

wa_output_options-tdtitle = sy-title.

wa_output_options-tdnewid = 'X'.

APPEND wa_output_options TO it_output_options.

CALL FUNCTION v_fnam

EXPORTING

control_parameters = wa_ssfctrlop

output_options = wa_output_options

p_werks = p_werks

IMPORTING

job_output_info = wa_job_output_info

job_output_options = wa_job_output_options.

*Convert to PDF

CALL FUNCTION 'CONVERT_OTF'

EXPORTING

format = 'PDF'

IMPORTING

bin_filesize = mi_bytecount

TABLES

otf = wa_job_output_info-otfdata

lines = lines

EXCEPTIONS

err_conv_not_possible = 1

err_bad_otf = 2.

*Download to ur PC

file = p_file.

CALL FUNCTION 'GUI_DOWNLOAD'

EXPORTING

bin_filesize = mi_bytecount

filename = file

filetype = 'BIN'

TABLES

data_tab = lines[].

IF sy-subrc = 0.

MESSAGE 'Downloaded Successfully' TYPE 'S'.

ENDIF.

solution is this.

Former Member
0 Kudos

I want to first thank you jeevitha for looking at this question.

I will make sure to mark you and also this as solved once I have had a chance to try the code out.

Once reading it, everything seems to be a much easier answer then I was expecting.

Again thank you very much for your time, I will update on the outcome.