cancel
Showing results for 
Search instead for 
Did you mean: 

Maximize the PDF during report preview

Former Member
0 Kudos

Hi

I am using the function module SSFCOMP_PDF_PREVIEW for previewing the engagement report in PDF however the window size when previewing in PDF is smaller than normal and does not fit in the screen. It does not provide an user interface to maximize the window.

The user wants to view the report in PDF and in normal size so that it fits the screen normally. Is there a technique in SAP or a function module to achieve this.

Thanks and Regards,

Vamseedhar K

Accepted Solutions (0)

Answers (1)

Answers (1)

marius_greeff
Active Participant
0 Kudos

Hi,

The function module is pritty simple and why not copy it and change the custom control on the screen to a more realistic size.

I only found PDF preview programs related to smartforms that is so integrated to smartforms that you will not easily be able to use them in reports.

Other option download to the users temp_directory and excecute Adobe like the code inserted.

DATA: numbytes TYPE i,

arc_idx LIKE toa_dara,

p_file LIKE rlgrap-filename,

cancel.

w_return = sy-uname.

CALL FUNCTION 'GUI_GET_DESKTOP_INFO'

EXPORTING

type = '12'

CHANGING

return = w_return.

CONDENSE w_return.

CONCATENATE w_return '\my_file.PDF'

INTO p_file.

CALL FUNCTION 'CONVERT_OTF_2_PDF'

EXPORTING

archive_index = arc_idx

IMPORTING

bin_filesize = numbytes

TABLES

otf = t_otfdata

doctab_archive = doctab_archive

lines = lines

EXCEPTIONS

err_conv_not_possible = 1.

DATA: filename TYPE string.

filename = p_file.

CALL FUNCTION 'GUI_DOWNLOAD'

EXPORTING

bin_filesize = numbytes

filename = filename

filetype = 'BIN'

IMPORTING

filelength = numbytes

TABLES

data_tab = lines

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 ID sy-msgid TYPE sy-msgty NUMBER sy-msgno

WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.

ELSE.

WRITE: / 'The file ', p_file, ' has been created on your Desktop.'.

ENDIF.

call function 'WS_EXECUTE'

exporting

commandline =

'C:\Program Files\Adobe\Acrobat 7.0\Reader\AcroRd32.exe'

program = filename

exceptions

frontend_error = 1

no_batch = 2

prog_not_found = 3

illegal_option = 4

gui_refuse_execute = 5

others = 6.

Regards,

Marius