Quantcast
Channel: SCN : All Content - ABAP Development
Viewing all articles
Browse latest Browse all 8332

SAP PDF opening with an error The file is damaged and could not be repaired. Local\EWH}@@8+hf!

$
0
0

Hi All,

 

Recently our system got upgraded from SAP Basis 640 to SAP ABA 702. After upgradition we are facing the issue while PDF creation.

 

PDF that is created when opened it is showing the error "The file is damaged and could not be repaired. Local\EWH}@@8+hf!"

 

Following code is used

 

CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'

EXPORTING

formname = lf_formname

IMPORTING

fm_name = lf_fm_name

EXCEPTIONS

no_form = 1

no_function_module = 2

OTHERS = 3.

IF sy-subrc <> 0.

 

*----- error handling ------------

 

lf_ent_retco = sy-subrc.

IF sy-subrc = 1.

MESSAGE e004(ssfcomposer) WITH lf_formname.

ENDIF.

IF sy-subrc = 2.

MESSAGE e005(ssfcomposer) WITH lf_formname.

ENDIF.

PERFORM fr_protocol_update_i.

ENDIF.

 

*-- if it is faxed, changed its title to PO number--

 

IF lw_control_param-device = co_device_telefax.

lw_composer_param-tdtitle = lw_doc-xekko-ebeln.

ENDIF.

CALL FUNCTION lf_fm_name

EXPORTING

archive_index = toa_dara

archive_parameters = arc_params

control_parameters = lw_control_param

mail_recipient = lw_recipient

mail_sender = lw_sender

output_options = lw_composer_param

is_ekko = lw_doc-xekko

user_settings = ' ' "Disable User Printer

is_pekko = lw_doc-xpekko

is_nast = lw_nast_1

iv_from_mem = lf_from_memory

iv_druvo = lf_druvo_1

IMPORTING

job_output_info = lw_ssfcrescl

TABLES

it_ekpo = lw_doc-xekpo[]

it_ekpa = lw_doc-xekpa[]

it_pekpo = lw_doc-xpekpo[]

it_eket = lw_doc-xeket[]

it_tkomv = lw_doc-xtkomv[]

it_ekkn = lw_doc-xekkn[]

it_ekek = lw_doc-xekek[]

it_komk = lt_xkomk[]

EXCEPTIONS

formatting_error = 1

internal_error = 2

send_error = 3

user_canceled = 4

OTHERS = 5.

IF sy-subrc <> 0.

lf_ent_retco = sy-subrc.

PERFORM fr_protocol_update_i.

ELSE.

lt_otf[] = lw_ssfcrescl-otfdata[].

ENDIF.

IF NOT lt_otf[] IS INITIAL.

REFRESH lt_lines[].

CALL FUNCTION 'CONVERT_OTF_2_PDF'

IMPORTING

bin_filesize = bin_filesize

TABLES

otf = lt_otf

doctab_archive = lt_docs

lines = lt_lines

EXCEPTIONS

err_conv_not_possible = 1

err_otf_mc_noendmarker = 2

OTHERS = 3.

CHECK sy-subrc = 0.

REFRESH output.

CLEAR bin_filesize.

LOOP AT lt_lines INTO lw_lines.

CLEAR lw_output.

ASSIGN lw_lines TO <lw_lines> CASTING.

MOVE <lw_lines> TO lw_output.

APPEND lw_output TO output.

DESCRIBE FIELD lw_output LENGTH lf_size IN BYTE MODE.

bin_filesize = bin_filesize + lf_size.

ENDLOOP.

ENDIF. "lt_otf.

 

This code was working fine earlier.

Let me know if any setting need or code changes need to be done


Viewing all articles
Browse latest Browse all 8332

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>