Pdf as in the body of e-mail.

Hello experts,
we are sending a pdf as an attachment of an e-mail.what im trying to do is to send pdf in the body of e-mail.
i have search and couldnt find any help in the documents or discussions.
here is my code:
FORM SEND_MAIL
DATA: lv_formname TYPE  tdsfname,
         lv_fm_name  TYPE  rs38l_fnam,
         ls_control_parameters TYPE ssfctrlop,
         ls_output_options     TYPE ssfcompop,
         lv_user_settings      TYPE tdbool VALUE 'X',
         ls_job_output_info    TYPE ssfcrescl,
         ls_job_output_options TYPE ssfcresop.
   DATA: lt_otfdata TYPE TABLE OF itcoo,
         lt_pdfdata TYPE TABLE OF tline WITH HEADER LINE.
   DATA: ls_data TYPE zfi_s_satici_mutabakat.
   DATA: ls_document_data       LIKE  sodocchgi1,
         lv_put_in_outbox       LIKE  sonv-flag,
         lv_sender_address      LIKE  soextreci1-receiver,
         lv_sender_address_type LIKE  soextreci1-adr_typ,
         lv_commit_work         LIKE  sonv-flag VALUE space,
         lt_packing_list  TYPE TABLE OF sopcklsti1 WITH HEADER LINE,
         lt_object_header TYPE TABLE OF solisti1   WITH HEADER LINE,
         lt_contents_bin  TYPE TABLE OF solisti1   WITH HEADER LINE,
         lt_contents_txt  TYPE TABLE OF solisti1   WITH HEADER LINE,
         lt_contents_hex  TYPE TABLE OF solix      WITH HEADER LINE,
         lt_object_para   TYPE TABLE OF soparai1   WITH HEADER LINE,
         lt_object_parb   TYPE TABLE OF soparbi1   WITH HEADER LINE,
         lt_receivers     TYPE TABLE OF somlreci1  WITH HEADER LINE.
   DATA: lv_len TYPE i,
         lv_pos TYPE i,
         lv_tab_lines TYPE i.
   DATA: lt_pdf_tab LIKE tline OCCURS 0 WITH HEADER LINE.
   CLEAR: lv_formname, lv_fm_name.
   lv_formname = 'ZLIMIT_REQUEST_FORM2'.
   PERFORM smartform_fm_name USING lv_formname
                             CHANGING lv_fm_name .
*get PDF Data
   ls_control_parameters-getotf    = 'X'.
   ls_control_parameters-no_dialog = 'X'.
   ls_output_options-tdnoprev      = 'X'.
   LOOP AT itab WHERE sel eq 'X'.
     concatenate sy-datum+6(2)'.'sy-datum+4(2)
         '.'sy-datum(4) into datum.
     CALL FUNCTION lv_fm_name
       EXPORTING
         control_parameters = ls_control_parameters
         output_options     = ls_output_options
         user_settings      = 'X'
         datum              = datum
         EPAYMENT_T1        = EPAYMENT_T1
         EPAYMENT_T2        = EPAYMENT_T2
         EPAYMENT_D1        = EPAYMENT_D1
         EPAYMENT_D2        = EPAYMENT_D2
         NAME1              = name1
"        itab               = itab[]
       IMPORTING
         job_output_info    = ls_job_output_info
       TABLES
         ITAB               = itab
     FREE: lt_otfdata, lt_pdfdata.
     lt_otfdata[] = ls_job_output_info-otfdata[].
     PERFORM convert_otf TABLES lt_otfdata lt_pdfdata.
     FREE: lt_receivers, lt_packing_list,
           lt_contents_bin, lt_contents_txt.
* Assigning the Description of the object sent in the mail
     CLEAR ls_document_data.
     ls_document_data-obj_name = 'Limit Talep Formu'.
     ls_document_data-obj_descr = 'Limit Talep Formu'.
     ls_document_data-expiry_dat  = sy-datum + 10.
     ls_document_data-sensitivty = 'F'.
     LOOP AT gt_mail.
       CLEAR : lt_receivers.
       lt_receivers-receiver = gt_mail-ZZSAHAMUDUREMAIL. " """reciever list
       lt_receivers-rec_type = 'U'.
       lt_receivers-com_type = 'INT'.
       APPEND lt_receivers.
       lt_receivers-COPY = mail_bm.
       lt_receivers-rec_type = 'U'.
       lt_receivers-com_type = 'INT'.
       APPEND lt_receivers.
     ENDLOOP.
     CLEAR: lt_contents_txt.
     lt_contents_txt-line = 'Sayın yetkili,'.
     APPEND lt_contents_txt.CLEAR lt_contents_txt.
     APPEND lt_contents_txt.
     CONCATENATE 'Ekte tarafınıza ait limit formu'
     ' bulunmaktadır.' INTO lt_contents_txt-line
     SEPARATED BY space.
     APPEND lt_contents_txt.CLEAR lt_contents_txt.
     APPEND lt_contents_txt.
     lt_contents_txt-line = 'Saygılarımızla,'.
     APPEND lt_contents_txt.CLEAR lt_contents_txt.
     CLEAR lt_packing_list.
     lt_packing_list-transf_bin  = space.
     lt_packing_list-head_start  = 1.
     lt_packing_list-head_num    = 0.
     lt_packing_list-body_start  = 1.
     lt_packing_list-body_num    = LINES( lt_contents_txt ).
     lt_packing_list-doc_type    = 'RAW'.
     APPEND lt_packing_list. CLEAR lt_packing_list.
     ls_document_data-doc_size = LINES( lt_contents_txt ) * 255.
     CALL FUNCTION 'SX_TABLE_LINE_WIDTH_CHANGE'
       EXPORTING
         line_width_src              = 134
         line_width_dst              = 255
       TABLES
         content_in                  = lt_pdfdata
         content_out                 = lt_contents_bin
       EXCEPTIONS
         err_line_width_src_too_long = 1
         err_line_width_dst_too_long = 2
         err_conv_failed             = 3
         OTHERS                      = 4.
*Filling the details in SAPoffice: Description of Imported Object
*Components table
     DESCRIBE TABLE lt_contents_bin LINES lv_tab_lines.
     CLEAR lt_contents_bin.
     READ TABLE lt_contents_bin INDEX lv_tab_lines.
     IF sy-subrc = 0.
       CLEAR: lt_packing_list.
       lt_packing_list-transf_bin = 'X'.
       lt_packing_list-head_start = 1.
       lt_packing_list-head_num = 1.
       lt_packing_list-body_start = 1.
       lt_packing_list-body_num = lv_tab_lines.
       lt_packing_list-obj_langu = sy-langu.
       lt_packing_list-doc_type = 'PDF'.
       lt_packing_list-obj_name = 'ATTACHMENT'.
       lt_packing_list-obj_descr = 'RISK TALEP FORMU.PDF'.
       lt_packing_list-doc_size = lv_tab_lines * 255.
       APPEND lt_packing_list.CLEAR lt_packing_list.
     ENDIF.
     lv_put_in_outbox = lv_commit_work = 'X'.
     CALL FUNCTION 'SO_DOCUMENT_SEND_API1'
       EXPORTING
         document_data              = ls_document_data
         put_in_outbox              = lv_put_in_outbox
         sender_address             = lv_sender_address
         sender_address_type        = lv_sender_address_type
         commit_work                = lv_commit_work
       TABLES
         packing_list               = lt_packing_list
         object_header              = lt_object_header
         contents_bin               = lt_contents_bin
         contents_txt               = lt_contents_txt
         contents_hex               = lt_contents_hex
         object_para                = lt_object_para
         object_parb                = lt_object_parb
         receivers                  = lt_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 eq 0.
*      gt_data-gonderx = 'X'.
*      modify gt_data.
*      MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
*              WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
     ENDIF.
   ENDLOOP.
ENDFORM.                    " SEND_MAIL

Hi Matthew Billingham,
i struggled quite a while if i should write a reply or not.
The fact that one of my posts got rejected by suggesting FM SO_DOCUMENT_SEND_API1 finally made me do so. (maybe the rejection was ok for the context i wrote my post for but reading through the forum i feel like some people going to panic if they read the FM-name).
I totally agree with u using CL_BC-Classes instead of old fashioned-FMs for new development.
But that should not lead us in handling the name SO_DOCUMENT_SEND_API1 like they did with the name Lord Voldemort in Harry Potter.
Wanting to display a PDF in email body instead of adding it as attchment, aint nescessary worth a complete redesign of the existing programm - as Cem Unal already posted his code and told us he just want to change it.
As long as there are programms out that use this FM, there will be questions on how to handle this FM no matter if its obsolete or not. And where should they ask, when they wont be able to ask in the scn-forum?
Reading the FMs documentation, there is nothing mentioning this FM is obsolete.
So the strategie of suggesting to use newer technics because of personal preference should (in my opinion) not lead into deleting posts regarding the old technic on the other hand.
regards
Stefan Seeburger

Similar Messages

  • 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 send a .pdf file in the body of email, not as attachment?

    Hello to all you MAC geniuses out there. I am using Pages to design flyers for my business. Then exporting them to a pdf file and trying to figure out how to send them in the BODY of an email and not an attachemnt that they have to open. Not really sure if this is a mail or pages question. It is probably a very simple step I am missing, but never the less can't seem to fiugre it out. Thanks in advance!
    Genn

    You must take into consideration that HTML & PDF are very different formats with conflicting purposes: HTML is by design intended for flexibility in appearance in such things as font & location of displayed elements, & has no fixed page size. PDF is intended to produce WYSIWYG documents, exactly the same regardless of platform, but requires either the Adobe Acrobat application or a PDF plug-in to do so.
    Because of this, there is no way to convert a PDF document into HTML that will completely preserve the PDF's appearance. You can more or less force elements into the same relative position using tables & other HTML features, but pagination cannot be preserved, since no HTML formatted documents will have page breaks.
    You also should consider that the appearance of an email message depends on the application used to view it. Most email, including what Mail generates, follows a standard known as MIME 1.0. MIME is designed to identify each element in the message such that different applications can process them according to their capabilities. Thus, since Mail knows how to display image files like gifs, tiffs, or jpegs, they will be displayed as if they were embedded in the text if the MIME tags indicate they should be. Anything Mail doesn't know how to process into displayable text or images, such as PDF's, will be displayed only as an attachment. The same will be true for other email reading applications.
    IOW, email is not WYSIWYG. Some apps will show displayable items inline, some won't, even if the MIME type is displayable on your Mac in Mail.
    There are several ways you can deal with this. You can try to convert the PDF into HTML, as suggested earlier. You will probably have to tweak the HTML so generated with an editor to get the best results, & deal with such things as pagination, image conversion or resizing, so-called web safe colors, etc. (PDF's are compressed & usually optimized for high resolution printing; to keep the message size down, you may want to convert images to lower resolution jpegs.)
    Or, you can convert the entire flyer to a jpeg or png image, which insures WYSIWYG output, but may make text harder to read.
    Alternately, you can compose a new message as plain text or as HTML that refers to the PDF's content & either includes it as an attachment or furnishes a link to a web page that contains it. This allows you to reach the widest audience, including those who do not have a PDF app or plug-in.
    Whatever you elect to do, remember that what you send in the email is actually a combination of content & instructions about how to deal with it, & that not all recipients will see it the same way, no matter what you do.

  • SmartForms - Is there a way to put PDF attachment in the body of Email?

    Hello All,
    Currently I have a Smart Form that generates an MAIL with a PDF attachment.  It works very nicely with from, to, and subject information correct.  A new request from the users is to show in the PDF output in the email vs. an attachment.  They mention that not all consumers open the PDF attachment.
    Is there a way I can write the form in the email that would look exactly like the attached PDF format?
    Or is there a way I can leave the PDF attachement with text in the email like 'Open the attachment to view the items that have been shipped in your recent order'.
    Currently I'm using CALL FUNCTION lf_fm_name with control parameters, mail_appl_obj, mail_recipient, mail_sender, and output options.
    I would greatly appreciate help in solving this ASAP.  Thanks!

    Vijaya,
    thank you for you quick response.
    i have followed your example logic and i now see a brief message in the body of the email.  Which i part of my requirement but i'm unable to open the PDF doument.
    i'm getting the error message "Abobe reader could not open 'test.PDF' because it is either not a supported file type or because the file has been damaged"
    Any idea why?  Before adding your logic after calling the smarform to use 'CONVERT_OTF'  and 'SO_NEW_DOCUMENT_ATT_SEND_API1' the attached PDF file was perfect.
    below is the the call function for my SF.  after this call i have added the logic your suggested.
    call smartform
          CALL FUNCTION lf_fm_name
               EXPORTING
                         control_parameters       = control_parameters
                         mail_appl_obj            = appl_object_id
                         mail_recipient           = recipient_id
                         mail_sender              = sender_id
                         output_options           = ls_composer_param
                         user_settings            = 'X'  "ADDED THIS SETTING
    > SmartForm specific fields
                          gi_salesord_num      = gi_salesord_num
                          gi_goods_mvmnt_date  = gi_goods_mvmnt_date
                          gi_tracking_number   = gi_tracking_number
                          gi_carrier_name      = gi_carrier_name
                          gi_email_to          = gi_email_to
                          gi_coupon            = gi_coupon            
                          gi_url_name          = gi_url_name         
               IMPORTING
                 job_output_info               = job_output_info "w_return    "ADDED IMPORTING AS TABLE
               TABLES     git_item_tab         = git_item_tab
    <
               EXCEPTIONS formatting_error     = 1
                          internal_error       = 2
                          send_error           = 3
                          user_canceled        = 4
                          OTHERS               = 5.
    in bebug mode if i look at the retuned table in debug i see values like below:
        1     //        |XPDF1        0640 00000000001                                <
        2     IN        |04EYZSF_SD_WKI_EMAIL_CONF                                      <
        3     IN        |05FIRST                                                        <
        4     OP        |LETTER  P 144  240 1581712189000010000100001                   <
        5     IN        |06WK_BRANDS_COLOR_LOGO                                         <
        6     MT        |0210001134                                                     <
    << Unformatable text removed >>>
    it looks like there is an issue with the convert or i've got some logic wrong.  Any ideas?
    Edited by: Rob Burbank on May 7, 2009 2:55 PM

  • Pdf attachments open in body of e-mail

    Using my mac mail program, when I click (on the paper clip) to attach a PDF - instead of an icon, it opens up in the body of the e-mail. Please advise. Thanks, Iza

    It might make a difference whether the document "kind" is PDF Document or Adobe PDF Document. Because Mac OS X distinguishes files by more than just the extension, two files that end in .pdf may look different to applications.
    Download those attachments, do a Get Info for both in Finder, and see if they are different based on Kind. See if that is related to them opening in the email body and not opening.

  • How can I have a newsletter I created in PDF appear in the body of an email I send, rather than attach it.

    How can I get a newsletter created in PDF format to appear in the body of an email I send, rather than attach it.

    You cannot. (A few email programs might show it automatically; you cannot stop that either).

  • How do I put a pdf flyer in the body of a message?

    Several times a month I send out a group message. Before I attached a pdf file which is a flyer with the info. I would like to send the email with the flyer right there in the body of the message (not as an attachment).
    Haven't had any luck so far and would appreciate any help. Thanks.

    I have never used an email client that could open (i.e. display) pdf documents directly; so a pdf document has to be sent as an attachment, which the recipient would save and read in his preferred pdf reader. Even if there is an email client that can do this, most can't, so your efforts would be futile.
    So, forget pdf; you need to copy-and-paste the body text of the document directly into your email message. You could still attach the pdf version if that's useful.

  • Replace the body of e-mail

    Hello,
    Can I use the command edit-body-text to replace the entire contents of the body of an e-mail?
    What I'm looking to do in a message filter is replace the contents of an e-mail without caring whats in there already.
    I just want to overwrite it with something different.
    Looking at edit-body-text command, it requires 2 parameters. Is there a way to set parameter1 to search for everything in the body to be replaced?

    Thanks Ken
    I tried [\s\S]* but the edit-body-text action didn't like the syntax and I couldn't save the message filter
    I then tried just .* and that worked but for some reason I ended up with the replacement text being repeated twice in the body of the e-mail
    So for example if my message filter has the action edit-body-text(".*","You have been sent a new message"), then body text is successfully replaced irrespective of whats in it but the replacement text appears twice in the e-mail body, so it says...
    You have been sent a new message
    You have been sent a new message
    Any idea why it puts it in twice?

  • Insert a pdf file into the body of an email

    how do i put a pdf in the body of an email?

    I can't vouch for Thunderbird since I don't use it but, any web page editor will do the trick.
    Here is a decent article on About.com on how to do this. Good luck.
    http://webdesign.about.com/od/intermediatetutorials/a/aa050800a.htm

  • Cant drag photos from my iPhoto library to the body of mac mail.

    I used to be able to drag photos to the body of my email and now I get a dotted rectangle with a arrow pointing down saying MAIL ATTACHMENT and if I touch it with my cursor I get a Error saying I cant download the attachment?
    What is going on...

    export the photo to the desktop and then attach it to the E-mail.
    That's the way I used to do it also, but I just checked and I can drag a photo directly from iPhoto, or from the "Photo Browser" in Mail directly onto a new message. I get the green circle with a white + sign and the photo get's attached to the message.
    I was surprised and pleased to see it work this way so easily.

  • Mail will NOT display a multi-page pdf file in the body.

    I want to send an email with a multi-page PDF attached that is displayed in the email- so that readers don't even have to click on the pdf to open it. Can I do that? I can do a single page, and I did determine that if I save all the pages of the document as single pds and then attach those, that works, but is there a way to display a multi-page pdf? Any help would be greatly appreciated!

    I do not use pages - there are several possible solutions to your situation - in pages you should be able to do a send pdf to iPhoto and then in iPhoto you can create an e-mail with smaller (and harder to read) images- you may be able to produce smaller (lower quality) PDFs in pages (don't know), you can change e-mail servers - use a different one it you have multiple accounts or get a free gmail account or other new account that will handle your needs
    LN

  • I can't see the body of my mails, I just se the preview.

    I dont know why my mails do not show on the window at the right side of the display.
    I can only see on the left side, all the received mails and the 3 lines of the preview, but on the right side only shows From, To and the subject
    Anibody has any idea what can I do?
    Thanks

    Quit the mail app, launch the app again and then look to see if the messages appear, if not - quit the mail app and restart the iPad.
    Go to the home screen first by tapping the home button. Quit/close open apps by double tapping the home button and the task bar will appear with all of you recent/open apps displayed at the bottom. Tap and hold down on any app icon until it begins to wiggle. Tap the minus sign in the upper left corner to close the apps.
    Restart the iPad. Restart the iPad by holding down on the sleep button until the red slider appears and then slide to shut off. To power up hold the sleep button until the Apple logo appears and let go of the button.
    If that doesn't work, reset your iPad.
    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 is a problem. The new layout for apple mail in iCloud shows the body of a mail or any attachments on the right half of the screen. But it won't print just the attachment, it prints the whole email page, cutting off the bottom of the attachment.

    Even if I try to 'screen shot' just the attachment, the view won't move down as I enlarge the 'screen shot' to get all of the attachment. Previously, I could "SAVE" the attachment and only the attachment would be saved. Now the whole email page including the address info from the top is saved, so when I try to print what should be an 8.5x11 attachment the bottom of it won't print because the top 2" include the email address info.
    Suggestions?

    That's one of the weird things.. it recognizes it maybe 10% of the time. And usually, only after I do the two-button reset. Problem is.. since it won't charge above 2%, anytime I try to do a restore or anything like that using iTunes, my device shuts off and I lose whatever progress I'd made.
    So, an update... after reading through a bunch of similar complaints (there are literally 1000's of them so there's NO WAY this isn't somehow ios7 related, thanks a lot APPLE ) I decided to try a restore in recovery mode. After 3 hours and several disconnections... I ended up having to just set it up as a new iPad, as the restore did nothing. Weirdly though... as I was doing the restore in recovery mode.. I noticed I'd gotten up to a 10% charge.. higher than it's been since September, so after setting it up as a new device, I turned it off and plugged it in using the wall charger. 2 hours later and I was up to 38%. Still not great, as my iPad, before ios7 could've fully charged twice in the amount of time it took for me to now get 28% more of a charge. And that's with a fully cleaned out device.. so that really ***** and I'm now more confused than ever.
    But I'm gonna leave it overnight charging and see what I come up with tomorrow. Sadly, when I paid $600 for it in February, I never expected to have to play "wait and see" with it...

  • HT204093 the body of my email does not appear to the right when I select a mail message.

    The body of incoming mail messages do not appear to the right when I select a mail message?
    Anybody know how to adjust this?
    Jgm

    Hello!
    Please try these steps: Can't see email message content

  • Link to a SAP transaction in the body mail using SO_NEW_DOCUMENT_SEND_API1

    Hi everyone,
    Is it possible to set a link to a text in the body of a mail sent by SO_NEW_DOCUMENT_SEND_API1, in order to navigate to a SAP transaction?
    Example:
    Body (in sbwp):
    Distribution done. Click  here for going to transfer program.
    And the link is a transaction to a report program.
    Regards everybody in advance. Points promised for every help answer.

    Hi
    Re: link to FM
    Regards
    pavan

Maybe you are looking for

  • Add Contact's Email and Phone to the Lead result list on WEB UI

    Hello All, My requirement is to add Contact's Phone number and Email on Lead result list. Technical details: BT108S_LEA(Comp) BT108S_LEA/Result (View) RESULT (CN) I have enhanced context node ' Result ' and added new field through wizard (Ex: Contact

  • Lightroom Trial Version Not Importing TIFFs

    This morning I installed the 30 day trial version of Lightroom. If I import a folder of mixed RAW and TIFF files, I see ONLY the raw files in Lightroom. If I go back into the import dialog and select the TIFF again and try to import, a message is dis

  • RFC adapter commit

    Hi, I have a scenario with RFC adapter using BPM. This scenario working and live but now we find out that 1 material document not posted but we able to get the mat doc number. This is only happen for 1 time and others material was posted successful.

  • Re-opening most recent files/web sites--how can i disable this?

    when I close a window and then reopen it, or when i log out and then log back in, the most recent thing I was looking at from before immediately pops open.  That is not necessarily the way I would like it to work--didn't do that with Snow L.  How can

  • Account not recognised by Skype???????????????????...

    Right... this has been doing my nut right in, yet another problem with some Microsoft technology! When MS applications work, they work great, but when they go wrong they go **bleep** up in a big way. Ive had a Skype account for years, granted I may h