Send payload content as email attachment

Hi all
I have a field in the source structure, the content of this field/tag has to be sent as an email attachment.
Appreciate your help in advance
-Keerthi

Hi,
Try using a receiver mail adpater, you can send the payload data as attachment.
http://help.sap.com/saphelp_tm60/helpdata/en/6b/4493404f673028e10000000a1550b0/content.htm
Thanks,
Pragati

Similar Messages

  • How do I save my exported doc in order to send it as an email attachment?

    how do I save my exported doc in order to send it as an email attachment?

    Plug your ipod in and pull up itunes. Then click on the device name in the left hand side. Click the restore option. When it goes all the way through and says "your device has been restored and is restarting, once it restarts you want to choose the option that says "setup as a new device"

  • How to send task content as email?

    Hi all,
    I have task list, need to send task content as email to a person like:
    How to achieve this?

    Hello,
    create a workflow with SharePoint Designer that sends an email when an item is created.
    Or edit the list form with InfoPath and create a special email view. Include all the fields you want to send in the email. Then create a data connection to submit to email and configure who it is sent to and what the subject line is based on the form values.
    Use a button to submit the form and add a rule to submit the form data, then switch to the email view, submit to the email connection and then close the form.
    This way, the recipient will see the exact form you defined in InfoPath  in the email view.
    cheers, teylyn

  • Can you send slideshows as an email attachment?

    can you send slideshows as an email attachment? Please provide the steps if it is possible, thank you

    Yes, but you shouldn't.
    Here's how.
    Export the Slideshow to the FInder - a process that will make a QuickTime movie of it.
    Attach that movie to the email. Send
    Why not? Videos are very large files. Most Internet providers have a limit on the largest file you can send. Sending one too large means it can bounce back to you. ALso, even if the other person can receive it, downloading large files via email is slow, and can even cause crashes on some email apps on older systems.
    Intead of emailing it, upload it to DropBox, YouTube, Vimeo, or any other sharing site and send the person a link.
    Then they can download it themselves
    Regards
    TD

  • Send Report output as Email attachment (PDF)

    Hi Experts,
      i am trying to send the contents of an internal table from my report as email using PDF attachment. I have coded the logic and i get the attachment in the email. When i try to open the attachement, i cannot open it.
    The message i get is "_Adobe reader could not open the attachment "attach.pdf" because it is either not a supported file type or the file has been damaged(for example, it was sent as an email attachment and wasn't correctly decoded )._
    Not sure where i went wrong.
      ld_email   = p_email.
      ld_mtitle = p_mtitle.
      ld_format              = p_format.
      ld_attdescription      = p_attdescription.
      ld_attfilename         = p_filename.
      ld_sender_address      = p_sender_address.
      ld_sender_address_type = p_sender_addres_type.
    Fill the document data.
      w_doc_data-doc_size = 1.
    Populate the subject/generic message attributes
      w_doc_data-obj_langu = sy-langu.
      w_doc_data-obj_name  = 'SAPRPT'.
      w_doc_data-obj_descr = ld_mtitle .
      w_doc_data-sensitivty = 'F'.
    Fill the document data and get size of attachment
    CLEAR w_doc_data.
      READ TABLE it_attach INDEX w_cnt.
      w_doc_data-doc_size =
      ( w_cnt - 1 ) * 255 + STRLEN( it_attach ).
      w_doc_data-obj_langu  = sy-langu.
      w_doc_data-obj_name   = 'SAPRPT'.
      w_doc_data-obj_descr  = ld_mtitle.
      w_doc_data-sensitivty = 'F'.
      CLEAR t_attachment.
      REFRESH t_attachment.
      t_attachment[] = it_attach[].
    Describe the body of the message
      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.
      DESCRIBE TABLE it_message LINES t_packing_list-body_num.
      t_packing_list-doc_type = 'RAW'.
      APPEND t_packing_list.
    Create attachment notification
      t_packing_list-transf_bin = 'X'.
      t_packing_list-head_start = 1.
      t_packing_list-head_num   = 1.
      t_packing_list-body_start = 1.
      DESCRIBE TABLE t_attachment LINES t_packing_list-body_num.
      t_packing_list-doc_type   =  ld_format.
      t_packing_list-obj_descr  =  ld_attdescription.
      t_packing_list-obj_name   =  ld_attfilename.
      t_packing_list-doc_size   =  t_packing_list-body_num * 255.
      APPEND t_packing_list.
    Add the recipients email address
      CLEAR t_receivers.
      REFRESH t_receivers.
      t_receivers-receiver = ld_email.
      t_receivers-rec_type = 'U'.
      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.
    Populate zerror return code
      ld_error = sy-subrc.
    Populate zreceiver return code
      LOOP AT t_receivers.
        ld_receiver = t_receivers-retrn_code.
      ENDLOOP.
    ENDFORM.                    "send_file_as_email_attachment

    Hello RnB,
    You can check the mentioned link for the same:
    [Simple Program to generate PDF from ABAP List Output.|http://www.abapmadeeasy.com/2011/02/sap-abap-simple-program-to-generate-pdf.html]
    Regards,
    Uttam Agrawal

  • Sending document as an email attachment

    I have just installed pages '08 and trying to find out how to send a document as an email attachment. I accustomed to using Word, which has "send as an attachment" in the File menu, which is very convenient, since it takes a couple of seconds and you don't have to save and find files to drop into the email.
    Does Pages have anything like this?

    Pages doesn't have a function like that, and in fact Pages files are a bit cumbersome to mail, since they need to be archived (compressed/"zipped") first, to ensure they get sent correctly. In other words, the process is to select the document in the Finder, in the File menu choose "Create Archive" and then attach the resulting file to the email.
    There is a trick however that will make doing this easier -- if you have a saved Pages file, you can go up to the title bar and Control-click on the icon next to the file name. This action will produce a dropdown menu that lists the path to the file. The item just below the file name is the folder that the file is in -- if you choose that item, you will see a Finder window for that folder pop up, with the file name highlighted. You can now immediately go to the Finder's File menu and choose Create Archive. This technique means you don't have to hunt around for where the file is located on your computer, and can speed things up a bit. (This Control-click on the proxy icon works in all windows in OS X, not just for Pages.)

  • Send report as an email attachment from a page

    Hi
    I have page which generates a report based on two filters. After the report is generated, 'I want to send that report as an email attachment from that page, when button is clicked "Send Email"
    Thanks a lot in advance.'

    I accomplished functionality I believe similar to what you are looking for in an application once by querying a report into an html e-mail message. This approach gives you all kinds of flexibility. At least this would be one way of doing it. I am going to include a simplified sample here of what the script looked like. I hope this is at least helpful.
    DECLARE
    l_body_html CLOB;
    BEGIN
    l_body_html :=
    '<html>
    <head>
    <style type="text/css">
    body{font-family: Arial, Helvetica, sans-serif;
    font-size:9pt;
    margin:30px;
    background-color:#ffffff;}
    </style>
    </head><body>
    ' || UTL_TCP.crlf;
    l_body_html :=
    l_body_html || '<table border="1"><tr bgcolor="#999999">
    <th width="75" scope="col">
    Department
    </th>
    <th width="75" scope="col">
    Course
    </th>
    </tr>' || UTL_TCP.crlf;
    FOR c1 IN (SELECT some_table.DEPARTMENT, some_table.COURSE FROM some_table)
    LOOP
    l_body_html :=
    l_body_html || '<tr><td>
    ' || c1.DEPARTMENT || '
    </td>' || UTL_TCP.crlf;
    l_body_html := l_body_html || '<td>
    ' || c1.COURSE || '
    </td>' || UTL_TCP.crlf;
    l_body_html := l_body_html || '</tr>' || UTL_TCP.crlf;
    END LOOP;
    l_body_html := l_body_html || '</table>' || UTL_TCP.crlf;
    apex_mail.send(
    p_to => '<some email address>',
    p_from => '<desired from address here>',
    p_body => NULL,
    p_body_html => l_body_html,
    p_subj => '<desired subject line here>');
    END loop;
    apex_mail.push_queue;
    END;
    Edited by: stbrownOSU on Dec 8, 2009 2:53 PM
    I think something must have happened when I copied and pasted the code from TOAD. I have corrected the above code. Please try it again.

  • Send destination message in email attachment

    I have a source schema(let A) and it is converted into destination schema(let B) through mapping.The destination message is sent to a file location.Now I want to send this destination message in email attachment through c# code.but the destination message
    should be pick up from orchestration not from send file location.
    how it is possible ?

    Are you talking about sending your message as an attachment through the orchestration? Well that is what the SMTP Adapter is for. Refer
    http://winterdom.com/2005/08/smtpadapterinbts2006andhtmlformattedmessages and the official document on SMTP Adapter @http://msdn.microsoft.com/en-us/library/aa578267.aspx
    To receive mails into an orchestration, you should have a POP3 enabled e-mail account, use the POP3 Adapter with the MIME/S-MIME Pipeline Components to pick-up and read the mails from BizTalk.
    Regards.

  • Send PDF-Spool via email-Attachment

    Hi,
    i send an internal table to spool and convert it.
    this works ok.
    But when i send it via
       CALL FUNCTION 'SO_DOCUMENT_SEND_API1'
    i have problem with the attachment (PDF-Error).
    Has anyboby a codeexample?
    Here my short report until Conversion into PDF
    REPORT ZGRO_TEST.
    TABLES: MARA.
    DATA: BEGIN OF ITAB OCCURS 0.
            INCLUDE STRUCTURE MARA.
    DATA: END   OF ITAB.
    DATA: FILESIZE     TYPE I.
    Spoolnummer
    DATA: SPOOL_NR     LIKE TSP01-RQIDENT.
    PDF Ausgabetabelle
    DATA: BEGIN OF PDF_OUTPUT OCCURS 0.
            INCLUDE STRUCTURE TLINE.
    DATA: END   OF PDF_OUTPUT.
    START-OF-SELECTION.
      SELECT * FROM MARA INTO TABLE ITAB UP TO 100 ROWS.
    Ausgabe in Spool umleiten
      NEW-PAGE PRINT ON LINE-SIZE 255
                     NO DIALOG
                     NO-TITLE
                     NO-HEADING
                     IMMEDIATELY ' '.
    interne tabelle ausgeben
      LOOP AT ITAB.
        WRITE:/ ITAB.
      ENDLOOP.
    Rücksetzen Spollausgabe auf Bildschirm.
      NEW-PAGE PRINT OFF.
    Spoolnummer besorgen
      SPOOL_NR = SY-SPONO.
      CALL FUNCTION 'CONVERT_ABAPSPOOLJOB_2_PDF'
           EXPORTING
                SRC_SPOOLID   = SPOOL_NR
           IMPORTING
                PDF_BYTECOUNT = FILESIZE
           TABLES
                PDF           = PDF_OUTPUT.
    END-OF-SELECTION.
    How can i use the PDF_OUTPUT as email attachment?
    Thanks for help.
    Regards, Dieter

    after you get the pdf output:
    do like this:
      LOOP AT it_pdf_output.
        TRANSLATE it_pdf_output USING ' ~'.
        CONCATENATE gd_buffer it_pdf_output INTO gd_buffer.
      ENDLOOP.
      TRANSLATE gd_buffer USING '~ '.
      DO.
        it_mess_att = gd_buffer.
        APPEND it_mess_att.
        SHIFT gd_buffer LEFT BY 255 PLACES.
        IF gd_buffer IS INITIAL.
          EXIT.
        ENDIF.
      ENDDO.
    REFRESH it_mess_bod.
    Default subject matter
      gd_subject         = 'Subject'.
      gd_attachment_desc = 'Attachname'.
    CONCATENATE 'attach_name' ' ' INTO gd_attachment_name.
      it_mess_bod        = 'Message Body text, line 1'.
      APPEND it_mess_bod.
      it_mess_bod        = 'Message Body text, line 2...'.
      APPEND it_mess_bod.
    If no sender specified - default blank
      IF p_sender EQ space.
        gd_sender_type  = space.
      ELSE.
        gd_sender_type  = 'INT'.
      ENDIF.
    Send file by email as pdf   PERFORM send_file_as_email_attachment
                                   tables it_mess_bod
                                          it_mess_att
                                    using p_email
                                          'Example .pdf documnet attachment'
                                          'PDF'
                                          gd_attachment_name
                                          gd_attachment_desc
                                          p_sender
                                          gd_sender_type
                                 changing gd_error
                                          gd_reciever.
    FORM send_file_as_email_attachment tables it_message
                                              it_attach
                                        using p_email
                                              p_mtitle
                                              p_format
                                              p_filename
                                              p_attdescription
                                              p_sender_address
                                              p_sender_addres_type
                                     changing p_error
                                              p_reciever.
      DATA: ld_error    TYPE sy-subrc,
            ld_reciever TYPE sy-subrc,
            ld_mtitle LIKE sodocchgi1-obj_descr,
            ld_email LIKE  somlreci1-receiver,
            ld_format TYPE  so_obj_tp ,
            ld_attdescription TYPE  so_obj_nam ,
            ld_attfilename TYPE  so_obj_des ,
            ld_sender_address LIKE  soextreci1-receiver,
            ld_sender_address_type LIKE  soextreci1-adr_typ,
            ld_receiver LIKE  sy-subrc.
    data:   t_packing_list like sopcklsti1 occurs 0 with header line,
            t_contents like solisti1 occurs 0 with header line,
            t_receivers like somlreci1 occurs 0 with header line,
            t_attachment like solisti1 occurs 0 with header line,
            t_object_header like solisti1 occurs 0 with header line,
            w_cnt type i,
            w_sent_all(1) type c,
            w_doc_data like sodocchgi1.
      ld_email   = p_email.
      ld_mtitle = p_mtitle.
      ld_format              = p_format.
      ld_attdescription      = p_attdescription.
      ld_attfilename         = p_filename.
      ld_sender_address      = p_sender_address.
      ld_sender_address_type = p_sender_addres_type.
    Fill the document data.
      w_doc_data-doc_size = 1.
    Populate the subject/generic message attributes
      w_doc_data-obj_langu = sy-langu.
      w_doc_data-obj_name  = 'SAPRPT'.
      w_doc_data-obj_descr = ld_mtitle .
      w_doc_data-sensitivty = 'F'.
    Fill the document data and get size of attachment
      CLEAR w_doc_data.
      READ TABLE it_attach INDEX w_cnt.
      w_doc_data-doc_size =
         ( w_cnt - 1 ) * 255 + STRLEN( it_attach ).
      w_doc_data-obj_langu  = sy-langu.
      w_doc_data-obj_name   = 'SAPRPT'.
      w_doc_data-obj_descr  = ld_mtitle.
      w_doc_data-sensitivty = 'F'.
      CLEAR t_attachment.
      REFRESH t_attachment.
      t_attachment[] = it_attach[].
    Describe the body of the message
      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.
      DESCRIBE TABLE it_message LINES t_packing_list-body_num.
      t_packing_list-doc_type = 'RAW'.
      APPEND t_packing_list.
    Create attachment notification
      t_packing_list-transf_bin = 'X'.
      t_packing_list-head_start = 1.
      t_packing_list-head_num   = 1.
      t_packing_list-body_start = 1.
      DESCRIBE TABLE t_attachment LINES t_packing_list-body_num.
      t_packing_list-doc_type   =  ld_format.
      t_packing_list-obj_descr  =  ld_attdescription.
      t_packing_list-obj_name   =  ld_attfilename.
      t_packing_list-doc_size   =  t_packing_list-body_num * 255.
      APPEND t_packing_list.
    Add the recipients email address
      CLEAR t_receivers.
      REFRESH t_receivers.
      t_receivers-receiver = ld_email.
      t_receivers-rec_type = 'U'.
      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.
    Populate zerror return code
      ld_error = sy-subrc.
    Populate zreceiver return code
      LOOP AT t_receivers.
        ld_receiver = t_receivers-retrn_code.
      ENDLOOP.
    ENDFORM.
    Regards,
    Ravi

  • Do not know how to take a saved doc and send it as an email attachment in my gmail account

    how do i take a scanned doc, saved in my doc folder and send it as an email to recipient.
    I get confirmation that it was sent but person says it was not attached

    Hi,
    The following is the program[Click Here| http://saptechnical .com/Tips/ABAP/email/EmailProgram.txt] which will send any format file. Actual Creator of the program is Amit Bisht.
    Thanks & Regards,
    Rock.

  • Sending XI-Content as Mail Attachement with specific Filename

    Hi,
    I want to send the Message-Content as a mail attachment with a specific Filename (e.g. 2005-08-31.csv). The content is a CSV File, not a XML
    In the scenario an IDOC is sent to the XI mapped in a CSV-File (via Java-Mapping) and should be send as a Mail Attachment.
    Is this possible and how?
    Thank you for your help
    Thomas

    Hi Thomas,
    You can influence the filename with the ModuleTransformBean. You need at least SP9 for this feature.
    In the Mail Receiver Channel got to tab "Module"
    As first module (before the mail module) enter:
    localejbs/AF_Modules/MessageTransformBean as Local Enterprise Bean with any key
    For this module key you can use in the module configuration following entries:
    Transform.ContentDisposition inline|attachment;filename=<filename>
    Transform.ContentDescription <Filename>
    Transform.ContentType <MimeType>/<SubType>;name="<filename>"
    If you want to send an attachment, use:
    Transform.ContentDisposition attachment;filename="MyFile.csv"
    Transform.ContentDescription MyFile
    Transform.ContentType text/plain;name="MyFile.csv"
    If you use the Mail Package, you can set the file name that way:
    <ns:Mail xmlns:ns="http://sap.com/xi/XI/Mail/30">
      <Subject>Hello</Subject>
      <From>[email protected]</From>
      <To>[email protected]</To>
      <Content_Type>text/plain;name="MyFile.csv"</Content_Type>
      <Content>Here comes the CSV Data</Content>
    </ns:Mail>
    Hope that helps,
    Stefan

  • Send Adobe form as email attachment

    Hello Experts,
    Recently iu2019m facing a problem regarding Adobe form PDF attachment and sending an e-mail along with the PDF attachment to customer mail id.But when i execute the RFC Function module, in customer side no mail is comming. And when i check the transaction SBWP then i found that the PDF attachment hold only 1KB of data which is not right.For that iu2019m sending my code which i was declared in my program.Can anybody Please help me to overcome this problem?
    FORM print_form USING p_disp       TYPE char1
                          drb_mail     TYPE char1
                         p_email LIKE itcpo-tdcovtitle
                         p_email1 LIKE itcpo-tdcovtitle.
      DATA ds_recipient  TYPE   swotobjid.
      CLEAR: dg_funcnam, dg_outputparams.
    *--Call generated function module
      CALL FUNCTION 'FP_FUNCTION_MODULE_NAME'
        EXPORTING
          i_name     = c_form
        IMPORTING
          e_funcname = dg_funcnam.
    dg_outputparams-nodialog = 'X'.
    dg_outputparams-getpdf   = 'X'.
    Job Open for PDF
    CALL FUNCTION 'FPCOMP_JOB_OPEN'
      CHANGING
        ie_outpar      = dg_outputparams
      EXCEPTIONS
        cancel         = 1
        usage_error    = 2
        system_error   = 3
        internal_error = 4
        OTHERS         = 5.
    IF sy-subrc <> 0.
      MESSAGE ID sy-msgid TYPE 'I' NUMBER sy-msgno
             WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      EXIT.
    ENDIF.
    dg_docparams-langu = 'X'.
    dg_docparams-country = 'US'.
    dg_docparams-fillable = 'X'.
    form CONVERT_PDF_BINARY .
      CALL FUNCTION 'SCMS_XSTRING_TO_BINARY'
        EXPORTING
          BUFFER                = FP_FORMOUTPUT-PDF
      APPEND_TO_TABLE         =  ' '
    IMPORTING
      OUTPUT_LENGTH         =
        TABLES
          BINARY_TAB            = t_att_content_hex .
    endform.                    " CONVERT_PDF_BINARY
    *&      Form  MAIL_ATTACHMENT
          text
    -->  p1        text
    <--  p2        text
    form MAIL_ATTACHMENT USING  p_email LIKE itcpo-tdcovtitle
                        p_email1 LIKE itcpo-tdcovtitle.
    CLASS cl_bcs DEFINITION LOAD.
      DATA:
      lo_send_request TYPE REF TO cl_bcs VALUE IS INITIAL.
      lo_send_request = cl_bcs=>create_persistent( ).
    Message body and subject
      DATA:
      lt_message_body TYPE bcsy_text VALUE IS INITIAL,
      lo_document TYPE REF TO cl_document_bcs VALUE IS INITIAL.
      APPEND 'Dear,' TO lt_message_body.
      append ' ' to lt_message_body.
      APPEND 'Please fill the attached form and send it back to us.'
      TO lt_message_body.
      append ' ' to lt_message_body.
      APPEND 'Thank You,' TO lt_message_body.  lo_document = cl_document_bcs=>create_document(
      i_type = 'RAW'
      i_text = lt_message_body
      i_subject = 'Personnel Information Form' ).
      DATA: lx_document_bcs TYPE REF TO cx_document_bcs VALUE IS INITIAL.  TRY.
          lo_document->add_attachment(
          EXPORTING
          i_attachment_type = 'PDF'
          i_attachment_subject = 'Personnel Information Form'
    I_ATTACHMENT_SIZE =
    I_ATTACHMENT_LANGUAGE = SPACE
    I_ATT_CONTENT_TEXT =
    I_ATTACHMENT_HEADER =
          i_att_content_hex = t_att_content_hex ).
        CATCH cx_document_bcs INTO lx_document_bcs.
      ENDTRY.
    Add attachment
    Pass the document to send request
      lo_send_request->set_document( lo_document )."* Create sender
      DATA:
      lo_sender TYPE REF TO if_sender_bcs VALUE IS INITIAL,
      l_send type ADR6-SMTP_ADDR value ' here mail id '.
    l_send = P_email.
    l_send = P_email1.
    lo_sender = cl_cam_address_bcs=>create_internet_address( l_send ).
      lo_sender = cl_sapuser_bcs=>create( sy-uname ).
    Set sender
      lo_send_request->set_sender(
      EXPORTING
      i_sender = lo_sender )." Create recipient
      DATA:
      lo_recipient TYPE REF TO if_recipient_bcs VALUE IS INITIAL.
    lo_recipient = cl_sapuser_bcs=>create( sy-uname ).
      lo_recipient = cl_cam_address_bcs=>create_internet_address( l_send ).
    lo_recipient = cl_cam_address_bcs=>create_internet_address( l_send ).
    Set recipient
      lo_send_request->add_recipient(
      EXPORTING
      i_recipient = lo_recipient
      i_express = 'X' ).
    lo_send_request->add_recipient(
    EXPORTING
    i_recipient = lo_recipient
    i_express = 'X' ).* Send email
      DATA: lv_sent_to_all(1) TYPE c VALUE IS INITIAL.
      lo_send_request->send(
      EXPORTING
      i_with_error_screen = 'X'
      RECEIVING
      result = lv_sent_to_all ).
      COMMIT WORK.
      message 'The Personnel Information form has been emailed to the Employee' type 'I'.
    endform.                    " MAIL_ATTACHMENT
    *--Call Function module
    CALL FUNCTION dg_funcnam
      EXPORTING
        /1bcdwb/docparams  = dg_docparams
        im_logo         = dg_logo
        im_user_address = dt_user_address
        im_ship_to_addr = dt_imp_data
        im_text         = ds_text
        im_sales_text   = dt_sales_text
        im_item_data    = dt_item_data
      IMPORTING
        /1BCDWB/FORMOUTPUT = FP_FORMOUTPUT
      EXCEPTIONS
        usage_error     = 1
        system_error    = 2
        internal_error  = 3
        OTHERS          = 4.
    IF sy-subrc <> 0.
    ENDIF.
    CALL FUNCTION 'FPCOMP_JOB_CLOSE'
      IMPORTING
        e_jobresult    = l_result
      EXCEPTIONS
        usage_error    = 1
        system_error   = 2
        internal_error = 3
        OTHERS         = 4.
    IF sy-subrc <> 0.
      MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
              WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    ENDIF.
    DATA : dl_msg TYPE string.
    CONCATENATE 'Successfully mailed to' p_email p_email1 INTO dl_msg SEPARATED BY space.
    IF drb_mail = 'X'.
       COMMIT WORK.
       MESSAGE dl_msg TYPE 'I' .
       MESSAGE i000 WITH 'Successfully mailed to' p_email1.
    ENDIF.
    ENDFORM.                    "print_form
    Could you please any body help me, it's very uregent issue.
    Regards
    Sandeep

    *& Report  ZGB_ATTACHMENT
    REPORT  zgb_attachment.
    DATA:
    l_formname        TYPE fpname VALUE 'ZGB_ATTACHMENT',
    l_fm_name         TYPE rs38l_fnam,
    fp_outputparams   TYPE sfpoutputparams,
    fp_docparams      TYPE sfpdocparams,
    fp_formoutput     TYPE fpformoutput.
    DATA:
      t_att_content_hex TYPE solix_tab.
    PARAMETERS: p_pernr TYPE persno.
    START-OF-SELECTION.
      PERFORM get_function_module.
      PERFORM create_document.
      PERFORM convert_pdf_to_binary.
      PERFORM mail_attachment.
    *&      Form  GET_FUNCTION_MODULE
    *       text
    *  -->  p1        text
    *  <--  p2        text
    FORM get_function_module .
      CALL FUNCTION 'FP_FUNCTION_MODULE_NAME'
        EXPORTING
          i_name              = l_formname
        IMPORTING
          e_funcname          = l_fm_name
    *     E_INTERFACE_TYPE    =
    *     EV_FUNCNAME_INBOUND =
    ENDFORM.                    " GET_FUNCTION_MODULE
    *&      Form  CREATE_DOCUMENT
    *       text
    *  -->  p1        text
    *  <--  p2        text
    FORM create_document .
    *JOB OPEN
      CALL FUNCTION 'FP_JOB_OPEN'
        CHANGING
          ie_outputparams = fp_outputparams
        EXCEPTIONS
          cancel          = 1
          usage_error     = 2
          system_error    = 3
          internal_error  = 4
          OTHERS          = 5.
      IF sy-subrc <> 0.
    * Implement suitable error handling here
      ENDIF.
      fp_docparams-langu = 'X'.
      fp_docparams-country = 'US'.
      fp_docparams-fillable = 'X'.
      CALL FUNCTION l_fm_name
        EXPORTING
         /1bcdwb/docparams        = fp_docparams
          pernr                    = p_pernr
       IMPORTING
         /1bcdwb/formoutput       = fp_formoutput
    * EXCEPTIONS
    *   USAGE_ERROR              = 1
    *   SYSTEM_ERROR             = 2
    *   INTERNAL_ERROR           = 3
    *   OTHERS                   = 4
      IF sy-subrc <> 0.
    * Implement suitable error handling here
      ENDIF.
    *JOB CLOSE
      CALL FUNCTION 'FP_JOB_CLOSE'
    *    IMPORTING
    *      e_result       =
        EXCEPTIONS
          usage_error    = 1
          system_error   = 2
          internal_error = 3
          OTHERS         = 4.
      IF sy-subrc <> 0.
    * Implement suitable error handling here
      ENDIF.
    ENDFORM.                    " CREATE_DOCUMENT
    *&      Form  CONVERT_PDF_TO_BINARY
    *       text
    *  -->  p1        text
    *  <--  p2        text
    FORM convert_pdf_to_binary .
      CALL FUNCTION 'SCMS_XSTRING_TO_BINARY'
        EXPORTING
          buffer                = fp_formoutput-pdf
    *   APPEND_TO_TABLE       = ' '
    * IMPORTING
    *   OUTPUT_LENGTH         =
        TABLES
          binary_tab            = t_att_content_hex
    ENDFORM.                    " CONVERT_PDF_TO_BINARY
    *&      Form  MAIL_ATTACHMENT
    FORM mail_attachment .
      CLASS cl_bcs DEFINITION LOAD.
      DATA:
      lo_send_request TYPE REF TO cl_bcs VALUE IS INITIAL.
      lo_send_request = cl_bcs=>create_persistent( ).
    * Message body and subject
      DATA:
      lt_message_body TYPE bcsy_text VALUE IS INITIAL,
      lo_document TYPE REF TO cl_document_bcs VALUE IS INITIAL.
      APPEND 'Dear,' TO lt_message_body.
      APPEND ' ' TO lt_message_body.
      APPEND 'Please fill the attached form and send it back to us.'
      TO lt_message_body.
      APPEND ' ' TO lt_message_body.
      APPEND 'Thank You,' TO lt_message_body.
      lo_document = cl_document_bcs=>create_document(
      i_type = 'RAW'
      i_text = lt_message_body
      i_subject = 'Personnel Information Form' ).
      DATA: lx_document_bcs TYPE REF TO cx_document_bcs VALUE IS INITIAL.
      TRY.
          lo_document->add_attachment(
          EXPORTING
          i_attachment_type = 'PDF'
          i_attachment_subject = 'Personnel Information Form'
    * I_ATTACHMENT_SIZE =
    * I_ATTACHMENT_LANGUAGE = SPACE
    * I_ATT_CONTENT_TEXT =
    * I_ATTACHMENT_HEADER =
          i_att_content_hex = t_att_content_hex ).
        CATCH cx_document_bcs INTO lx_document_bcs.
      ENDTRY.
    * Add attachment
    * Pass the document to send request
      lo_send_request->set_document( lo_document ).
    * Create sender
      DATA:
      lo_sender TYPE REF TO if_sender_bcs VALUE IS INITIAL,
      l_send TYPE adr6-smtp_addr VALUE '[email protected]'.
    *  lo_sender = cl_cam_address_bcs=>create_internet_address( l_send ).
      lo_sender = cl_sapuser_bcs=>create( sy-uname ).
    * Set sender
      lo_send_request->set_sender(
      EXPORTING
      i_sender = lo_sender ).
    * Create recipient
      DATA:
      lo_recipient TYPE REF TO if_recipient_bcs VALUE IS INITIAL.
    *  lo_recipient = cl_sapuser_bcs=>create( sy-uname ).
      lo_recipient = cl_cam_address_bcs=>create_internet_address( l_send ).
    ** Set recipient
      lo_send_request->add_recipient(
      EXPORTING
      i_recipient = lo_recipient
      i_express = 'X' ).
    *  lo_send_request->add_recipient(
    *  EXPORTING
    *  i_recipient = lo_recipient
    *  i_express = 'X' ).
    * Send email
      DATA: lv_sent_to_all(1) TYPE c VALUE IS INITIAL.
      lo_send_request->send(
      EXPORTING
      i_with_error_screen = 'X'
      RECEIVING
      result = lv_sent_to_all ).
      COMMIT WORK.
      MESSAGE 'The Personnel Information form has been emailed to the Employee' TYPE 'I'.
    ENDFORM.                    " MAIL_ATTACHMENT

  • LOGO not going when sending the report as Email attachement

    Hi
    We are calling reports in two ways (both as html format) to be sent as Email. The report includes company logo at the top
    1.Running report in cache through Web.Show_document and
    copy it by using copy_report_object_output and
    displaying it using Web.show_document('mailto: '||:resorts_name.e_mail);
    2. By using xml distribution list to dynamic emails
    web.show_document('myserver...servlet?report=myreport&server=myserver&userid=user@ourdb
    &distribute=yes&destination=ourxml.xml');
    By using 1st method The report has to manually reattach, and is attached and sent but Company Logo is not being displayed and it shows only the html file and at the logo it displays the red crossed. The reason seams that when it produces the report it creates two file html and gif file and while reattaching it attach only htm and not logo.
    By Using 2nd method of the distribution list and the xml file it attaches report in the body however it disturbs the margin due to the email headers and it shows the logo but when prints the report again it show red marked blank area as of 1.
    Does any one faced the problem of logo not being displayed at the email when report was sent and any solution regarding this will be highly appreatiated.
    Regards
    Yasir Maqbool

    Hi,
    After generating them write a program to send the mail .
    for that convert the pay slip to PDF format and attch it to mail.
    for converting it to PDF use this FM <b>CONVERT_PAYSLIP_TO_PDF</b>
    after conversion send it using <b>SO_NEW_DOCUMENT_ATT_SEND_API1</b>
    Regards
    vijay

  • Send report query as email attachment

    Hi,
    I have created a multireport query under Shared Components that allows users to print several sql queries to a pdf file in a prefefined format. Is it possible to generate an email out of Apex with this report query pdf as an attachment (without having the users save the pdf to their hard drive and and manually attach to an email)?
    Thanks,
    Forrest

    Hello RnB,
    You can check the mentioned link for the same:
    [Simple Program to generate PDF from ABAP List Output.|http://www.abapmadeeasy.com/2011/02/sap-abap-simple-program-to-generate-pdf.html]
    Regards,
    Uttam Agrawal

  • Send ALV report as email attachment but in background scheduling mode

    Hi All,
           I have ALV report which runs fine in  the foreground.
    But i need to display it in the spool that is by scheduling in the background.
    can i send an excel attachement as e-mail in the background scheduling?  my report contains
    10 columns and i need them in proper format on excel sheet attachment? plz help me out?if possible
    give me abap code..

    HI,
    Use the below link
    Sending Mail to the schedular of Background Job
    Thanks

Maybe you are looking for