How to send a report via e-mail

Hello All,
           I want to send a report via e-mail.
           What should I do for that?
            Please help me out...
Regards,
Ravi Khattar.

Hi,
  Please check the below code....
data: t_objpack    like sopcklsti1 occurs 1 with header line,
        t_objhead    like solisti1   occurs 1 with header line,
        t_objtxt     like solisti1   occurs 0 with header line,
        t_objbin     like solisti1   occurs 1 with header line,
        t_reclist    like somlreci1  occurs 1 with header line,
        t_lobj       like abaplist   occurs 0 with header line,
        t_listobj    like abaplist   occurs 1 with header line.
  data: v_tab_line1  type i,
        v_tab_line2  type i,
        v_docsize    type i,
        v_len        type i,
        v_line(1250) type c,
        v_subj(132)  type c,
        v_cr(1)      type x value '0D',
        v_linefd(2)  type x value '0D0A',
        v_docdata    like sodocchgi1.
  clear: t_objpack[], t_objhead[], t_objtxt[], t_reclist[], t_listobj[].
  concatenate 'This email is generated from a SAP' sy-sysid '-'
     sy-mandt '- batch environment.' into t_objtxt separated by ' '.
  append t_objtxt.
  t_objtxt = 'Please do not respond to this email.'. append t_objtxt.
  v_docdata-obj_name = 'SAMPLE_TEST'.
  concatenate 'Sales Order Status Attachment -' sy-datum '-' sy-uzeit
         into v_subj separated by ' '.
  v_docdata-obj_descr = v_subj.
  describe table t_objtxt lines v_tab_line1.
  read table t_objtxt index v_tab_line1.
  v_docdata-doc_size   = ( v_tab_line1 - 1 ) * 255 + strlen( t_objtxt ).
  t_objpack-head_start = 1.
  t_objpack-head_num   = 1.
  t_objpack-body_start = 1.
  t_objpack-body_num   = v_tab_line1.
  t_objpack-doc_type   = 'RAW'.
  append t_objpack.
  clear v_line.
  if p_type = '1'.
    loop at t_list.
      concatenate v_line t_list v_linefd into v_line.
      v_len = strlen( v_line ).
      do 4 times.
        if v_len ge 255.
          if v_line+254(1) = v_cr.
            v_line255     = v_line254.
            v_line+254(1)  = ' '.
          endif.
          t_objtxt = v_line(255).
          v_line   = v_line+255.
          v_len    = v_len - 255.
          append t_objtxt.
        else.
          exit.
        endif.
      enddo.
    endloop.
    if v_line ne ' '.
      t_objtxt = v_line(255).
      append t_objtxt.
    endif.
    describe table t_objtxt lines v_tab_line2.
    t_objpack-doc_size   = ( v_tab_line2 - v_tab_line1 ) * 255.
    t_objpack-body_start = v_tab_line1 + 1.
    t_objpack-transf_bin = ' '.
    t_objpack-doc_type   = 'TXT'.
  else.
    t_objbin[] = html[].
    describe table t_objbin lines v_tab_line2.
    t_objpack-doc_size   = v_tab_line2 * 255.
    t_objpack-body_start = 1.
    t_objpack-transf_bin = 'X'.
    t_objpack-doc_type   = 'HTM'.
  endif.
  t_objpack-head_start = 1.
  t_objpack-head_num   = 1.
  t_objpack-body_num   = v_tab_line2.
  t_objpack-obj_name   = 'SAMPLE_TEST'.
  t_objpack-obj_descr  = 'Test'.
  append t_objpack.
  loop at s_email.
    t_reclist-receiver = s_email-low.
    t_reclist-rec_type = 'U'.
    append t_reclist.
  endloop.
  t_reclist-receiver   = sy-uname.
  t_reclist-rec_type   = 'B'.
  append t_reclist.
  call function 'SO_NEW_DOCUMENT_ATT_SEND_API1'
       EXPORTING
            document_data = v_docdata
            put_in_outbox = ' '
       TABLES
            packing_list  = t_objpack
            object_header = t_objhead
            contents_bin  = t_objbin
            contents_txt  = t_objtxt
            receivers     = t_reclist.
  if sy-subrc = 0.
   endif.
Cheers,
Bujji

Similar Messages

  • How to send purchase order via e-mail.

    Please could someone let me know how to send purchase order via e-mail.
    I am an BC.
    e-mailing is functionning however I am not very familiar in settings for MM

    No, you do not need to touch ME_PRINT_PO. You need to put code before and after ME_PRINT_PO in the print program.
    Step 1 - Copy the standard print program SAPFM06P to make a Z version, lets call it ZSAPFM06P
    Step 2 - Copy include FM06PE02 to make a Z version, lets call that ZFM06PE02.
    Step 3 - ZSAPFM06P change the statement "Include FM06PE02" to read "Include ZFM06PE02".
    Step 4 - In include ZFM06PE02 you will find a subroutine called "ENTRY_NEU". In this subroutine you will see it first calls ME_READ_PO_FOR_PRINTING then calls ME_PRINT_PO. Before it calls ME_PRINT_PO just put:
    l_nast-nacha = 1.
    CLEAR l_nast-dimme.
    This means that ME_PRINT_PO will not e-mail, it will create a spool request.
    Step 5 - Still in ZFM06PE02, after ME_PRINT_PO has been called, add new code. First check that ent_retco EQ 0. If it does not then exit.
    Step 6 - Get the spool ID created by ME_PRINT_PO by either moving sy-msgv1 to a variable or select from NAST.
    Step 7 - Call function CONVERT_OTFSPOOLJOB_2_PDF using the spool ID from step 6, and put the result from table PDF into an internal table you can use later. ALso store the export variable pdf_bytecount, you will need it later.
    Step 8 - Call function SX_TABLE_LINE_WIDTH_CHANGE using the table from step 7 as content_in and put the results from content_out into a new internal table.
    Step 9 - Add some text into a internal table of type solisti1, this will be the body text of the e-mail.
    Step 10 - Add whatever receivers you want into an internal table of type somlreci1. If you just want it to go to the address that the PO would have gone to anyway, select the e-mail address from ADR6 where the address number = l_doc-xekko-adrnr, that is the data from the PO.
    Step 11 - Populate an internal table of type sopcklsti1 with data relevant to your PDF table from step 8 and the text table from step 9. You will have to put the size of the PDF from step 7 (pdf_bytecount) on the PDF line and the size of the text will be the number of lines of text * 255.
    Step 12 - Add info to a structure of type sodocchgi1. You can add the e-mail title in here, field obj_descr. Also add the size of the PDF and the size of the text from step 12 into doc_size, and give the doc a name in field obj_name. This can be anything, ZPDFPO for example.
    Step 13 - Call SO_DOCUMENT_SEND_API1 using the tables from steps 8, 9, 10 and 11 and the structure from step 12. You can amend the sending e-mail also. Set commit_work to space.
    Step 14 - That is all you need, but I actually call function RSPO_R_RDELETE_SPOOLREQ to delete the spool request created in step 4, then call NAST_PROTOCOL_UPDATE to add some more messages to the processing log of the PO.
    That is all.

  • How to send a file via e-mail with director

    Is it even possible to have a button in a free-standing
    projector that would send a file via e-mail, or open up an e-mail
    program and have the file attached and addressed? Or is it possible
    to put a file on a server? Of course, both of these methods would
    alert the user and ask for their permission.

    To just open the user's email program, you can use the
    standard lingo:
    goToNetPage(mailto:[email protected])
    That approach is kind of annoying because it actually opens
    an empty
    browser window then the user's email program. I don't think
    you can use
    that approach to send attachments though.
    A much better way is the fabulous DirectEmail xtra from
    DirectXtras.
    Check out their site:
    http://www.directxtras.com/demail_home.asp?UUID=1217348
    DirectEmail can do everything you are asking for (and more).
    It is
    cross-platform, shockwave safe, can handle text or HTML
    email, can do
    attachments, can use a mail server or not, and is really easy
    to use.
    The same company makes DirectFTP which you can get from:
    http://www.directxtras.com/DFTP_home.asp?UUID=1217348
    DirectFTP can put files onto an FTP site with a minimum of
    fuss. I have
    used both on quite a few occasions and they rock. You can
    actually
    write a full-fledged email or ftp program with those xtras
    and Director.

  • How to send ALV report Output through mail in background !

    Hi ,
    I had an ALV Report. I want to send this report output to patricular email id every day ! Presenty i do this manually. I run the report and send the output to the particular email address. Now i want to schecule the report daily in background and the out put of the report should be mailed to particular email ids in background itself. How can i do this ?
    Is there and method or setting through which we can do this ?
    Regards

    Hi Nau,
    For this requirement you will have to write another program.
    This program will convert the spool requests into PDF document and sends an email  to the recipients that you specify.
    These are the threads which are already posted in The SDN.
    *http://wiki.sdn.sap.com/wiki/display/Snippets/Converts+spool+request+into+PDF+document+and+emails*
    *<a class="jive_macro jive_macro_thread" href="" __jive_macro_name="thread" modifiedtitle="true" __default_attr="353650"></a>*
    *<a class="jive_macro jive_macro_thread" href="" __jive_macro_name="thread" modifiedtitle="true" __default_attr="902985"></a>*
    You need to use the Function module :
    -- Sending the document
      CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
    I will provide you with the code to get this functionality.
    *&      Form  SEND_EMAIL
    form SEND_EMAIL .
    DATA:   t_mailpack   TYPE sopcklsti1 OCCURS 0 WITH HEADER LINE,
              t_mailhead   TYPE solisti1   OCCURS 0 WITH HEADER LINE,
              t_mailbin    TYPE solisti1   OCCURS 0 WITH HEADER LINE,
              t_mailtxt    TYPE solisti1   OCCURS 0 WITH HEADER LINE,
              t_mailrec    TYPE somlreci1  OCCURS 0 WITH HEADER LINE.
      DATA: wa_maildata    TYPE sodocchgi1,
            l_filename(50) TYPE c,
            l_fldname(30)  TYPE c,
            l_fldval(100)  TYPE c,
            l_lines        TYPE i,
            l_text         TYPE text128 .
      DATA: w_email_subrc  TYPE i.
      DATA: w_ship like vbfa-vbeln.
      CLEAR: wa_maildata,
             t_mailtxt,
             t_mailbin,
             t_mailpack,
             t_mailhead,
             t_mailrec.
      REFRESH: t_mailtxt,
               t_mailbin,
               t_mailpack,
               t_mailhead,
               t_mailrec.
    *-- Fill output file
    *- Fill header
      CLEAR: t_mailbin.
    *  t_mailbin[] = pdf_tab[].
      t_mailbin[] = it_att[].     "Uthaman
    *This line is added to get the shipment no in Subject Line
    SELECT SINGLE * FROM vbfa WHERE vbelv EQ nast-objky
                                AND vbtyp_v EQ c_vbtyp_v_j
                                AND vbtyp_n EQ c_vbtyp_n_8.
    w_ship = vbfa-vbeln.
    shift w_ship left deleting leading '0'.
    *-- File name
    if nast-kschl EQ 'ZFPL'.
      CLEAR l_filename.
      CONCATENATE 'Packing List -'
                  sy-datum+4(2) sy-datum+6(2) sy-datum(4) '.PDF' INTO l_filename.
    *-- Creation of the document to be sent File Name
      wa_maildata-obj_name = 'Packing List'.
    *-- Mail Subject
      CONCATENATE l_filename '-' 'Shipment No -' w_ship INTO wa_maildata-obj_descr SEPARATED BY space.
    *-- Mail Contents
      t_mailtxt-line = 'Packing List'.
      APPEND t_mailtxt.
    ENDIF.
    if nast-kschl EQ 'ZFBA'.
      CLEAR l_filename.
      CONCATENATE 'Booking Advice -'
                  sy-datum+4(2) sy-datum+6(2) sy-datum(4) '.PDF'
                  INTO l_filename.
    *-- Creation of the document to be sent File Name
      wa_maildata-obj_name = 'Booking Advice'.
    *-- Mail Subject
      CONCATENATE l_filename '-' 'Shipment No -' w_ship INTO wa_maildata-obj_descr SEPARATED BY space.
    *-- Mail Contents
      t_mailtxt-line = 'Packing List'.
      APPEND t_mailtxt.
    ENDIF.
    *-- Prepare Packing List
    *-- Write Packing List (Main Subject)
      CLEAR: l_lines, t_mailpack.
      DESCRIBE TABLE t_mailtxt LINES l_lines.
    *  READ TABLE t_mailtxt INDEX l_lines.
      t_mailpack-doc_size = ( l_lines - 1 ) * 255 + STRLEN( t_mailtxt ).
    *  CLEAR t_mailpack-transf_bin.
      t_mailpack-transf_bin = ' '.
      t_mailpack-head_start = 1.
      t_mailpack-head_num = 0.
      t_mailpack-body_start = 1.
      t_mailpack-body_num = l_lines.
      t_mailpack-doc_type = 'RAW'.
      APPEND t_mailpack.
      t_mailhead = l_filename.
      APPEND t_mailhead.
    *-- Write Packing List (Attachment)
      CLEAR: l_lines, t_mailpack.
      DESCRIBE TABLE pdf_tab[] LINES l_lines.
    *  READ TABLE pdf_tab INDEX l_lines.
      t_mailpack-doc_size = ( l_lines - 1 ) * 255 + STRLEN( t_mailbin ).
      t_mailpack-transf_bin = 'X'.
      t_mailpack-head_start = 1.
      t_mailpack-head_num = 1.
      t_mailpack-body_start = 1.
      t_mailpack-body_num = l_lines.
      t_mailpack-doc_type = 'PDF'.
      t_mailpack-obj_name = l_filename.
      t_mailpack-obj_descr = l_filename.
      t_mailpack-obj_langu = 'E'.
      APPEND t_mailpack.
    *-- Set recipients
    tables :  ztotcemail.
    SELECT SINGLE * FROM vbfa WHERE vbelv EQ nast-objky
                                AND vbtyp_v EQ c_vbtyp_v_j
                                AND vbtyp_n EQ c_vbtyp_n_8.
    CLEAR vttk.
    SELECT SINGLE * FROM vttk WHERE tknum EQ vbfa-vbeln.
    SELECT SINGLE * FROM ztotcemail WHERE tplst = vttk-tplst
                                      AND lifnr = vttk-tdlnr.
    IF SY-SUBRC EQ 0.
      t_mailrec-receiver = ztotcemail-smtp_addr. "'Here you will give the email address'.
      t_mailrec-rec_type  = 'U'.
      APPEND t_mailrec.
    ENDIF.
    **-- Sending the document
      CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
        EXPORTING
          document_data              = wa_maildata
          put_in_outbox              = 'X'
    *      commit_work                = 'X'  " N-16
        TABLES
          packing_list               = t_mailpack
          object_header              = t_mailhead
          contents_bin               = t_mailbin[]
          contents_txt               = t_mailtxt[]
          receivers                  = t_mailrec
        EXCEPTIONS
          too_many_receivers         = 1
          document_not_sent          = 2
          operation_no_authorization = 4
          OTHERS                     = 99.
      w_email_subrc = sy-subrc.
      IF sy-subrc EQ 0.
        MESSAGE s000(zotc) WITH 'Email output sent successfully'.
      ELSE.
        MESSAGE s000(zotc) WITH 'Can not send email output'.
      ENDIF.
    endform.                    " SEND_EMAIL
    Hope the above information will be helpful.
    Regards,
    Kittu

  • How to send BIP report link by mail not the attachment.

    Hi,
    I have a requiment to send the BI Publisher report link by mail.But not to send the report as an attachment.
    can any one have solution for this requirement.

    hi,
    Alternatively, u can do this Send a report with all the report names on one side and another side link to that particular report.If any one click on that link means it will open the report(pdf/html/excel) format by referring to the url.we will get this by using RTF Template.
    Thanks,
    Saichand

  • How configure sending CDR reporting via ftp server

    hi
    i want to send the CDR reporting automaticly to FTP billing server each 1H.
    i have add the billing server
    i don  t know how or when can i configure the automatique sending CDR report to this server
    Thanks for your help

    You'll need a SFTP server instead of FTP.
    For instructions, please see here:
    http://www.cisco.com/en/US/docs/voice_ip_comm/cucm/service/7_1_2/admin/sacdrm.html
    Thanks!
    Michael
    http://htluo.blogspot.com

  • Send Daily Reports via E-mail from MARS

    Hi!
    I want to know if the MARS can send via email daily reports to a specific account.
    Thanks for any help.

    well, you could start by logging into the MARS CLI as pnadmin. Use tcpdump to monitor the SMTP traffic.
    [pnadmin]$ tcpdump -X port 25
    Now select the report and click "resubmit". You should see the SMTP traffic to the mail server. You can probably troubleshoot by looking at the ASCII output from tcpdump. If not, look at the tcpdump output and at least make sure the connection is to the right IP address and that some data is exchanged after the initial TCP handshake. Now take a look at the mail server logs, which should give you an idea of what to do next.

  • How to send error message via a mail to the customers email id

    HI experts ,
    i have a requirement,In idoc where i have to send the error message via email to a perticular emailid?
    please help me n tell also which fm is used for that?
    Thanks
    RAhul Sisodia

    Hi ,
    Check this Link..
    [sending an email with multiple attachments;
    Regards,
    Sachin M M

  • How to send my report through e-mail

    Hello to All
    i am generating a report in report 2.5 what i want in place of sending report to printer or screen i want to send reports output through email either in html or pdf format.
    please send me the solution for the same.
    thanks.
    null

    Hello to All
    i am generating a report in report 2.5 what i want in place of sending report to printer or screen i want to send reports output through email either in html or pdf format.
    please send me the solution for the same.
    thanks.
    null

  • Error to send a report via mail with BI Publisher

    Hello,
    I am working with BIP 10.1.3.4 over Windows Server 2003 Standard Edition, and I would like to send a report via mail.
    I added one Email server navigation via Admin>Delivery Configuration > Email with the server name and host.
    Then Send report via Email, got error.
    oracle.apps.xdo.service.delivery.DeliveryException: oracle.apps.xdo.delivery.DeliveryException: smtp
         at oracle.apps.xdo.service.delivery.impl.DeliveryServiceImpl.deliverToEmail(DeliveryServiceImpl.java:228)
         at oracle.apps.xdo.servlet.scheduler.XDOJob.deliver(XDOJob.java:1190)
         at oracle.apps.xdo.servlet.scheduler.XDOJob.execute(XDOJob.java:478)
         at org.quartz.core.JobRunShell.run(JobRunShell.java:195)
         at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:520)
    Caused by: oracle.apps.xdo.delivery.DeliveryException: smtp
         at oracle.apps.xdo.delivery.smtp.SMTPDeliveryRequestHandler.submitRequest(Unknown Source)
         at oracle.apps.xdo.delivery.AbstractDeliveryRequest.submit(Unknown Source)
         at oracle.apps.xdo.service.delivery.impl.DeliveryServiceImpl.deliverToEmail(DeliveryServiceImpl.java:222)
         ... 4 more
    Caused by: javax.mail.NoSuchProviderException: smtp
         at javax.mail.Session.getService(Session.java:764)
         at javax.mail.Session.getTransport(Session.java:689)
         at javax.mail.Session.getTransport(Session.java:632)
         at javax.mail.Session.getTransport(Session.java:612)
         ... 7 more
    I have followed this SR, and I applied the solution, but it isn't solved the issue (ID: 1072742.1)
    https://support.oracle.com/CSP/ui/flash.html#tab=KBHome%28page=KBHome&id=%28%29%29,%28page=KBNavigator&id=%28from=BOOKMARK&viewingMode=1143&bmDocTitle=BI%20Publisher%20With%20JDE%20Fails%20To%20Send%20Email,%20Error:%20javax.mail.NoSuchProviderException:&bmDocID=1072742.1&bmDocType=PROBLEM&bmDocDsrc=KB%29%29
    Regards,
    Mónica.

    Hi Christian.
    You could put the lines of your list in a table of type SOLISTI1 and then use the function module SO_NEW_DOCUMENT_SEND_API1 to send the content of this table. You have to fill the table RECEIVERS with the address you want to send the report to.
    Hope that helps,
    Timo.

  • Trying to send a photo via e-mail from iPhoto.  But it says my e-mail and password are wrong and won't send and I don't know how to correct it.  Where do I go?

    Trying to send a photo via e-mail from iPhoto.  But it says my e-mail and password are wrong and won't send and I don't know how to correct it.  Where do I go?

    In the iPhoto preferences ==> accounts delete the account and re-enter it
    LN

  • If i send a report via icloud how am i notified

    if i send a report via iclod how do i get my response please

    Yes. On your phone make sure it is set to send messages from your phone number, not your apple id or other email address. That way when they reply it will go to your phone.

  • How to send the form data through mail with pdf format?

    forms 6i
    Hi to all,
    i am developed one master detail form.example is based on the dept number emp details will be displayed.here my requirment is whatever displayed on the form
    the data ,these data send to mail with any format.is it possible? if is possible any one give a proper solution.
    Regards,
    Stevie
    Edited by: 994418 on 6 May, 2013 11:15 PM

    Hello,
    you can create a Report that accepts the search parameters from the Forms mask and generates a PDF. You also have the option to send the report via mail.
    Personally I would generate the report with a tool like as_pdf
    http://technology.amis.nl/2012/04/11/generating-a-pdf-document-with-some-plsql-as_pdf_mini-as_pdf3/
    Then you can send the mail using utl_mail or utl_smtp.
    www.google.com/search?q=site:forums.oracle.com+utl_mail+utl_smtp
    Regards
    Marcus

  • How to send a smartform result through mail?

    How to send a smartform result through mail?

    HI,
    YOu can convert the output of Smartform into a attachment say PDF file & then send it across through mail.
    Refer following program:
    <a href="http://www.sapdevelopment.co.uk/reporting/rep_spooltopdf.htm">http://www.sapdevelopment.co.uk/reporting/rep_spooltopdf.htm</a>
    Best regards,
    Prashant

  • HOW TO SEND THE REPORTS AND  THROUGH XI TO NON -SAP SYSTEM

    Hi Experts,
                 I want to know how to send the reports and  smartform through xi to another system. All the post blogs are   just explaning only about the FILE-TO-FILE, FILE-TO-IDOCS scenarios only.

    Hi,
    XI is the middleware that to be used to transfer the data between various systems and even you could design the Business Processes with it.
    In R/3 the smartforms, are generally converted to PDF and then  have to send it across to Non SAP systems. Similarly you can convert the smartforms to pdf format and keep it on application server. XI will pick up that pdf and will send it to Non SAP system either as mail or as an attachments.
    ABAP reports are normally used to re-present the data. If you need to transfer this data across the Non SAP systems then you have the IDOCs to be generated, RFC or ABAP Proxy to integrate this data with Non SAP system.
    XI is not restricted only upto file to file or file to IDOC scenarios. It have enormous capabilities to involve various Business Processes as well integrate various SAP or Non SAP systems.
    If need anymore  specific details, please let us know.
    Thanks
    Swarup

Maybe you are looking for