Report output to be sent via mail

Hi Experts,
I want to send my customized ABAP report output to an email address (e.g my own email ID) as I need to send to the vendor (who doesn't have SAP access) as per the requirement.
Can you please let me know is there any transaction or any other way with the help of which i can just input this report name and the email Id and then it will automatically send the output of the report to that email id.
Thanks in advance.
Any helpful entry will be rewarded.
Warm regards,
Raman.

You might want to write a small program that retrieves your spool information, and send the corresponding ALV (internal table) by converting it and sending it via SAP Connect. Here is a sample of hos to attach and send your internal table:
FORM send_file .
  DATA: send_request       TYPE REF TO cl_bcs,
        text               TYPE bcsy_text,
        document           TYPE REF TO cl_document_bcs,
        recipient          TYPE REF TO if_recipient_bcs,
        copy               TYPE ad_smtpadr,
        bcs_exception      TYPE REF TO cx_bcs,
        sent_to_all        TYPE os_boolean,
        att_name           TYPE sood-objdes,
        subject            TYPE so_obj_des.
Get attachment name
  CONCATENATE g_ret_id '_' sy-datum sy-uzeit '_' g_fileid '.CSV' INTO
  att_name.
  TRY.
Create the send request
      send_request = cl_bcs=>create_persistent( ).
Create the document with attachments
Main document
        APPEND 'Attachment test' TO text.
      document = cl_document_bcs=>create_document(
                    i_type    = 'RAW'
                    i_text    = text
                    i_subject = subject ).
Add text attachment to document
      document->add_attachment( i_attachment_type    = 'CSV'
                                i_attachment_subject = att_name
                                i_att_content_text   = itab_file ).
      send_request->set_document( document ).
Create recipient and add to send request
      LOOP AT itab_recipients INTO wa_recipients.
        IF wa_recipients-copy IS INITIAL.
          "To recipient
          MOVE wa_recipients-address TO g_rec_send.
          recipient = cl_cam_address_bcs=>create_internet_address(
          g_rec_send ).
          send_request->add_recipient( i_recipient = recipient ).
          CLEAR g_rec_send.
        ELSE.
          "CC
          MOVE wa_recipients-address TO g_rec_send.
          recipient = cl_cam_address_bcs=>create_internet_address(
          g_rec_send ).
          send_request->add_recipient( i_recipient = recipient
                                       i_copy = 'X' ).
          CLEAR g_rec_send.
        ENDIF.
      ENDLOOP.
Send
      sent_to_all = send_request->send( i_with_error_screen = 'X' ).
      IF sent_to_all = 'X'.
        MESSAGE s022.
      ENDIF.
    CATCH cx_bcs INTO bcs_exception.
      MESSAGE e865 WITH bcs_exception->error_type.
  ENDTRY.
ENDFORM.                    " send_file
REPORT TO EMAIL
ALV output to email
How to send ALV Grid report to Email?
Check the code...on http://sap4.com/wiki/index.php?title=ZOUTLOOK
sending the output of a program through an email
report output to email
Sending ABAP Report by email
Rewards if useful..............
Minal

Similar Messages

  • MfE uninstall - Sent via Mail for Exchange still e...

    Hi,
    On my new N97 I accidentally installed MfE trough the Wizard. Later I removed MfE succesfully, but now in the Contact list, under E-Mail there still is an entry "Sent via Mail for Exchange".
    How can I remove that entry?
    Best regards,
    Wouter

    Check in Messaging and see if Mail for Exchange is still listed as a folder.
    If so, go to Options, Settings, E-Mail and you migth be able to remove it from there.

  • Submit Report as an attachement Excel via mail using planified job SM37

    Hi,
    I'm executing a program in background via job to get back the result of a report as an attachment XLS on mail.
    the result of my program give me just title of Excel columns , but when i execute it manually , the result is perfect.
    my code is :
    ******************************FORM MAIL*******************************
    FORM mail.
    CONCATENATE 'Expédition' 'TExp' 'PtOT' 'Crée' 'Crée le' 'St.' 'Déb.
    chargt'
    'Désignation' 'Div.' 'Doc. vente' 'Réceptionnaire' 'Nom1' 'Nom2'
    'Volume' 'UQ' INTO it_mess_att
    SEPARATED BY con_tab.
    CONCATENATE con_cret it_mess_att INTO it_mess_att.
    APPEND it_mess_att.
    CONCATENATE SPACE SPACE INTO it_mess_att
    SEPARATED BY con_tab.
    CONCATENATE con_cret it_mess_att INTO it_mess_att.
    APPEND it_mess_att.
    *CLEAR it_mess_att.
    LOOP AT it_tab into wa_tab.
    *VAL = it_tab-ZQTEMAX.
    CONCATENATE wa_tab-SHNUMBER wa_tab-SHTYPE
    wa_tab-TPLST wa_tab-CRE_NAME
    wa_tab-CRE_DATE wa_tab-OIG_SSTSF
    wa_tab-LOAD_STDTA wa_tab-VMODE_TEXT
    wa_tab-WERKS wa_tab-VBELN
    wa_tab-KUNNR wa_tab-NAME1
    wa_tab-CARRIER_DE
    wa_tab-WGT_UOM INTO it_mess_att
    SEPARATED BY con_tab.
    CONCATENATE con_cret it_mess_att INTO it_mess_att.
    APPEND it_mess_att.
    *CLEAR it_mess_att.
    ENDLOOP.
    ENDFORM.
    *************************FORM SEND_MAIL*******************************
    FORM send_mail .
    DATA: send_request TYPE REF TO cl_bcs,
    document TYPE REF TO cl_document_bcs,
    recipient TYPE REF TO cl_cam_address_bcs,
    bcs_exception TYPE REF TO cx_bcs,
    sent_to_all TYPE os_boolean,
    lt_fields TYPE TABLE OF w3fields,
    lt_html TYPE TABLE OF w3html.
    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 sopcklsti1-obj_descr,
    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.
    *MOVE p_email TO mailid.
    ***************ADD ADRESS MAIL**************
    p_email1-RECEIVER = mail .
    append p_email1.
    ld_email = mail.
    ld_mtitle = gd_attachment_desc.
    ld_format = 'XLS'.
    ld_attdescription = gd_attachment_desc.
    ld_attdescription = 'Liste expéditions PN'.
    CONCATENATE ld_attdescription '.XLS' INTO ld_attfilename.
    ld_attfilename = p_filename.
      ld_sender_address = w_sender.
      ld_sender_address_type = 'INT'.
    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_mess_att INDEX 1.
      w_doc_data-doc_size = ( w_cnt - 1 ) * 255 + STRLEN( it_mess_att ).
      w_doc_data-obj_langu = sy-langu.
      w_doc_data-obj_name = 'SAPRPT'.
      w_doc_data-obj_descr = gd_attachment_desc.
      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_mess_bod 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 it_mess_att 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.
      loop at p_email1.
      t_receivers-receiver = p_email1-receiver.
      t_receivers-rec_type = 'U'.
      t_receivers-com_type = 'INT'.
      t_receivers-notif_del = 'X'.
      t_receivers-notif_ndel = 'X'.
      APPEND t_receivers.
      endloop.
      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 = it_mess_att
            contents_txt = it_mess_bod
            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.
      WAIT UP TO 5 SECONDS.
      SUBMIT rsconn01 WITH mode = 'INT' WITH output = 'X' AND RETURN.
    ENDFORM. " send_mail

    Hi,
    I'm executing a program in background via job to get back the result of a report as an attachment XLS on mail.
    the result of my program give me just title of Excel columns , but when i execute it manually , the result is perfect.
    my code is :
    ******************************FORM MAIL*******************************
    FORM mail.
    CONCATENATE 'Expédition' 'TExp' 'PtOT' 'Crée' 'Crée le' 'St.' 'Déb.
    chargt'
    'Désignation' 'Div.' 'Doc. vente' 'Réceptionnaire' 'Nom1' 'Nom2'
    'Volume' 'UQ' INTO it_mess_att
    SEPARATED BY con_tab.
    CONCATENATE con_cret it_mess_att INTO it_mess_att.
    APPEND it_mess_att.
    CONCATENATE SPACE SPACE INTO it_mess_att
    SEPARATED BY con_tab.
    CONCATENATE con_cret it_mess_att INTO it_mess_att.
    APPEND it_mess_att.
    *CLEAR it_mess_att.
    LOOP AT it_tab into wa_tab.
    *VAL = it_tab-ZQTEMAX.
    CONCATENATE wa_tab-SHNUMBER wa_tab-SHTYPE
    wa_tab-TPLST wa_tab-CRE_NAME
    wa_tab-CRE_DATE wa_tab-OIG_SSTSF
    wa_tab-LOAD_STDTA wa_tab-VMODE_TEXT
    wa_tab-WERKS wa_tab-VBELN
    wa_tab-KUNNR wa_tab-NAME1
    wa_tab-CARRIER_DE
    wa_tab-WGT_UOM INTO it_mess_att
    SEPARATED BY con_tab.
    CONCATENATE con_cret it_mess_att INTO it_mess_att.
    APPEND it_mess_att.
    *CLEAR it_mess_att.
    ENDLOOP.
    ENDFORM.
    *************************FORM SEND_MAIL*******************************
    FORM send_mail .
    DATA: send_request TYPE REF TO cl_bcs,
    document TYPE REF TO cl_document_bcs,
    recipient TYPE REF TO cl_cam_address_bcs,
    bcs_exception TYPE REF TO cx_bcs,
    sent_to_all TYPE os_boolean,
    lt_fields TYPE TABLE OF w3fields,
    lt_html TYPE TABLE OF w3html.
    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 sopcklsti1-obj_descr,
    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.
    *MOVE p_email TO mailid.
    ***************ADD ADRESS MAIL**************
    p_email1-RECEIVER = mail .
    append p_email1.
    ld_email = mail.
    ld_mtitle = gd_attachment_desc.
    ld_format = 'XLS'.
    ld_attdescription = gd_attachment_desc.
    ld_attdescription = 'Liste expéditions PN'.
    CONCATENATE ld_attdescription '.XLS' INTO ld_attfilename.
    ld_attfilename = p_filename.
      ld_sender_address = w_sender.
      ld_sender_address_type = 'INT'.
    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_mess_att INDEX 1.
      w_doc_data-doc_size = ( w_cnt - 1 ) * 255 + STRLEN( it_mess_att ).
      w_doc_data-obj_langu = sy-langu.
      w_doc_data-obj_name = 'SAPRPT'.
      w_doc_data-obj_descr = gd_attachment_desc.
      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_mess_bod 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 it_mess_att 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.
      loop at p_email1.
      t_receivers-receiver = p_email1-receiver.
      t_receivers-rec_type = 'U'.
      t_receivers-com_type = 'INT'.
      t_receivers-notif_del = 'X'.
      t_receivers-notif_ndel = 'X'.
      APPEND t_receivers.
      endloop.
      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 = it_mess_att
            contents_txt = it_mess_bod
            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.
      WAIT UP TO 5 SECONDS.
      SUBMIT rsconn01 WITH mode = 'INT' WITH output = 'X' AND RETURN.
    ENDFORM. " send_mail

  • Output to be Sent via Email

    Hi,
    We have an Output Type for Delivery, where the Packing List Output is sent automatically to one Mail ID that is maintained in Customer Master of Ship to Party. But we would like to send the Output via Mail for more than one Mail ID, which we maintain in Customer Master of Ship to Party. How to Maintain???
    Regards,

    Hi
    Maintain the Condition Record for that Output Type with Field Catalogs u2013 u201CDelvy Typeu201D / u201CPartner Functionu201D / u201CMediumu201D / u201CDate & timeu201D u2013 u201Crequired delivery typeu201D / u201CSHu201D / u201DExt Sendu201D / u201CSend immediately (when saving the application)u201D.
    Also maintain the Communication Strategy (whether via Internet or Fax) for this record. Now, when the delivery document is saved, the output will be sent to the email Id maintained in Ship to Party Customer Master.
    For sending mail to 2 ID's simultaneously:
    Option 1 - Appropriate enhancement to be made in the Program assigned to that Output Type, so that the 2 mail ID's maintained in the Ship to Party customer master is picked for sending output via email.
    Option 2 - Convince the client saying that it will be sent to one mail ID as mentioned above and that person can forward to whomsoever it has to go.
    Regards,
    Ravi.

  • Report to send a List via mail

    Hi everybody,
    at the moment we hava a report which we have to start every day to generate a customer List. Via SAP Office we can send this list via email to a specific person. Now I like to automate this report and start it as a job which automativly send this list via mail.
    Do you have an idea how this will work?
    Thanks a lot for your help.
    Kind regards
    Christian

    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.

  • Presentation created in iPad can't be opened, exported, sent via mail

    Hello.
    i worked on a ipad keynote presentation all day. i was working on it when the ipad suddenly crashed, and resetted. Now, when i try to open the presentation i get the message "Presentation can't be opened". When i try to export it i get the message "presentation couldn't be exported" An error ocurred. I can't send it via mail, it gets stuck on Creating Document. Please help me, i'm in real trouble. Is there anyway to take that presentation out. Or look at the data?? there were really important numbers in that presentation.
    i have ipad 3.2

    walazzo wrote:
    Hello.
    i worked on a ipad keynote presentation all day. i was working on it when the ipad suddenly crashed, and resetted. Now, when i try to open the presentation i get the message "Presentation can't be opened". When i try to export it i get the message "presentation couldn't be exported" An error ocurred. I can't send it via mail, it gets stuck on Creating Document. Please help me, i'm in real trouble. Is there anyway to take that presentation out. Or look at the data?? there were really important numbers in that presentation.
    i have ipad 3.2
    The data is gone, unless someone knows how to pull data out of your iPad. The fact is, the iPad isn't made to do what you're trying to do. Create mission critical documents on your real computer that backs up data frequently. Sorry.

  • Report output different when sent directly to printer

    I have a report that if formated for 8.5 x 11 paper and has an address at the bottom of the page. When the report is generated as a pdf the address is in the corrent postion. When the report is sent directly to a printer from the report server the bottom 2 inches of the report are not printed. If i send the pdf version to the same printer it prints correctly.
    Any help with this issue would be greatly appreciated.

    Thanks for your answer, Ramachandra!
    However I need some more specific information to solve this.
    Which printer layout settings are relevant for the handling of margins and duplex printing for Adobe Forms?
    I have not set up the printer myself but when talking to the printer guy which settings should I recommend him to look at?
    I can see in transaction SPAD that there are settings specific to SmartForms but there is nothing said about Adobe Forms. Is there some way to make Adobe Forms related setting appear in SPAD for a device type?
    Maybe my problem is not related to the printer device settings but rather to the way the printer is being called. When printing duplex we will have to override the default settings of the printer anyway.
    Function module FP_JOB_OPEN has a parameter structure of the type SFPOUTPUTPARAMS. Which fields in this parameter structure are to be manipulated to get duplex print and output fitted to page size?

  • Error while opening PDF attachment sent via mail

    Hi,
    I am attaching PDF file to PO in me22n and sending the same file as attachment in the mail to the vendor using class CL_BCS.
    The mail is sent to the vendor successfully and they are able to successfully open the PDF attachment. But in some cases the mail is successfully received but while opening the attachment it is giving the error as file is corrupted.
    Please help me to resolve this issue.
    Thanks and regards,
    Jayashree

    Hi,
    I would like to know what font type, you are using in the forms.
    Ideally it should be HELVETICA .
    If you are using any other font in your style/form,try changing it to HELVETICA & Test.
    Also Check the OTF data at the call of gen. FM,before converting it to PDF.
    Regds,
    AS
    Edited by: abheesawant on Oct 12, 2011 7:48 AM

  • Submit Report as an attachement Excel via mail

    Hi,
    I want to send an email with the result of report O4B1 as attachment Excel with columns separated in Excel.
    Best regards.

    REPORT  YJAJUR_EMAILOPTIONS                     .
    tables: kna1.
    data: begin of it_kna1 occurs 0," with header line,
          kunnr like kna1-kunnr,
          land1 like kna1-land1,
          name1 like kna1-name1,
          end of it_kna1.
    data: w_sender like somlreci1-receiver.
    CONSTANTS:
    con_tab TYPE c VALUE cl_abap_char_utilities=>horizontal_tab,
    con_cret TYPE c VALUE cl_abap_char_utilities=>cr_lf.
    data: it_mess_att like solisti1 occurs 0 with header line,
            gd_attachment_desc type sopcklsti1-obj_descr.
    data: gd_subject   like sodocchgi1-obj_descr,
          it_mess_bod like solisti1 occurs 0 with header line,
          gd_sender_type     like soextreci1-adr_typ,
           gd_attachment_name type so_obj_des.
    select-options: p_email for w_sender no intervals.
    PARAMETER mailid TYPE adr6-smtp_addr NO-DISPLAY.
    data : it_kna2 type kna1 occurs 0 with header line.
      select kunnr
             land1
             name1
             from kna1 into table it_kna1 .
       select * from kna1 into table it_kna2.
       concatenate 'EMSIL OPTIONS DONE BY sANTOSH.s.jAJU' 'MODEL WISE upto' Into gd_attachment_desc separated by space.
    concatenate  'Custmer' 'custmer name' 'custmer land1'      con_tab into
    it_mess_att separaTED BY con_tab.
    CONCATENATE con_cret it_mess_att INTO it_mess_att.
       APPEND it_mess_att.
       CLEAR it_mess_att.
    *loop at p_email.
    *endloop.
    data: i1 type string.
    perform email.
    loop at p_email.
    i1 = i1 + 1.
    concatenate 'email' ':' i1 space p_email-low into it_mess_bod.
    it_mess_bod = p_email-low..
    APPEND it_mess_bod.
    clear it_mess_bod.
    perform send_mail.
    endloop.
    perform display_data..
    *&      Form  email
          text
    -->  p1        text
    <--  p2        text
    FORM email .
    loop at it_kna2.
          concatenate con_cret  it_kna2-kunnr con_tab
                    it_kna2-name1 con_tab it_kna2-land1 into it_mess_att.
            APPEND it_mess_att.
       CLEAR it_mess_att.
    endloop.
    ENDFORM.                    " email
    *&      Form  send_mail
          text
    -->  p1        text
    <--  p2        text
    FORM send_mail .
    DATA: send_request  TYPE REF TO cl_bcs,
          document      TYPE REF TO cl_document_bcs,
          recipient     TYPE REF TO cl_cam_address_bcs,
          bcs_exception TYPE REF TO cx_bcs,
          sent_to_all   TYPE os_boolean,
          lt_tab        TYPE TABLE OF makt,
          lt_fields     TYPE TABLE OF w3fields,
          lt_html       TYPE TABLE OF w3html.
    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  sopcklsti1-obj_descr,
            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.
    MOVE P_EMAIL TO MAILID.
    SELECT * FROM makt UP TO 10 ROWS INTO TABLE lt_tab WHERE spras = 'E'.
    CALL FUNCTION 'WWW_ITAB_TO_HTML'
      TABLES
        html   = lt_html[]
        fields = lt_fields
        itable = lt_tab.
    TRY.
        send_request = cl_bcs=>create_persistent( ).
        document = cl_document_bcs=>create_document(  i_type    = 'HTM'
                                                      i_text    = lt_html
                                                      i_subject = 'Table' ).
        send_request->set_document( document ).
        recipient = cl_cam_address_bcs=>create_internet_address( MAILID ).
        send_request->add_recipient( EXPORTING i_recipient = recipient
                                               i_express   = 'X' ).
        send_request->set_send_immediately( 'X' ).
        send_request->send( EXPORTING i_with_error_screen = 'X'
                            RECEIVING result              = sent_to_all ).
        COMMIT WORK.
      CATCH cx_bcs INTO bcs_exception.
        EXIT.
    ENDTRY.
      ld_email   = p_email-low.
      ld_mtitle = gd_attachment_desc.
      ld_format              = 'XLS'.
      ld_attdescription      = gd_attachment_desc.
      concatenate gd_attachment_desc '.XLS' into ld_attfilename.
    ld_attfilename         = p_filename.
      ld_sender_address      = w_sender.
    ld_sender_address_type = 'INT'.
    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_mess_att index 1.
      w_doc_data-doc_size =  ( w_cnt - 1 ) * 255 + strlen( it_mess_att ).
      w_doc_data-obj_langu  = sy-langu.
      w_doc_data-obj_name   = 'SAPRPT'.
      w_doc_data-obj_descr  = gd_attachment_desc.
      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_mess_bod 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 it_mess_att 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               = it_mess_att
          contents_txt               = it_mess_bod
          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.
      wait up to 5 seconds.
      submit rsconn01 with mode   = 'INT'
                      with output = 'X'
                      and return.
    ENDFORM.                    " send_mail
    *&      Form  display_data
          text
    -->  p1        text
    <--  p2        text
    FORM display_data .
    loop at it_kna2.
         write:/ it_kna2-kunnr,it_kna2-land1,it_kna2-name1.
    endloop.
    ENDFORM.                    " display_data
    ref this code i guess this will works

  • Some Gmail messages do not go through some accounts when sent via mail

    Hello
    i have set up my Gmail account in mail but I seem to loose e-mails when i sent using the gmail account in mail some providers do not get my message when i sent the same message from the gmail website the mail goes through anything set up wrong in mail

    Is Settings > Messages > Receive At >
    1) Apple ID correct?
    2) Phone number correct
    3) Email correct?
    4) Caller ID correct?

  • Links sent via mail will not open on some PC'sr

    Whether they are embedded in text or if I drag and drop from a webpage or Flickr my PC respondents cannot open links I send to them. The links also look funny, like a rectangle rather than the usual line of http stuff.
    Typical response from a PC user is 'I am using MOS 10.4.10/.
    Cannot open docs with extension "dot mim".
    Never had this trouble with earlier OS 10 ??? Do I need to use a different mail program or web browser.???

    White Dog. I do same , either copy link and paste or drag and drop.
    My latest link I sent was pasted from a blog and looked like this which my recipient could not open
    http://www.scitizen.com/screens/blogPage/viewBlog/sw_viewBlog.php?idTheme=14&idC ontribution=1305
    Funny though when I do this in Mail it comes out correct and when I tried dragging and dropping it did otherwise. Thanks I will check this out with my pc friends.

  • Attachments sent via mail not received as attachments

    Frequently when I send an email with an attached gif or jpeg, the receiver writes back to ask if I can send it as an attachment, not embedded in the email. I find this confusing since I don't know of any other way to send something than as an attachment. If I stuff or zip the file, the recipient can usually receive it. This only occurs with people using PCs, but I have "Always Send Windows Friendly Attachments" checked. Any ideas? Thanks.

    It sounds like you are using Rich Text Format, and are using at least two different fonts (with the Signature as a possible second font source). In this mode, the RTF is converted to HTML, and this is probably causing those who have the problem receiving in good order.
    Compose and send in Plain Text to these people, see if it does do the trick?
    Ernie

  • How to zip report output and send via mail from application

    Hello,
    I want to know how to zip the report output and send it by mail to concerned person from application
    I want this as the report is having more than 70000s of records.
    Also the XLS has the limitation of 2^16 records and the report is having more than this
    Any help is very much appreciated
    Regards,
    Vani

    1: Make a Dummy report. From some post parameter form trigger, run your original report with "srw.runreport" call. The original report can generate output to a file.
    2: Then withing this dummy report run, call a user exit to zip the
    original reports output. You need to write this user exit and attach them
    with reports.
    3: Now use Report 9i distribution for this dummy report to sent this external zip file through mail.
    With Regards
    Reports Team

  • Mail a report output

    Hi
    I have a report. While running a report, In parameter form, I
    have set as follows :-
    Destination type : Mail
    Report ran successfully and sent a mail to the recipient with an
    attachment report.eps ( encapusulated post script).
    Now my question is, How I view it or print it ?
    Bye
    Chandra Mohan Reddy Dalli

    Hi,
    Report's DESFORMAT plays a role is the format of your mail
    attachment.
    Depending totally on the version of Oracle Reports you can
    output in these formats&#8230;
    Bitmap Report:
    DESFORMAT=DFLT will attach a EPS (postscript) file.
    DESFORMAT=RTF will attach a RTF (MS Word/Write) file.
    DESFORMAT=HTML will attach a base HTML (Netscape/IE) file.
    DESFORMAT=HTMLCSS will attach a CSS HTML (Netscape/IE) file.
    DESFORMAT=PDF will attach a PDF (Acrobat Reader) file.
    Character Report:
    DESFORMAT=DFLT will attach a TXT (Notepad etc) file.
    Well, I am not sure of viewing the EPS file and if you find
    anything please let me know.
    Hope this helps you.
    Best Wishes,
    Ganesan

  • Sapscript via mail: attachment with body

    Hi all
    I need your opinion in order to solve the problem in object
    I've an old bill message to be sent via mail, so I've set the customizing by NACE and now it works fine
    The problme is the sapscript is attached to e-mail as pdf but any text is inserted to body mail:
    any text can't be inserted: I saw the note 753622 (Sending of body text and PDF attachment with medium 5), it speaks clearly, it's not possible to add a text.
    So the only solutions seem to be:
    - to try to change the form function in order to add a text as note [like here|Setting Mail Subject and Body;
    - Send the mail by your self (getting OTF data) 
    How have you solve it?
    Thanks
    Max

    Hi Max,
    If I need any sort of email body for an output-based email, I always implement a custom processing routine with mode '5' or mode '8' and leverage existing data retrieval calls where possible.  As you've seen, SAP's output processing options are very limited and clumsy for email processing.  A more professional HTML email body is the way to go - your best option is to handle it yourself.
    Brad

Maybe you are looking for

  • PDF does not open in Lion

    Transferred many PDF's over from Snow Leopard and they will not open in preview in Lion. What gives?

  • Static variable

    Why is that Java does not allow the declaration of a variable in a method, which may be static method or a non-static method to be a static variable? Is there any specific reason for that ....???? The other thing is that if i declare a constructor as

  • @me account is displayed twice.

    In iCal under File > New Calendar, the list is as follows: On My Mac, [email protected], Google, [email protected] The problem I'm encountering is when I go to add a calendar to my @me.com account there are two listed. The first and second @me.com ac

  • ORA-00280

    hi, i create new control file. i got error,please help me out Control file created. SQL> recover database; ORA-00283: recovery session canceled due to errors ORA-01610: recovery using the BACKUP CONTROLFILE option must be done SQL> recover database u

  • Orginal invoice no in a sales return

    Dear Gurus, I'm developing a report where I have to show the original invoice no in a sales return. My input value would be PO field in the order. Pl help Tks