Error in opening PDF.

10-11  Source: Network gathering  Views:0 

Advertisement
Hello Experts,
I have created one smartforms which containt some terms and condition which i want to send as a pdf to set of people. Now i am able to send the smartform as PDF . But when i am trying to open the PDF its shows me some error like 'PDF file is currupt'.
I search in SDN and try every option but i dont know where is my mistake . I  am attaching my code , please have a look into it and suggest .
Thanks In Advance.
Satya
*& Report  Z_PDF_FORM
REPORT  Z_PDF_FORM.
"tables : YTCPG.
DATA: "it_otf TYPE STANDARD TABLE OF YTCPG,
it_docs TYPE STANDARD TABLE OF docs,
it_lines TYPE STANDARD TABLE OF tline,
st_job_output_info TYPE ssfcrescl,
st_document_output_info TYPE ssfcrespd,
st_job_output_options TYPE ssfcresop,
st_output_options TYPE ssfcompop,
st_control_parameters TYPE ssfctrlop,
v_len_in TYPE so_obj_len,
v_language TYPE sflangu VALUE 'E',
v_e_devtype TYPE rspoptype,
v_bin_filesize TYPE i,
v_name TYPE string,
v_path TYPE string,
v_fullpath TYPE string,
v_filter TYPE string,
v_uact TYPE i,
v_guiobj TYPE REF TO cl_gui_frontend_services,
v_filename TYPE string,
v_fm_name TYPE rs38l_fnam.
data: T_RECEIVERS LIKE SOMLRECI1 OCCURS 0 WITH HEADER LINE,
w_doc_data type SODOCCHGI1,
ld_sender_address type SOEXTRECI1-RECEIVER,
ld_sender_address_type type SOEXTRECI1-ADR_TYP,
w_sent_all type SONV-FLAG,
t_packing_list like SOPCKLSTI1 OCCURS 0 WITH HEADER LINE,
t_attachment like SOLISTI1 OCCURS 0 WITH HEADER LINE,
it_message like SOLISTI1 OCCURS 0 WITH HEADER LINE.
*t_receivers like SOMLRECI1.
CONSTANTS c_formname TYPE tdsfname VALUE 'ZTEST'.
CALL FUNCTION 'SSF_GET_DEVICE_TYPE'
  EXPORTING
    i_language    = v_language
    i_application = 'SAPDEFAULT'
  IMPORTING
    e_devtype     = v_e_devtype.
st_output_options-tdprinter = v_e_devtype.
*st_output_options-tdprinter = 'locl'.
st_control_parameters-no_dialog = 'X'.
st_control_parameters-getotf = 'X'.
**.................GET SMARTFORM FUNCTION MODULE NAME.................
CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
  EXPORTING
    formname           = 'Y_TC_PGOODS'
  IMPORTING
    fm_name            = v_fm_name
  EXCEPTIONS
    no_form            = 1
    no_function_module = 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.
**...........................CALL SMARTFORM............................
CALL FUNCTION v_fm_name
  EXPORTING
    control_parameters   = st_control_parameters
    output_options       = st_output_options
  IMPORTING
    document_output_info = st_document_output_info
    job_output_info      = st_job_output_info
    job_output_options   = st_job_output_options
  EXCEPTIONS
    formatting_error     = 1
    internal_error       = 2
    send_error           = 3
    user_canceled        = 4
    OTHERS               = 5.
IF sy-subrc NE 0.
  MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
  WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ELSE.
***.........................CONVERT TO OTF TO PDF.......................
  CALL FUNCTION 'CONVERT_OTF_2_PDF'
    IMPORTING
      bin_filesize           = v_bin_filesize
    TABLES
      otf                    = st_job_output_info-otfdata
      doctab_archive         = it_docs
      lines                  = it_lines
    EXCEPTIONS
      err_conv_not_possible  = 1
      err_otf_mc_noendmarker = 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.
*2. Sending PDF as mail.
w_doc_data-obj_name  = 'MAIL_TO_HEAD'.
w_doc_data-obj_descr = 'Terms And Condition'.
t_packing_list-transf_bin = 'X'.
t_packing_list-head_start = 1.
t_packing_list-head_num   = 1.
t_packing_list-body_start = 1.
t_packing_list-doc_type   = 'PDF'.
t_packing_list-obj_descr  = 'PDF Attachment'.
t_packing_list-obj_name   = 'PDF_ATTACHMENT'.
APPEND t_packing_list .
*CLEAR  w_packing_list.
CLEAR t_receivers.
REFRESH t_receivers.
t_receivers-receiver = 'mailID.
t_receivers-rec_type = 'B'.
t_receivers-com_type = 'INT'.
t_receivers-notif_del = 'X'.
t_receivers-notif_ndel = 'X'.
APPEND t_receivers.
CALL FUNCTION 'SO_DOCUMENT_SEND_API1'
  EXPORTING
    document_data              = w_doc_data
    put_in_outbox              = 'X'
    sender_address             = ld_sender_address
    sender_address_type        = ld_sender_address_type
    commit_work                = 'X'
  IMPORTING
    sent_to_all                = w_sent_all
  TABLES
    packing_list               = t_packing_list
    contents_bin               = t_attachment
    contents_txt               = it_message
    receivers                  = t_receivers
  EXCEPTIONS
    too_many_receivers         = 1
    document_not_sent          = 2
    document_type_not_exist    = 3
    operation_no_authorization = 4
    parameter_error            = 5
    x_error                    = 6
    enqueue_error              = 7
    OTHERS                     = 8.
*IF sy-subrc = 0 .
*  MESSAGE 'Mail has been Successfully Sent.' .
*ENDIF.
Edited by: satya pujahari on Oct 29, 2010 3:29 PM
Clsoing Thread.
Related articles
  • Error while Opening PDF attachment from Mail 10-11

    Hi, We two Output Types created ZNEU and ZAUF. Two Smartforms are created for the same Output Types. The Issue now is, When ZNEU triggers and send a mail the document is properly decoded and gets opened but for ZAUF it doesn't. It says File damaged.

  • After Downloading, Error while opening PDF  : PDF has no pages 10-11

    After Downloading, Error while opening PDF  : PDF has no pages CALL FUNCTION 'CONVERT_ABAPSPOOLJOB_2_PDF'     EXPORTING       SRC_SPOOLID              = L_SPOOLNO       NO_DIALOG                = SPACE       DST_DEVICE               = MSTR_PRINT_PARM

  • Error while opening .PDF files in document library sharepoint 2013 10-11

    Hi I am getting an error while opening a .pdf file, Please help me find the solution. Thanks ParuLaunch IE -> Click on Gear (settings) -> Manage Add-ons -> Show: All Add-ons -> There are 2 Adobe Add-ons: Adobe PDF Reader  &  Adobe Acrobat

  • Error in opening PDF generated through HAP_DOCUMENT(ESS/MSS) 10-11

    Hi Experts, User is getting an error while opening the PDF generated through "Print" functionality of appraisal document(HAP_Document). There is a problem i'am facing in this BSP's,when i click on PRINT after creating Appraisal,it will ask me to

  • Error while opening PDF in mail attachment 10-11

    Hi All, In smartform i am sending a mail with attachemnt as PDF file,there is one more option like preview of smartform . issue is like i am able to see the preview of the same record but when it is sent in mail attachement,and while opening PDF its

  • Getting error while opening pdf on server 10-11

    Dear All, I am working on jdeveloper 11.1.1.4.0. I have a use case where on click of link , generating a dynamic pdf. The pdf i am arranging with the help of itext through backing bean. It is generating as well downloading the pdf.I have used filedow

  • Error when opening PDF files from SAP. 10-11

    Hi Gurus I have posted this question in ABAP Development section also. Please read the below text. We are having a strange intermittent problem with Adobe Reader. When we try to open PDF files from SAP Frontend we get an error pop-up. The pop-up does

  • Strange error while opening pdf in Firefox 10-11

    Hi there, I have a strange problem with Acrobat 9 on Windows 7 64bit. When I click on a PDF file on websites, a white site opens and I get an Acrobat message, which is totally empty. In the error box there is just a question mark on a blue circle, an

  • Rusty Solomon : Adobe Reader Error while opening pdf files 10-11

    Hello everyone, I have a systematic error opening PDF files with Adobe Reader X (10.1.1) "Adobe Reader has encountered a problem and needs to close. Please excuse us for the inconvenience." By waiting I installed Foxit but I would understand. I

  • Strange question mark error while opening pdf files in adobereader from SAP 10-11

    Hi Gurus We are having a strange intermittent problem with Adobe Reader. When we try to open PDF files from SAP Frontend we get an error pop-up. The pop-up does not have any text. The title of the pop-up has "Adobe Reader". There is a blue quest

  • Predefined performance management - error while opening PDF 10-11

    Hello, At a customer I am working on an implementation of predefined performance manamgement (PMP). The process is in, but when I want to open a pdf sample form I get a short dump. Someone has an idea? Thanks! Kind regards, Jeremy van der LindenLaunc

  • Scanning causes error when opening PDF 10-11

    Every time I scan or print with my HP Officejet 5610v, I can then no longer open a pdf by finding a file in the finder. When I try I get the following error: The document "iPhone intro.pdf" could not be opened. Acrobat cannot open files in the &

  • ArialUnicodeMS is missing error when opening PDF 10-11

    Hi I have Adobe Reader v9.0 on Windows XP SP3 When I try to open PDF document I get this error: "Cannot find or create the font 'ArialUnicodeMS'. Some characters my not display or print correctly" The document then open in gibrish. Please advise

  • Acrobat error when opening pdf email attachments 10-11

    I have a user who has the latest version of Adobe Acrobat and Reader installed on his PC running Windows 7 Pro SP1 which is up to date on patches. He was unable to open any pdf documents attached to email and was getting an error from Acrobat saying

  • Adobe Reader Error in Opening PDF Form 10-11

    Why do I get this error message when I try to open PDF Application Form using Adobe Reader? "Error encountered while processing node xfa[0].form[0].form1[0].#subform[5].ApplicationEligibility[0]. Unable to find suitable font for Japanese encoding.&qu

  • Error when opening PDF 10-11

    Hello, I'm having problems when trying to open PDF documents. When I go to open a PDF it tells me it can not open because it is not a valid PDF document but, I am positive that it is a valid PDF document that opens in other apps. How do I fix this??

  • Error While Opening PDF File in SAP Inbox 10-11

    Hello Experts, I am facing a weird error in SAP Inbox while opening a PDF files (both created by custom ABAP programs as well as the one attached to a new SAP Inbox message from my desktop & sent to my Inbox as a test). The error states that "Thi

  • HTTP 500 error while opening pdf report in Workspace 10-11

    Hi all, i have a HFM - FDM - Financial Reporting 11.1.1.3 installation at a custommer that is working fine. Except for the fact that when i open a report (doesn't matter if it's from the studio or workspace) in pdf it gives an HTTP 500 internal serve

  • Error while opening pdf in reader in windows 8:Can't open this file. There's a problem with file format 10-11

    I have a problem with a pdf file which does not open with reader in windows 8 but it opens properly with adobe pdf reader. All other pdf can be opened in reader.But when i open a pdf(see this link for pdf for which i got error http://incometaxsoft.co

  • Error while opening PDF file downloaded  from database Blob column 10-11

    Hi All, I am working on jdev 11.1.1.4.0. In my use-case I am using filedownload Actionlistner on a link to get the PDF file stored in the database in blob field. These files are being uploaded from other use-case in adf only. After getting the dialog