Application Development 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: 

SSF function module to disable pop window but OTF data is not coming.

Former Member
0 Kudos

Hi Experts,

My requirement is to get the PDF from the SSF function module and email it and i don want to display the pop option

I passed these parameters

1.no_dialog = c_x.

2.-preview = c_x.

3.-no_open = c_x.--|

4.no_close = c_x.---| if i add these two conditions i don get printer pop up but i don get the data for " job_output_info " also.

to this function module ,

Please tell me how to get data into " job_output_info " import parameter by not displaying the pop up for printer.

Thanks and Regards in advance.

4 REPLIES 4

gaurav_sharan
Explorer
0 Kudos

Hi,

use below code:

DATA: l_wa_control TYPE ssfctrlop. "Smartform Control Options

MOVE:

*-No Dialog

'X' TO l_wa_control-no_dialog,

*-GET OTF

'X' TO l_wa_control-getotf,

*-Output to "Printer"

'PRINTER' TO l_wa_control-device.

Then move control_parameters = l_wa_control in the Function module.

Hope this should solve your problem, <removed by moderator>

Regards,

Gaurav.

Edited by: Thomas Zloch on May 30, 2011 2:48 PM

0 Kudos

Hi,

It doesnt work.. please suggest me any other ways. .

Clemenss
Active Contributor
0 Kudos

Hi,

please search the forum and/or look at the SAP online documentation. Let us know what you found and what you did not find.

This is no human-assisted free search engine.

Regards,

Clemens

Former Member
0 Kudos

Hello,

we did it using the following code.

DATA: w_ctrlop TYPE SSFCTRLOP,

w_return TYPE SSFCRESCL.

DATA ls_job_output_info TYPE ssfcrescl.

DATA p_pdf_len TYPE i.

DATA pt_tlines TYPE TABLE OF tline.

(function_name is the name of the smartform)

W_CTRLOP-GETOTF = 'X'.

W_CTRLOP-NO_DIALOG = 'X'.

CALL FUNCTION function_name

EXPORTING

CONTROL_PARAMETERS = W_CTRLOP

USER_SETTINGS = 'X'

IMPORTING

JOB_OUTPUT_INFO = ls_job_output_info

EXCEPTIONS

FORMATTING_ERROR = 1

INTERNAL_ERROR = 2

SEND_ERROR = 3

USER_CANCELED = 4

OTHERS = 5.

IF SY-SUBRC <> 0.

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

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

ENDIF.

REFRESH pt_tlines.

CLEAR: p_pdf_len.

CALL FUNCTION 'CONVERT_OTF'

EXPORTING

FORMAT = 'PDF'

IMPORTING

BIN_FILESIZE = p_pdf_len

TABLES

OTF = ls_job_output_info-otfdata

LINES = pt_tlines

EXCEPTIONS

err_max_linewidth = 1

err_format = 2

err_conv_not_possible = 3

err_bad_otf = 4

OTHERS = 5.

IF sy-subrc <> 0.

ENDIF.

CALL FUNCTION 'GUI_DOWNLOAD'

EXPORTING

bin_filesize = p_pdf_len

filename = p_filename

filetype = 'BIN'

TABLES

data_tab = pt_tlines

EXCEPTIONS

file_write_error = 1

no_batch = 2

gui_refuse_filetransfer = 3

invalid_type = 4

no_authority = 5

unknown_error = 6

header_not_allowed = 7

separator_not_allowed = 8

filesize_not_allowed = 9

header_too_long = 10

dp_error_create = 11

dp_error_send = 12

dp_error_write = 13

unknown_dp_error = 14

access_denied = 15

dp_out_of_memory = 16

disk_full = 17

dp_timeout = 18

file_not_found = 19

dataprovider_exception = 20

control_flush_error = 21

OTHERS = 22.

IF sy-subrc <> 0.

MESSAGE s614(zef) DISPLAY LIKE 'E'.

ENDIF.