How to mail a local PDF file

Hi,
I have local PDF file saved on desktop.
How to send this file as attacehment in mail.

Hi,
see the folowing programm :
DATA : gf_agb_file TYPE string.
TYPES: BEGIN OF data_type,
        line(255) TYPE x,
      END OF data_type.
DATA :  gt_upload TYPE TABLE OF data_type,
        gf_file_upload_lengh TYPE i,      
        agb_content TYPE solix_tab.
DATA gs_agb_content TYPE solix.
DATA gs_upload TYPE data_type.
FIELD-SYMBOLS: <data_x> TYPE x,
                             <text> TYPE x.
Load   PDF
gf_agb_file = '  here access path for PDF'. 
CLEAR gt_upload[].
CALL METHOD cl_gui_frontend_services=>gui_upload
   EXPORTING
     filename                = gf_agb_file
     filetype                = 'BIN'
   has_field_separator     = SPACE
   header_length           = 0
   read_by_line            = 'X'
   dat_mode                = SPACE
   depage                = SPACE
   ignore_cerr             = ABAP_TRUE
   replacement             = '#'
   virus_scan_profile      = virus_scan_profile
   IMPORTING
    filelength              = gf_file_upload_lengh
   CHANGING
     data_tab                = gt_upload[]
   EXCEPTIONS
     file_open_error         = 1
     file_read_error         = 2
     no_batch                = 3
     gui_refuse_filetransfer = 4
     invalid_type            = 5
     no_authority            = 6
     unknown_error           = 7
     bad_data_format         = 8
     header_not_allowed      = 9
     separator_not_allowed   = 10
     header_too_long         = 11
     unknown_dp_error        = 12
     access_denied           = 13
     dp_out_of_memory        = 14
     disk_full               = 15
     dp_timeout              = 16
       NOT_SUPPORTED_BY_GUI    = 17
       ERROR_NO_GUI            = 18
     OTHERS                  = 19.
IF sy-subrc <> 0.
  MESSAGE e057(zsd_eur) WITH 'Fehler bei Load AGB-PDF'.
  EXIT.
ENDIF.
LOOP AT gt_upload INTO gs_upload.                 =====>  convert from typ x to typ raw
  ASSIGN gs_upload-line TO <data_x> .
  ASSIGN gs_agb_content TO <text> casting .
  <text> = <data_x>.
  APPEND gs_agb_content TO agb_content.
ENDLOOP.
TRY.
  ---------- create persistent send request ----------------------
    send_request = cl_bcs=>create_persistent( ).
    write gf_file_upload_lengh to l_pdf_len.
    document = cl_document_bcs=>create_document(
          i_type    = 'PDF'
          i_hex     = agb_content
          i_length  = l_pdf_len
          i_subject = 'test created by BCS_EXAMPLE_6' ).    "#EC NOTEXT
  add document to send request
    send_request->set_document( document ).
  ---------- add recipient (e-mail address) ----------------------
    recipient = cl_cam_address_bcs=>create_internet_address(
        i_address_string = ' here internet mail adress ' ).
  add recipient to send request
    send_request->add_recipient( i_recipient = recipient ).
  ---------- send document ---------------------------------------
    sent_to_all = send_request->send(
        i_with_error_screen = 'X' ).
    IF sent_to_all = 'X'.
      MESSAGE i022(so).
    ENDIF.
  ---------- explicit 'commit work' is mandatory! ----------------
    COMMIT WORK.

Similar Messages

  • How to send a local PDF file(on presentation Serv) as attachment in a mail.

    Hi,
    This is urgent requirement..
    Please help.. Some scanned document is saved as PDF  file locally (on Presentation Server) that i want to send as attachment in mail.
    I tried with SO_NEW_DOCUMENT_ATT_SEND_API1 Function Module but
    It is just sending the file as attachement, but when i open that file into mail..it is not opening. Is there anythign so that i can just give filepath and that file can go to mail.
    I am selecting the filepath in selection screen but in FM SO_NEW_DOCUMENT_ATT_SEND_API1  there is no option of giving the file path. So it is not taking right file.
    Is there any other function module ?

    http://www.sap-img.com/abap/sending-email-with-attachment.htm

  • In windows 8 how do I print a pdf file I got in an e-mail

    In windows 8 how do I print a pdf file I got in an e-mail?

    Goto Adobe's website and download the free pdf reader it can print the pdf for you assuming printing is not disabled for that document.

  • How can I attach a pdf file to outgoing mail without it opening up within the message?

    How can I attach a pdf file to outgoing mail without in opening up within the message?

    You can use the Share button on Preview's toolbar. Choosing Email pops open Mail with the PDF already iconified as an attachment. If it doesn't behave this nicely for you, select the PDF in Mail and choose the right contextual menu, where you will find View as Icon. I also have Send Windows-Friendly attachments enabled.

  • How do i download a pdf file from an e-mail? save to computer did not work.

    How do i download a pdf file from an email? Save to computer did not work.

    What is your operating system?  What is your email client?  What exactly means "did not work"?
    Most email clients I know have a 'Save Attachments' functionality; did you try that?

  • SO_NEW_DOCUMENT_ATT_SEND_API1:How to correctly attach a PDF file

    I have an ABAP report that will send an email and attach the PDF file.
    - convery spool to PDF     : CONVERT_ABAPSPOOLJOB_2_PDF
    - to send email          : SO_NEW_DOCUMENT_ATT_SEND_API1
    How I execute SM36:
    1. SM36
    2. Job Name
    3. Spool List Recipient : select my own address as internal user (I didn't tick any of the check box for the general attributes)
    When I go to TCODE SO01(SAP Inbox)
    The attachment I see is just a link to the output of my classic ABAP view report, it's not a PDF File.
    But I in SO01, I create a mail and attach PDF file, receive it my SAP inbox and can also open the attached PDF directly by just double clicking it.
    Thanks.

    Hi  Jaime Cabanban,
    Please find the Below Sample Program,
    BCS_EXAMPLE_8
    Thanks
    Surendra

  • How can I attach a PDF file to an email I am replying to?

    Hi!
    How can I attach a PDF file already saved on my iPad to an existing email I am replying to from my inbox??

    If you have the PDF stored on the iPhone as a separate file you obviously also have a third party app for reading it, so you should be able to e-mail it from there.
    If it's on an existing e-mail, forward the e-mail and just change the contents but include the pdf

  • How can I save a PDF file sent to me in an attachment to my iPhone 5s

    How can I save a PDF file or word file sent to me as an attachment directly to my iPhone 5s so if I want to read it I don't have to dig into my ail every time?

    You will need to select the attachment and open in another app.  If you do not have any apps that support PDF, Adobe reader for iOS is free.
    For MS word files, you will need an app that supports those, like Documents to Go. 
    There is not generic file storage area in iOS, so you need to "open in" an app that supports that file type so that app can then add the file to its sandboxed local storage area.
    If you need to markup the PDF, some good apps are GoodReader, iAnnotate, PDF Expert, GoodNotes - there are numerous others as well in the App Store.

  • How do I sync a PDF file between iPhone and iPad in iBooks?

    How do I sync a PDF file between iPhone and iPad in iBooks?

    If the PDF supports it then you can try opening the PDF in iBooks on your phone and use the 'share' icon (the square with the upward pointing arrow) to email it to yourself (some PDFs a protected and don't support emailing) and use 'open in' in the Mail app on your iPad to copy it to its Mail app.
    Or you can connect the phone to your computer's iTunes and do File > Devices > Transfer Purchases to copy it over to your iTunes (that should copy PDFs and/or epubs that are in the iBooks app, not just ibooks) and if using a Mac with Mavericks or Yosemite on it then do File > Move Books From iTunes in its  iBooks app, and you can then sync it to your iPad.

  • How do I print a PDF file please?

    How can I print a PDF file I have received in an e-mail please?

    I already have that but it doesn't pick up the file! Instead I get a separate page with the PDF file on but nowhere does it say print!

  • How do I save a pdf file to a folder?

    How do I save a pdf file to a folder?

    Hi,
    Are you trying to save your PDF files from Acrobat.com to your folder in our computer?
    If so, download your PDF files from https://files.acrobat.com to your local folder.
    Please let me know if I did not answer your question.
    Hisami

  • How can I embed a pdf file into the body of an email?

    How can I embed a pdf file into the body of an email?

    The problem is defining what it even means to “embed” a PDF file in the body of an e-mail, especially if you are dealing with a multiple page PDF file.
    E-mail is either pure text, rich text (something akin to RTF in Word), or HTML. PDF is not compatible with any of these. Thus, to embed a PDF file, something has to be converted and that means the PDF would be converted to a less graphically rich raster format. But is that what you would really want?
    I think that the MacOS and iOS e-mail clients do under some circumstances place an attached PDF file within HTML segments and by clicking on same, you get the equivalent of extracting the full PDF file, but I have no real experience with that.
    Another alternative is HTML with a proxy image with a hyperlink to an external PDF file that is invoked when you click on the hyperlink.
    Perhaps you can explain what you are really trying to accomplish and what the recipient of such an e-mail's actual experience would be?
              - Dov

  • How do i store a pdf file on the ipad?

    how do i store a pdf file on the ipad?

    There is the free iBooks app which lets you save PDFs (you can copy PDFs either via the Books part of your iTunes library or the 'open in' option in Mail), or there are paid apps such as GoodReader

  • Link to local PDF-file / or html (not web-view)

    Hi,
    i posted this in the prerelease-forum and got no answear so i thought i give it a try and post here.
    i see it is possible to link to a local pdf file with the webview function.
    but i want to show a local pdf-file in the app-browser. the one in which  linked websites are shown and where i can click "done" to close the  window.
    i've seen it f.e. in the "new yorker" app where f.e. the cartoon gallery is shown in this browser, so it has to be possible.
    does anybody know how this could work?
    tyvm
    david

    Your code is a mess:
    ** there is no apparent reason for the span:
    <td><span class="style1"
    onfocus="MM_openBrWindow('pdf/PR_launch.pdf','','')">Milford, OH
    So change that line to:
    <td>Milford, OH
    ** here you have two double quotes before This.
    <a title="”This" class="pdfFile"
    onclick="MM_openBrWindow('pdf/PR_Launch.pdf','','')"
    Change it to this, (with some other improvements):
    <a title="This" class="pdfFile"
    onclick="MM_openBrWindow(this.href,'','');return false"
    ** This is code salad:
    href="”PR_Launch.pdf”" link="" will="" open="" a=""
    .pdf=""
    file.”="">More (PR_Launch.pdf,
    230kb)</a></span></td>
    Change it to:
    href="pdf/PR_Launch.pdf">More (PR_Launch.pdf,
    230kb)</a></td>
    If you continue to have trouble, you might find my divaPOP
    Extension
    easier, and far more powerful. It automat6ically opens pdf
    files and
    links to all external files in a popup window without your
    needing to
    code each link:
    http://www.divahtml.com/products/divaPOP/open_popup_windows.php
    E. Michael Brandt
    www.divaHTML.com
    divaPOP : standards-compliant popup windows
    divaGPS : you-are-here menu highlighting
    divaFAQ : FAQ pages with pizazz
    www.valleywebdesigns.com/vwd_Vdw.asp
    JustSo PictureWindow
    JustSo PhotoAlbum, et alia

  • How can I convert a pdf file that's larger than 100MB to word

    How can I convert a pdf file that's larger than 100MB to word?
    I have just paid $20 to Adobe to get this facility but It won't work ,
    as the pdf is larger than 100MB,
    I actually believe that I have paid twice for adobe but I'll take this up with them,
    in the meantilme,
    do you have any suggestions, I really need this material in word urgently,
    many thanks
    Shanna

    If your files are this large, ExportPDF is the wrong tool for you. You need Adobe Acrobat, which runs locally and does not need to send your files to Adobe.

Maybe you are looking for

  • How do i add the airplay icon to the toolbar?

    I upgraded to Mountain Lion.  But, when I am on Safari, the AirPlay icon is missing.  How can I add it?  Thank you. Peace.

  • Import old library to new installation

    I recently restored my powermac G5. Before I restored I copied my Itunes folder to a external drive. How do I go about importing music and setting in current configuration?

  • Inccorect sim

    hiiii, can any one help me plsssss .. Urgentttt!!!! i'm turn on iphone pascode so after download itunes, can not open menu my iphone, don't know how can unlocked and valid sim to active i phone... n i don't know number emergency call. if u any one ca

  • What does the password stored in the JAGENT wallet do, and what JAVA_HOME should I use for the pw_agent_util.sh command?

    I am configuring the GoldenGate Plugin for OEM. There is a step to create the wallet. The documentation is not clear about the role of the password supplied. If I run the JAGENT as oracle user, should it match the password for the oracle user, or is

  • "Always Open With" Corrupt?

    I've noticed that Adobe GoLive keeps trying to hog (open) my RealPlayer files (.ram, .smil) --even after I click "always open with" and specifically designate RealPlayer as the default program for .ram or .smil. It's like the "always open with" comma