Email attachment in pdf format not getting opened

Dear freinds,
                 i have to send Payslip as PDF as email attachment. So i have used the FM  BAPI_GET_PAYSLIP_PDF and further passed the data to FM
SO_NEW_DOCUMENT_ATT_SEND_API1.
But, now  iam not able to open the attachment  which is in my inbox and it is giving message as the pdf as file is curropt. please could any one tell me what i have to do in this regard
regards
vamsi.

Hi Sai,
call function 'CONVERT_OTF'
      exporting
        format                = 'PDF'
        max_linewidth         = 132
      importing
        bin_filesize          = w_filesize
      tables
        otf                   = t_otf
        lines                 = t_line
      exceptions
        err_max_linewidth     = 1
        err_format            = 2
        err_conv_not_possible = 3
        err_bad_otf           = 4.
    loop at t_line.
      concatenate w_string t_line into w_string.
    endloop.                           " LOOP AT T_LINE
*" convert the 132 line character to 255 character ....................
    do.
      t_attach = w_string.
      append t_attach.
      shift w_string left by 255 places.
      if w_string is initial.
        exit.
      endif.                           " IF W_STRING IS INITIAL
    enddo.                             " DO
    t_objbin[] = t_attach[].
*" Body of the mail..................................................
    clear t_message. refresh t_message.
    t_message = 'This is a mail from SAP ECC6'.
    append t_message.
    t_message = 'Thanks and Regards'.
    append t_message.
    t_message = 'Sravanthi'.
    append t_message.
    describe table t_message lines w_msg.
*" Document data.......................................................
    w_docdata-obj_name = 'SAPRPT'.
    w_docdata-expiry_dat = sy-datum + 10.
    w_docdata-obj_descr = 'Smartform  mail from Sravanthi'.
    w_docdata-sensitivty = 'F'.
    w_docdata-doc_size = w_msg * 255.
    w_docdata-obj_langu = sy-langu .
*" Fill the packing list...............................................
    clear t_packing_list. refresh t_packing_list.
    t_packing_list-transf_bin = space.
    t_packing_list-head_start = 1.
    t_packing_list-head_num = 0.
    t_packing_list-body_start = 1.
    t_packing_list-body_num = w_msg.
    t_packing_list-doc_type = 'RAW'.
    append t_packing_list.
    t_packing_list-transf_bin = 'X'.
    describe table t_objbin lines w_objbin.
*" doc_size = (lines in pdf table) * 255...............................
    t_packing_list-doc_size = w_objbin * 255.
    t_packing_list-body_num = w_objbin.
    t_packing_list-doc_type = 'PDF'.
    t_packing_list-obj_name = 'smart'.
    t_packing_list-obj_descr = 'test'.
    append t_packing_list.
call function 'SO_DOCUMENT_SEND_API1'
      exporting
        document_data              = w_docdata
        put_in_outbox              = 'X'
        sender_address             = w_sender
        commit_work                = 'X'
      tables
        packing_list               = t_packing_list
        contents_bin               = t_objbin
        contents_txt               = t_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.
    if sy-subrc ne 0.
      write:/ 'Error When Sending the File', sy-subrc.
    else.
      write:/ 'Mail sent'.
    endif.
Regards,
Sravanthi

Similar Messages

  • I cannot open all email attachment files(pdf, doc, etc) in Mail on my New IPad.

    I cannot open all email attachment files(pdf, doc, etc) in Mail on my New IPad. I installed all viewer apps but I am not able to click and hold to select the option of viewer apps to open the files. I dont get the "open with" option when I click on the arrow in the menu bar. I can open attachment files on G-mail website from Safari though. It is really ridiculous that I cannot open the files from Apple Mail app! What's wrong with it!!

    We cannot possible know what's wrong with it. But we can offer suggestions that might help.
    Try resetting the iPad - its like rebooting a computer.
    Reset the iPad by holding down on the sleep and home buttons at the same time for about 10-15 seconds until the Apple Logo appears - ignore the red slider - let go of the buttons.
    This might help as well.
    You can try resetting all settings. Settings>General>Reset>Reset All Settings. You will have to enter all of your app preferences and device settings again

  • I get the following error everytime I download something from the internet:-"/Users/vinaypunjabi/Downloads/Ontario Colleges Chart(2)(1).pdf could not be opened, because an unknown error occurred.  Try saving to disk first and then opening the file".

    I get the following error everytime I download something from the internet:-"/Users/vinaypunjabi/Downloads/Ontario Colleges Chart(2)(1).pdf could not be opened, because an unknown error occurred.  Try saving to disk first and then opening the file".
    Then it shows as downloading failed.But if I click on it twice ,it opens up .
    this has started happening since last week.Before this ,it never happened.
    Please suggest what has gone wrong somewhere and how can I rectify it.

    Please install the following add-on to see if it helps.
    https://addons.mozilla.org/en-US/firefox/addon/pdfjs/

  • Opening bank data files in a PDF format not working, the file defaults to Quicktime and only displays one page.

    Opening bank data files, while logged into the bank or brokerage sites, by clicking on the PDF or file name icon, is supposed to open in PDF format but instead opens only a single page in Quicktime. This also happened several years ago in Leopard and required the removal of Quicktimeplugin.plugin. I have tried doing that in Lion with no success. Any thoughts?

    Gerry Brown wrote:
    "from that page" does not make sense.
    The file exists in a folder on your machine, correct?
    If not, you need to download the file from your bank. Or use "Save as" in the browser.
    No the file is on the Webpage he is visiting.
    @ OP Right click on it and select Save File As. then save it to your HDD. Then open it.

  • Why does a PDF file created in Pages, attached to e-mail, not get sent?

    Why does a PDF file created in Pages, attached to e-mail, not get sent?  I even blank copied myself and nothing seems to have been sent.  Could it bee the size of the PDF file?

    They send for me, my test document was 3.8 MB.

  • Email attachment in PDF problem with Images

    Hi All,
    Can any one tell me how to solve the problem with Email attachment in PDF. If i remove the logo of the client in the Smartform i am getting the Email attachment fine but when i put back the image in the smartform the PDF is giving error and not opening the attachment.
    Regards,
    Lakshmikanth.

    Hi All,
    Can any one tell me how to solve the problem with Email attachment in PDF. If i remove the logo of the client in the Smartform i am getting the Email attachment fine but when i put back the image in the smartform the PDF is giving error and not opening the attachment.
    Regards,
    Lakshmikanth.

  • Send mail  with attachement in PDF Format

    My Requriment is that After  Executing  the ALV  report  ....Oputput is too be Converting  into the PDF Format and mail should goes to respective person.............So what is the Procedure for this .................
    Regrads,
    Sandeep Jadhav

    Hi Sandeep,
    [Sending ALV Report as Email|"GLTRI--actual finish date" not getting populated;
    Thanks & regards,
    Dileep .C

  • What action dom i take for this error message "C:\DOCUME~1\user\LOCALS~1\Temp\physics.pdf could not be opened, because the associated helper application does not exist. Change the association in your preferences"?

    I get this message when I try to download a pdf file from a website.
    "C:\DOCUME~1\user\LOCALS~1\Temp\physics.pdf could not be opened, because the associated helper application does not exist. Change the association in your preferences."
    This is a new error. There used to be no problem.

    Do you have any setting for MP3 in Tools > Options > Applications ?
    You usually need the QuickTime plugin to play MP3 files on Windows because that is the only plugin that supports that file extension if there is no MIME type specified to play the file with another plugin like Windows Media Player or RealPlayer.

  • Win7 with FF 31, Android 4.2 smart phone with FF letest ver. using same account with 1 email. But phone is not get any pass, Bokmr, etc.

    Brother,
    We r using win7 with Mozila 31, Android 4.2 smart phone with Mozila latest ver. from google app store on 04/10/0214. Using same account with same email. But phone is not get any new information from win7 with Mozila 31. Pl z give helpful information.

    Hi w3ur_team,
    Thank you for your question. I understand that there are two devices that are logged into the Sync account. However the Android is not syncing.
    There are two places we can check:
    # In the Android Settings, under accounts is the attached account Firefox Sync or Firefox Sync (deprecated)?
    # Do the login credentials work on accounts.firefox.com on the mobile device and are there any error messages on the Sync menu from Settings > Sync?
    Please also see [[Firefox Sync troubleshooting and tips]] for more troubleshooting steps.

  • I have updated my iphone 5s to iOS8 but it has my old icloud account, how can i change the icloud email address as i can not get passed this page?? please help :-(

    i have updated my iphone 5s to iOS8 but it has my old icloud account, how can i change the icloud email address as i can not get passed this page??
    I do not know the log in details and no longer have that icloud email address !!
    please help :-(

    That's Activation Lock. You will need to remember the Apple ID and password you used to set up the phone.
    If you can't remember them, you can go to iforgot.apple.com to try to recover the information.
    If you are the original owner of the phone & have proof of purchase, you can try calling Apple to see if they can assist also.
    ~Lyssa

  • Parameter window not getting opened

    Hello All,
    While submitting any concurrent request, the parameters window is not getting opened and because of which the system is not allowing to proceed as some of the mandatory parameters are not getting entered.
    How can I resolve this?
    Thanks in advance!

    997274 wrote:
    Hello All,
    While submitting any concurrent request, the parameters window is not getting opened and because of which the system is not allowing to proceed as some of the mandatory parameters are not getting entered.
    How can I resolve this?
    Thanks in advance!Do you have any invalid objects in the database?
    Please generate the form via adadmin or manually and check then.
    Thanks,
    Hussein

  • I forget the secret answer of questions asked by account. I have also updated by account wiht alternative email (resque) but i am not getting any email from Apple. please help.

    I forget the secret answer of questions asked by account.
    I have also updated by account wiht alternative email (resque) but i am not getting any email from Apple for the restoreing my secret Ques Answer
    please help.

    The Best Alternatives for Security Questions and Rescue Mail
        a. Send Apple an email request at: Apple - Support - iTunes Store - Contact Us.
        b. Call Apple Support in your country: Customer Service: Contact Apple support.
        c. Rescue email address and how to reset Apple ID security questions.

  • Any iviews not getting opened from the portal content.

    Hi,
    Recenlty i found that the any of the iviews of the portal content are not getting opened.When i click on any of the iviews a blank page pops up.But the iviews when dispayed in the top level navigation gets opened there.Even the personalize option in the masthead pops with a blank screen.
    Am not able to figure where the problem is exactly.Pls help.
    Regards.
    Adity.

    We are using IE-7 and as per our clients requirements the portal has to be run on IE-7.May be this may be the browser problem but what settings i need to do to make all iviews running fine.This problem was not earlier but i am seeing this since a week.And all iviews pop up with a blank screen.
    Regards
    Adity

  • Attaching ONLY a PDF icon, not the open file to a mail message.

    I recall that I once found a Menu item for limiting the attachment of a PDF to its icon only and NOT the opened file. I can't find it now. Any idea welcome.

    I had it and now it is gone.  Don't know exactly when but recently (OSX 10.8.5).  Perhaps I am not the only one with this experience.  It seemed to work for all attachments too ala MS Exchange.  Changing to plain text did not help me.
    Does the recipient get it the same way it is sent - not having tested?  Yes I'm lazy.
    Is there a way to set attachment as icon by default without a third party tool?

  • Recently my mozilla opened emails show loading problem of pages and emails in inbox are not getting opened and other folders of email also not getting loaded

    recently i have downloaded many video converter softwares. After that whenever i open my emails, I am not able to load the pages. Only it opens to inbox and when i click any mail in inbox, it opens the mail and immediately close that automatically within seconds and not able to view mail. It also displays error message on top for a second (e.g. problem in loading) same error message appears when i try to open any other folder like junk, draft etc. in the email and the folders does not open and only inbox comes back but could not open any emails. Same is the case with any picture files or such things accessed thru google search, it never opens and if opens like email, immediately closes. I tried removing and re-installing mozilla, but still the problem persists.

    You can try these steps in case of issues with web pages:
    Reload web page(s) and bypass the cache to refresh possibly outdated or corrupted files.
    *Hold down the Shift key and left-click the Reload button
    *Press "Ctrl + F5" or press "Ctrl + Shift + R" (Windows,Linux)
    *Press "Command + Shift + R" (Mac)
    Clear the cache and cookies only from websites that cause problems.
    "Clear the Cache":
    *Firefox/Tools > Options > Advanced > Network > Cached Web Content: "Clear Now"
    "Remove Cookies" from sites causing problems:
    *Firefox/Tools > Options > Privacy > Cookies: "Show Cookies"
    Start Firefox in <u>[[Safe Mode|Safe Mode]]</u> to check if one of the extensions (Firefox/Tools > Add-ons > Extensions) or if hardware acceleration is causing the problem (switch to the DEFAULT theme: Firefox/Tools > Add-ons > Appearance).
    *Do NOT click the Reset button on the Safe Mode start window.
    *https://support.mozilla.org/kb/Safe+Mode
    *https://support.mozilla.org/kb/Troubleshooting+extensions+and+themes

Maybe you are looking for