Error opening PDF file when send as attachment via email

Hi,
I searched around the forum to resolve my issue and there's alot of post that is related but i can't find any answer to my issues.
Here's the scenario :-
I try to convert the smartform to PDF and then send the PDF as an attachment via email.
After converting the smartform to PDF, i managed to download the file and view it without any problem but i can't view the PDF as an attachment. It has the following error :-
Adobe Reader could not open '4500002325.PDF' because it is either not a supported fle type or because the file has been damaged (for example, it was sent as an email and wasn't correctly decoded
The following is the snapshot of my code:-
* Determine smartform function module for invoice
  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
    ent_retco = sy-subrc.
    PERFORM protocol_update_i.
  ENDIF.
  ls_control_param-getotf = 'X'.
  CALL FUNCTION lf_fm_name
    EXPORTING
      archive_index        = toa_dara
      archive_parameters   = arc_params
      control_parameters   = ls_control_param
      mail_recipient       = ls_recipient
      mail_sender          = ls_sender
      output_options       = ls_composer_param
      zxekko               = l_doc-xekko  " user_settings = ' '
      zxpekko              = l_doc-xpekko
    IMPORTING
      document_output_info = l_ssfcrespd
      job_output_info      = l_ssfcrescl
      job_output_options   = l_ssfcresop
    TABLES
      l_xekpo              = l_doc-xekpo[]
      l_xekpa              = l_doc-xekpa[]
      l_xpekpo             = l_doc-xpekpo[]
      l_xeket               = l_doc-xeket[]
      l_xtkomv             = l_doc-xtkomv[]
      l_xekkn              = l_doc-xekkn[]
      l_xekek              = l_doc-xekek[]
      l_xkomk              = l_xkomk
    EXCEPTIONS
      formatting_error     = 1
      internal_error       = 2
      send_error           = 3
      user_canceled        = 4
      OTHERS               = 5.
  IF sy-subrc = 0.
    CALL FUNCTION 'CONVERT_OTF'
      EXPORTING
        FORMAT                = 'PDF'
      IMPORTING
        BIN_FILESIZE          = v_len_in
        BIN_FILE              = v_bin_file
      TABLES
        OTF                   = l_ssfcrescl-otfdata
        LINES                 = l_pdf
      EXCEPTIONS
        ERR_MAX_LINEWIDTH     = 1
        ERR_FORMAT            = 2
        ERR_CONV_NOT_POSSIBLE = 3
        ERR_BAD_OTF           = 4
        OTHERS                = 5.
* email subject
    CONCATENATE 'Purchase order' l_doc-xekko-ebeln INTO lw_subject
                SEPARATED BY space.
* RECIPIENTS
    lwa_recipients-rec_type = 'U'.
    lwa_recipients-express = 'X'.
    SELECT adr6~smtp_addr
    INTO TABLE gv_smtp_addr
    FROM ekko AS ekko INNER JOIN
         lfa1 AS lfa1 ON ekko~lifnr      = lfa1~lifnr INNER JOIN
         adr6 AS adr6 ON adr6~addrnumber = lfa1~adrnr
    WHERE ekko~ebeln = l_doc-xekko-ebeln.
    IF NOT gv_smtp_addr[] IS INITIAL.
      LOOP AT gv_smtp_addr INTO gv_smtp_addr_line FROM 2.
        lwa_recipients-receiver = gv_smtp_addr_line.
        lwa_recipients-copy = ''.
        APPEND lwa_recipients TO ptb_recipients.
      ENDLOOP.
* Text Data
        CALL FUNCTION 'READ_TEXT'
          EXPORTING
            id                      = 'ST'
            language                = 'E'
            name                    = 'TEST'
            object                  = 'TEXT'
          TABLES
            lines                   = lv_lines
          EXCEPTIONS
            id                      = 1
            language                = 2
            name                    = 3
            not_found               = 4
            object                  = 5
            reference_check         = 6
            wrong_access_to_archive = 7
            OTHERS                  = 8.
      LOOP AT lv_lines INTO lv_lines_line.
        ltb_objtxt = lv_lines_line-tdline.
        APPEND ltb_objtxt.
      ENDLOOP.
      DESCRIBE TABLE ltb_objtxt LINES lw_tab_lines.
      READ TABLE ltb_objtxt INDEX lw_tab_lines.
* document data contains information for the whole message
      lwa_doc_chng-obj_descr = 'ABAPlist'.
* Control Data
      lwa_doc_chng-obj_name   = 'TESTING'.
      lwa_doc_chng-sensitivty = 'F'.
      lwa_doc_chng-no_change  = 'X'.
      lwa_doc_chng-priority   = '1'.
      lwa_doc_chng-obj_prio   = '1'.
      lwa_doc_chng-obj_langu  = sy-langu.
      CLEAR ltb_objpack-transf_bin.
*Attachment
*Move the binary attachment to other internal table.
      ltb_objpack-head_start = 1.
      ltb_objpack-head_num   = 0.
      ltb_objpack-body_start = 1.
      ltb_objpack-body_num   = lw_tab_lines.
      ltb_objpack-doc_type   = 'RAW'.
      APPEND ltb_objpack.
      clear : lw_tab_lines.
*Get the number of lines in the Attachment (PDF FILE)
*      DESCRIBE TABLE it_mess_att LINES lw_tab_lines.
      DESCRIBE TABLE l_objbin lines lw_tab_lines.
      ltb_objpack-transf_bin = 'X'.
      ltb_objpack-head_start = 1.
      ltb_objpack-head_num   = 1.
      ltb_objpack-body_start = 1.
      ltb_objpack-body_num = lw_tab_lines.
      ltb_objpack-doc_type = 'PDF'.
      ltb_objpack-obj_descr = l_doc-xekko-ebeln.
      ltb_objpack-doc_size = lw_tab_lines * 255.
      APPEND ltb_objpack.
*Email Subject
      lwa_doc_chng-obj_descr = lw_subject.
        lwa_recipients-receiver = recipeint.
        lwa_recipients-rec_type = 'U'.
        lwa_recipients-copy     = 'X'.
        lwa_recipients-express  = 'X'.
        APPEND lwa_recipients TO ptb_recipients.
      CALL FUNCTION 'SO_DOCUMENT_SEND_API1'
        EXPORTING
          document_data = lwa_doc_chng
          COMMIT_WORK   = 'X'
        TABLES
          packing_list  = ltb_objpack
          contents_bin  = l_objbin
          contents_txt  = ltb_objtxt
          receivers     = ptb_recipients.
      IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    ENDIF.
  ENDIF.
Edited by: ~loObie on Apr 23, 2010 12:01 PM
Edited by: ~loObie on Apr 23, 2010 12:02 PM

Did you send the pdf in the following format ...
2. Sending PDF as mail.
CLEAR t_receivers.
REFRESH t_receivers.
t_receivers-receiver = sy-uname.
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.
Quote from the Following [LINK|http://www.sap-basis-abap.com/smartforms/convert-the-smart-form-into-pdf-and-send.htm]

Similar Messages

  • I am running Vista and Windows Mail, I can not open PDF files when in Windows Mail, I must save to Desktop first, this has changes recently and I do not know why or how to fix

    I am running Vista and Windows Mail, I can not open PDF files when in Windows Mail, I must save to Desktop first, this has changes recently and I do not know why or how to fix.
    Why after 6 year's this has changed?
    I would like to open PDF's straight from Window Mail.

    Good day Jeff.
    I am running most current Adobe Reader X.
    Tks Mark

  • How do you send an attachment via email created on a mac

    how do you send an attachment via email to another recipient who does not have a mac?

    As long as you send it in a recognizable format such as a .jpeg (or .jpg) used for most photos/images or .pdf used for a lot of word processing docs, there is no problem. Also, while in the Mail window, choose "send Windows compatible". It's not who or what you create it on, it is the format you send it in.

  • Error opening PDF file, using Windows Vista

    When I first purchased my new pc, regrettably, I was given Windows Vista. There have been a lot of problems. Of late, Adobe Reader gives me an error message when I try to open a downloaded file. I uninstalled and reinstalled Adobe Reader but with no success. Could this be a Vista security issue? I can download and read the file on my work computer which used Windows XP. Also, this problem getting an error message opening and reading a file just recently occurred. I haven't made any changes to my system except automatic program updates. Can you help me?

    I stumbled on a solution: Download the PDF file and instead of saying yes to open the file (because you know you'll get the error message), simply go to where you saved the file (i.e. AOL downloads) and open it there. I have no idea why I suddenly cannot open PDF files but at least I found a way to still get my information. Hope this helps.

  • Cant open PDF file when is on the web site

    Hello
    I cant open the PDF file when this file is on the web site .
    But I can open the PDF file when this file is in my computer.
    I use the adobe 9 on windows XP
    Help me ... Great thanks
    Marc Boucher

    The message error say
    The program Acrobat Adobe/Reader in progress can not be used to open a file pdf in a Web navigator. Version 8 or 9 for Adobe Acrobat/Reader is necessary
    But I have the 9 version of Adobe reader !!!

  • Error - Open PDF Files

    Hello,
    Adobe Reader blocked himself when the software tried to open a PDF File (the PDF File is standard, no special things). A protected mode message is displayed but this mode is disabled in the preferences. In order to resolve the issue, I have to reboot the server. The version of Adobe Reader which is installed is the latest one. Have you already noticed such issue? What should I do in order to avoid the problem?
    Thanks,

    I can't open PDF files in Explorer. When I try I get an error box that says
    Internet Explorer has quit working
         Windows can check for a solution
         Check Online
         Close program
    I have reinstalled Adobe and the problem is still there
    I can open PDF files without going to Explorer

  • Errors opening pdf files

    In the last few months my iMac can't seem to open pdf files that it saves from the Web (I can airdrop a pdf file onto it, from my MBP, and my iMac will open that) or tries to generate itself. I get similar error messages using either Preview or the Acrobat reader. on preview the error reads "The file "NAME OF FILE" could not be opened because it is empty."  any ideas folks?

    Somehow you're not getting complete downloads of your PDF files. An empty file means no data besides the file header got saved onto your drive. Perhaps you should review the method you are using to download or otherwise receive these PDF files and see what may be amiss in the process.
    What are you using to save them from the Web?
    BTW, you really are still in Mac OS 9? What Mac you have running? Obviously not, you're using Preview. But you may want to update your profile info.

  • Cant open pdf files when surfing internet

    Trying to open pdf files & cant

    How? Within Safari or some other browser? Have you tried downloading and seeing if Preview can open them? Using some extension that might be hampering what you can't do? Many details missing.

  • I cannot open PDF files when I am using Firefox, how can I fix this?

    I cannot open PDF files while I am using Firefox. This is true for opening PDF pages in Firefox and outside of Firefox.

    I ran into the same problem, and here is what I have done to fix it.
    Go to Tools/Add-ons
    You might have to get the latest Adobe Acrobat Reader (Likely 10.x.....)
    On any exiting Adobe Acrobat Reader select disable (to disable the plug-in)
    If you have already gotten the latest Adobe Acrobat Reader just disable any earlier version.
    There is no official way to uninstall a plug-in so this it the workaround.
    If you do need to uninstall the plugin you need to type about:config ....about:plugins search for the article to do it.

  • I HAVE A PROBLEM TO OPEN PDF IN PAGES WHICH ARE ATTACHED WITH EMAIL,SOME ONE CAN HELP ME.?i,m using MINI I PAD 4G wi-fi

    I CAN,T OPEN PDF FILES IN PAGES WHICH ARE ATTACHED WITH EMAIL OR CAN,T SHARE PDF FILES WITH PAGES

    Install free Adobe Reader.
    https://itunes.apple.com/sg/app/adobe-reader/id469337564?mt=8

  • Error opening pdf file, but then it still opens

    I am having trouble when I open a pdf.I am using the code below to open a pdf.
    on mouseUp me
      acro = bafindapp("pdf")
      if acro = empty then
        acrofile = me.pPDF
        alert "This program was unable to find a suitable program on your system to open a PDF document. It will open www.adobe.com, where you can download a free viewer"
        goToNetPage "http://www.adobe.com"
    else
        open the moviePath & "Resource\" & me.pPDF with acro
      end if
    end
    When this is on a button, adobe reader will open, but gives an error saying "There was an error opening this document. This file cannot be found."
    When I hit the ok button on the error notice, the pdf opens.
    Any ideas why I am getting this message even though the pdf opens after dismissing the message would be appreciated.

    The reason I assumed, or asked, whether it was Windows-only is because of your use of the backslash character as the folder delimiter. To make the script cross-platform try the following:
    on mouseUp me
      acro = baFindApp("pdf")
      if ( acro = EMPTY ) then
        alert "This program was unable to find a suitable program on your system to open a PDF document. It will open www.adobe.com, where you can download a free viewer"
        goToNetPage "http://www.adobe.com"
      else
        mPath = _movie.path
        tFile = mPath & "Resource" & mPath.char[length(mPath)] & me.pPDF
        if baFileExists(tFile) then
          OK = baOpenFile(tFile, "normal")
          if ( OK < 32 ) then
            -- see docs for numbers and their meaning
            alert "Error opening file:" && OK
          end if
        else
          alert "File not found:" &RETURN& tFile
        end if
      end if
    end

  • Error opening PDF files on the network

    I have documents in PDF format on my internal network, but when I open them directly from the network using the Adobe Reader, I get the following message:
    "There was an error opening this document. The network path was not found". But this occurs in only a few users, and possibly users who did not have this error, they have. We found that uninstalling and reinstalling the software solves the problem, but then it returns. Is there any explanation?

    Adobe Reader 11.0.09;
    Microsoft Windows 7 Professional;
    I'm accessing the file from a local network drive. The file is located in one of our servers.

  • Error opening PDF files on anonymous SharePoint 2013SP1 site with IE

    Clicking search results, in the strict sense pdf files, using IE on an anonymous SharePint 2013SP1 site, I received the error:
    There was an error opening this document. The filename, directory name, or volume label syntax is incorrect.
    I would like to solve this problem on the server side.
    Starting position:
    - SharePoint 2013 SP1
    - Web Application:
      - based on template 'Publishing Portal'
      - Anonymous Access enabled
      - Claims based authentication: Integrated Windows Authentication NTLM
      - Client Integration disabled
    - Site Collection:
      - Anonymous Access enabled for 'Entire Web site' => group 'Anonymous Users' was created
      - added permission to open items: $Web.AnonymousPermMask64 = "ViewListItems, ViewVersions, ViewFormPages, Open, ViewPages, UseClientIntegration, OpenItems"
      - SC-Feature 'Limited-access user permission lockdown mode' disabled
    Client side solutions:
    c1) Open Link with “Open in new tab” or “Open in new window” => OK
    c2) Disable IE Add-on “Adobe Acrobat Sharepoint OpenDocuments Component” => OK
    c3) Set bDisableSharePointFeatures to 1 in regetit => OK
    Server side solutions:
    S1) Turn off Client Integration => didn't work, still same error
    S2) Modify DOCICON.XML => didn't work, still same error
    I gave these two options a chance:
    first: <Mapping Key="pdf" Value="icpdf.png" OpenControl="SharePoint.OpenDocuments"/>
    then: <Mapping Key="pdf" Value="icpdf.png" OpenControl="AdobeAcrobat.OpenDocuments"/>
    I modified DOCICON.XML on both hives 14 and 15.
    Remarks:
    - After changingparameters I allways did an IISreset.
    - As far as I understood I can only change bDisableSharePointFeatures on Client Side.
    Any help, suggestion, idea wellcome!
    Thanks!

    Hi Harry,
    From your description, I understand you encountered the issue when open PDF documents from search result page.
    Here is a similar thread, please try the piece of code in the page layout for the search results page from Mitch B_83:
    https://social.technet.microsoft.com/Forums/appvirtualization/en-US/545efcc6-b748-4df8-aee0-7f57f778ad1e/sharepoint-2010-opening-pdfs-in-search-results-the-filename-directory-name-or-volume-label?forum=sharepointgeneralprevious
    You could refer to this for search result page layout: Site settings > Web Designer Galleries > Master pages and page layouts > SearchResults.apsx .
    Regards,
    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact
    [email protected] .
    Rebecca Tu
    TechNet Community Support

  • Error opening PDF files using Acrobat Reader 9

    I use Acrobat Reader 9 to view PDF files. I have Windows XP operating system on my machine.
    In order to view encrypted PDF files on our company webiste we have to install FileOpenInstaller.exe or FIleOpenInstaller.msi which is Adobe Component
    Therewas no issue viewing/accessing the PDF files until last week. But now we get below error when we try to open encrypted PDF files from our company website.
    The error message is "Unable to get server data [FO error #2114, OS error #0)
    Any idea what could be the cause of error?
    Is anyone aware of any possible issue with Adobe FileOpenInstaller.exe or FIleOpenINstaler.msi packages

    I have just installed Adobe Reader 9. I am getting frequent system hangs (cannot do anything without cold re-boot) when using the product, in particular when using forms documents provided by Companies House, a UK government agency.

  • ERROR OPENING PDF FILES DOWNLOADED FROM INTERNET

    I have a problem when I download a pdf file from Internet and I try to open in throughout Acrobat Reader. It appeared one error saying "The file path is not valid". What can I do?.

    Hi there,
    I found this can happen if the file does not download correctly. When this happens, simply try redownloading the file and wait until it has fully downloaded before doing anything else with the browser.
    Does that work now?
    If you want to thank someone for their comment, do so by clicking the Thumbs Up icon.
    If your issue is resolved, don't forget to click the Solution button on the resolution!

Maybe you are looking for

  • I need some syntax help with reading some values from a selected row in an Access form.

    My goal:  to extract the data from 4 fields in a datasheet row and place them in another form. My problem:  I can only get the field values from the first row of the datasheet. I have tried using the Form_Click event as the location for the code I've

  • Osx 10.6.8 - how to get legacy motion v5.0.5?

    Hi all I am running Mac OSX 10.6.8.  I can't upgrade my OSX because I need 10.6.8 to run other custom code.  I went to the app store to re-install Motion 5 but the latest version requires OSX 10.9 or higher.  I checked another 10.6.8 machine and it i

  • It says "An unknown error has occured" when trying to download apps?

    Just got a new iPod touch 4g from my parents. Trying to download apps and it is saying "An unknown error has occured". Any idea? I am all registered and stuff for app store and such. I have no idea and this *****. Any ideas?

  • JDBC OBDC CONNECTION * INSERTION* Using SEQUENCE variable.

    Hi I tried this program.... import java.sql.*; public class Cust_Insert{ public static void main(String args[]) { try { Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); String dataSourceName="mdbTEST"; String dbURL = "jdbc:odbc:DATABASE_NAMEXXX"; Conne

  • Iphone & itunes issue

    I am trying to move a ringtone into the tones file on my iphone, but when dragg the file the entire device section highlights instead of the tones section and it drops the ringtone into my music instead of my tones