EXCEL to Mail

Hi Experts,
                 I am doing a Scenario which involves sending an Excel file to Mail ie .csv to mail
In my scenario i have a EXCEL file as
Id     FisrtName     LastName     Salary
1         A                   B                3
2         C                   D                4
and I need to get the Mail as an attachment  and the output shold be as follows in the attached Excel File as
ID     Name     Salary
1       AB          3
2       CD          4
I have used the File content Conversion in my sender side.
I have created mappings everything . Could u guide me in doing this scenario. I need the output as attachment as EXCEL
Regards,
Vijaya Lakshmi.

Hi,
SAP Network Blog: XI: Generating Excel files without the Java nor the Conversion agent not possible?
The specified item was not found.
SAP Network Blog: Read Excel instead of XML through FileAdapter
Read Excel instead of XML through FileAdapter
XI: Dynamic name in the mail attachment - pseudo "variable substitution"
The specified item was not found.
XI: Sender mail adapter - PayloadSwapBean - Step by step
The specified item was not found.
XI: HTML e-mails from the receiver mail adapter ?
The specified item was not found.
Mail Adapter (XI) - how to implement dynamic mail address
The specified item was not found.
S/MIME Security for the MAIL-Adapter within XI
S/MIME  Security for the MAIL-Adapter within XI
XI Mail Adapter: An approach for sending emails with attachment with help of Java mapping
XI Mail Adapter: An approach for sending emails with attachment with help of Java mapping
Regards,
Phani

Similar Messages

  • 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

  • Problem with an Excel Attachment - Mail adapter

    Hello.
    I have a problem when I want to attach an excel file. I have configured the communication channel for sending mails with mail package.
    I have done the configuration in order to get an excel file. If I test the scenario with Content_Type "text/html" I recieve correctly the information  in the mail body.
    When I test the scenario with Content_Type "application/vnd.ms-excel", html tags (like: <br>,  , &amp;) are not converted. The file is attached as xls, but not converted correctly.
    For example, with Content_Type "text/html":
    Orders:
    1   00023   ER123
    2   89798   EHJ21
    With Content_Type "application/vnd.ms-excel":
    Orders:&lt;br&gt;1&amp;nbsp;&amp;nbsp;&amp;nbsp;00023&amp;nbsp;&amp;nbsp; ER123"&lt;br&gt2&amp;nbsp;&amp;nbsp;&amp;nbsp;89798&amp;nbsp;&amp;nbsp;&amp;nbsp;EHJ21
    I have tested with Content_Type for Word files and I have the same error too.
    Do I have to set some special charset in the Content_Type?
    Is this an Excel error?
    Thanks in advance.
    Edited by: Alejandro Maldonado Quezada on Apr 6, 2009 6:28 PM

    Hi,
    I had a scenario like SAP R3 - XI - Mail receiver.
    I have generated the Excel file attachment with the following details.
    Content-Type:- application/vnd.ms-excel;name="Filename.CSV".
    Content: - Field1,Field2,Field3,NewLineCharacter,Field4,Field5,Field6.
    Content-disposition = attachment
    In R3 NewLineCharacter = CL_ABAP_CHAR_UTILITIES=>NEWLINE.
    Select KEEP ATTACHMENT option in Mail receive adaptet config.
    Excel file Filename.CSV was generated as attachment as follow.
    Field1  Field2 Field3
    Field4  Field5 Field6
    Regards,
    Jagesh

  • Converting OTF to EXCEL  or PDF to ECXEL  and sending Excel through mail

    Hi ,
    I need a solution for Converting OTF into EXCEL  or PDF into ECXEL  and sending Excel as a attachment to the mail.
    In my current Program I am getting OTF data from script and converting into PDF using Function module ' CONVERT_OTF'
    And sending PDF as a mail attachment using Function module 'SO_NEW_DOCUMENT_SEND_API1' it is working fine but
    My current requirement is I need to send Excel as a mail attachment instead of PDF.
    Hope it is clear for you, please give me solutions with sample code..

    Hi!
    Because OTF is not a grid, like Excel, and PDF can also contain anything, I think it is not possible to convert an OTF, or PDF into an excel spreadsheet.
    You can convert an ALV into excel and send it via email.
    Regards
    Tamá

  • Fm to attach excel in mail

    Hi,
    can anyone send me the FM which is used to send mail with excel attachment other than 'SO_DOCUMENT_SEND_API'.
    IS there anyother document which illustrates the above?
    Regards,
    Storm.

    Hi,
    Check these FM...
    ISR_FI_SEND_EMAIL
    ISR_FI_SEND_EMAIL_NEW_USER
    SLS_CUST_SEND_EMAIL_TOOL
    ********Reward points ,if useful

  • Excel E-mail

    Is it possible to send an e-mail from Excel that will just send one sheet from the workbook? So that it looks like a report when the recipient gets the e-mail. I know I could copy and paste the data but I'm looking for more professional looking results.

    Excel MVP Ron de Bruin has many very helpful tips on sending e-mails from Excel. See
    http://www.rondebruin.nl/win/section1.htm
    Regards, Hans Vogelaar (http://www.eileenslounge.com)

  • Adding multiple tabs to excel in mail

    Hi All,
    I am sending the mail from SAP, here sending one attachment, and the attachment contains only one tab .
    Here my question is, Could I add another tab in the same excel sheet, I need to add in same excel sheet. So , could any body tell me how could I add tab in same excel sheet.
    Regards,
    Siddivinesh Jogu

    Hi,
    hope below link might help you out:
    https://www.sdn.sap.com/irj/scn/wiki?path=/display/abap/to%252bsend%252b2%252bint%252btables%252bdata%252bas%252btwo%252battachments%252bto%252bmail%252bid%252boutside%252bsap%252bsystem
    Pooja

  • How to bring back status bar when opening Excel doc mail attachment?

    I have an iPad updated to 6.1.3.  When I open up an Excel document from mail it opens the attachment fine and the status bar across the top with the 'Done' option to close the doc appears then disappears altogether after a few seconds giving you full screen access to the file.  No problem there, but bringing it back to be able to close the document is tricky.  Tapping along the top works only sometimes....I haven't been able to find a consistent way to bring it back to close the document.  I can slide down across the top to bring up the notification center but tapping across the top to bring the bar back to close the file will only work after playing around with it for about 20 touches or so.  Is there a trick to this or a way to keep the status bar there?  Thanks in advance!!

    Then quit the mail app completely and reboot your iPad, then try again. What we are describing is the way that it is done. Your mail app might be just acting a little hinky now.
    Go to the home screen first by tapping the home button. Double tap the home button and the recents tray will appear with all of your recent apps displayed at the bottom. Tap and hold down on any app icon until it begins to wiggle. Tap the minus sign in the upper left corner of the app that you want to close. Tap the home button or anywhere above the task bar.
    Reboot the iPad by holding down on the sleep and home buttons at the same time for about 10-15 seconds until the Apple Logo appears - ignore the red slider if it appears on the screen - let go of the buttons. Let the iPad start up.

  • 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

  • Excel mail attachment in background execution

    I want to send excel as mail attachment with 53 columns when exceute in background. But i_attach has 255 characters so its truncating more than 255 characters in header and values of excel.
    so pls tel how to send attachment with all internal table contents.
    Adding Attachment
          CALL METHOD L_DOCUMENT->ADD_ATTACHMENT
            EXPORTING
              I_ATTACHMENT_TYPE    = C_EXT
              I_ATTACHMENT_SIZE    = L_SIZE
              I_ATTACHMENT_SUBJECT = 'Valid Standard Cost Estimate'
              I_ATT_CONTENT_TEXT   = I_ATTACH[].

    Hi,
    What extension are you using? Try 'BIN' Extension and remove the size parameter.
    Also add it to the HEX table, not the text one.
              CALL METHOD lv_document->add_attachment
                EXPORTING
                  i_attachment_type    = 'BIN'
                  i_attachment_subject = lv_string
                  i_att_content_hex    = lt_attach[]
                  i_attachment_header  = lt_att_table[].
    Thanks
    Ernesto

  • More than 255 characters required in excel send as attachment in mail.

    Hi Experts,
    I have a requirement to send displayed list in an ALV report as attachment in excel through mail. I have used FM SO_DOCUMENT_SEND_API1. Now the problem is my excel data in more than 255 characters in a line. It is about 400 characters.But it is taking upto 255 characters in the internal table which is passed to parameter contents_bin . This is because the internal table is of type SOLISTI1. But the excel should hold atleast 400 characters as per my requirement. How to overcome this issue ? Please suggest me...
    Regards,
    SURYA

    Say your records are exactly 400 length (I am saying 400 for sake of simplifying things, in reality record lengths can be variable and have to be calculated using STRLEN)
    You will cut the first record at 255 length and put it in first row. You will put next 145 characters in 2nd row, followed by newline characters (hex 0D and 0A) at positions 146 & 147 (which indicates end of record for excel, so that it puts next record in a new excel row).
    The second record will start from 148th character in second row till 255, that is 108 characters and will extend into 3rd row till 400 - 108 = 292th character followed by newline characters (hex 0D and 0A) at postions 293 & 294, followed by contents of 3rd record and so on and so forth.
    If you records are of variable length you can also think of always blank padding them to create a record of such a fixed length that always your records are lesser than that and fit into it. This will leave some blank spaces at the end of each record in excel, which may be fine.

  • How to Convert internal table data into text output and send mail in ABAP

    Hi All,
    Good Morning.
    Taking a glance at a code that converts internal table data to an Excel file in ABAP. also checked how to send this excel to mailing list as attachment.
    But thought of doing it without excel.
    I mean, I have an internal table which contains fields of all types (character,integer,date,time). Since it is only around 4 to 5 rows in it (output),why to convert it to excel. not required!!.  Instead I  want to send this output to User's mails as Normal mail body with No attachments.
    Could anybody please suggest me a way as to how to send internal table data as a mail ( not as an excel or PDF etc).
    as of now my findings are, it is quite complex to convert internal table data to email (Text) format. but i believe if there is some way of doing it.
    Best Regards
    Dileep VT

    here's something I have used in the past where we send out information about failed precalculation settings (which are stored in internal table gt_fail)
    notice we use gt_text as "mail body"
    TRY.
    *     -------- create persistent send request ------------------------
           gv_send_request = cl_bcs=>create_persistent( ).
    *     -------- create and set document -------------------------------
    *     create text to be sent
           wa_line = text-001.
           APPEND wa_line TO gt_text.
           CLEAR wa_line.
           APPEND wa_line TO gt_text.
           LOOP AT gt_fail ASSIGNING <fs_fail>.
             MOVE <fs_fail>-retry_count TO gv_count.
             CONCATENATE text-002
                         <fs_fail>-setting_id
                         text-003
                         gv_count
                         INTO wa_line SEPARATED BY space.
             APPEND wa_line TO gt_text.
             CLEAR wa_line.
           ENDLOOP.
           APPEND wa_line TO gt_text.
           wa_line = text-007.
           APPEND wa_line TO gt_text.
    *     create actual document
           gv_document = cl_document_bcs=>create_document(
                           i_type    = 'RAW'
                           i_text    = gt_text
                           i_length  = '12'
                           i_subject = 'Failed Precalculation Settings!' ).
    *     add document to send request
           CALL METHOD gv_send_request->set_document( gv_document ).
    *     --------- set sender -------------------------------------------
           gv_sender = cl_sapuser_bcs=>create( sy-uname ).
           CALL METHOD gv_send_request->set_sender
             EXPORTING
               i_sender = gv_sender.
    *     --------- add recipient (e-mail address) -----------------------
           LOOP AT s_email INTO wa_email.
             MOVE wa_email-low TO gv_email.
             gv_recipient = cl_cam_address_bcs=>create_internet_address(
                                               gv_email ).
             CALL METHOD gv_send_request->add_recipient
               EXPORTING
                 i_recipient = gv_recipient
                 i_express   = 'X'.
           ENDLOOP.
    *     ---------- set to send immediately -----------------------------
           CALL METHOD gv_send_request->set_send_immediately( 'X' ).
    *     ---------- send document ---------------------------------------
           CALL METHOD gv_send_request->send(
             EXPORTING
               i_with_error_screen = 'X'
             RECEIVING
               result              = gv_sent_to_all ).
           IF gv_sent_to_all = 'X'.
             WRITE text-004.
           ENDIF.
           COMMIT WORK.
    *   exception handling
         CATCH cx_bcs INTO gv_bcs_exception.
           WRITE: text-005.
           WRITE: text-006, gv_bcs_exception->error_type.
           EXIT.
       ENDTRY.
    with the following declarations
    * TABLES                                                               *
    TABLES:
       adr6,
       rsr_prec_sett.
    * INTERNAL TABLES & WORK AREAS                                         *
    DATA:
       gt_fail          TYPE SORTED TABLE OF rsr_prec_sett
                             WITH UNIQUE KEY setting_id run_date,
       gt_text          TYPE bcsy_text,
       wa_fail          LIKE LINE OF gt_fail,
       wa_line(90)      TYPE c.
    FIELD-SYMBOLS:
       <fs_fail>        LIKE LINE OF gt_fail.
    * VARIABLES                                                            *
    DATA:
       gv_count(4)      TYPE n,
       gv_send_request  TYPE REF TO cl_bcs,
       gv_document      TYPE REF TO cl_document_bcs,
       gv_sender        TYPE REF TO cl_sapuser_bcs,
       gv_recipient     TYPE REF TO if_recipient_bcs,
       gv_email         TYPE adr6-smtp_addr,
       gv_bcs_exception TYPE REF TO cx_bcs,
       gv_sent_to_all   TYPE os_boolean.
    * SELECTION-SCREEN                                                     *
    SELECT-OPTIONS:
       s_email          FOR adr6-smtp_addr NO INTERVALS MODIF ID sel.
    DATA:
       wa_email         LIKE LINE OF s_email.

  • PDF form from Excel spreadsheet/table

    I am developing a process where folks enter data (all text) to a central spreadsheet, and someone uses Acrobat X to generate a form. The form needs checkboxes (one per table row), and a digital signature above the table. I'm running into a couple of issues:
    1) I am trying to automate the creation of checkboxes, so that whoever is generating the final PDF form does not need to add a checkbox for each row. I noticed that in Excel, in Develop mode, one can add checkboxes, and on my first try, the PDF form creator seemed to translate those automatically into PDF form checkboxes so that no extra manual step was needed. In my last few tries, the conversion no longer auto-converts checkboxes. Any tips on this?
    2) I also noticed that whereever there is blank space, the form creator inserts a text field. Even for table cells that have text in them, if there's any white space, presto, here comes a text field inserted into that very cell, usually named after the text already in the cell. Is there any way to avoid this?

    Which version of Acrobat do you have? If X, then there should be an option
    in your Excel to Mail Merge the spreadsheet, which is basically what you
    describe. However, I'm not sure if it can also automatically email the
    files to the recipients.
    I have developed a script that can do the merge, *and *automatically email
    the file to each person. Have a look here for more info:
    http://try67.blogspot.com/2011/09/acrobat-mail-merge-and-email.html

  • Sender mail to ERP

    Hello Experts,
    i have a scenario were i need to pick attachment( pdf or file or text or excell) using mail adapter and send it to ERP ( ECC or SRM ).
    no need to convert the data into XML, just pass the attachment to ERP, but condition is not to AL11.
    how to send the attachment to ERP, any blog that can help me?
    Regards,
    Chinna

    Hi chinna,
    did u check the following thread?
    http://scn.sap.com/thread/1176416
    http://scn.sap.com/thread/703957
    check below doc for configuring sender mail adapter
    http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/9e6c7911-0d01-0010-1aa3-8e1bb1551f05?QuickLink=index&overridelayout=true&5003637722589
    Regards
    Gagan

  • ı have iphone 4 and upgrade os 6.0.1 and excell problem.

    ı have iphone 4 and upgrade os 6.0.1 and at now when open from mails excell files ı can't see date cells are ın side the cell diferrrent characters like format type.
    ı send one screenshot from my phone.

    I have not witnessed this behavior with Excel in mail. Are you mailing these documents to yourself, or is someone else mailing them? I would need to test this a little later, I'm not in a position to test at this time. If someone else has a thought, they could come in, otherwise you may have to wait a while for me to do this. I have obligations this evening and am getting ready to log off here.

Maybe you are looking for

  • Using a variable's definition as a variable name

    I have a string variable with definition I need to use as a variable name. For example, this is super simplified: var newVariable = 'it is working'; var partOne:String = 'new'; var partTwo:String = 'Variable'; var partThree = partOne + partTwo; trace

  • Help: Can no longer see old time machine backups

    Hello everyone and thank you for your help. I have two computers, a Power Mac G5 tower and a Mac Book Pro both backing up using time machine to a USB drive connected to my Time Capsule. Previously my backup drive was connected via usb to my airport e

  • Need attachment file name which had sent or received in entire days.

    Hi Friends I need your help for getting information on exchange mailbox user who had sent or received  mails along with attachment file name for entire day. Basically I get the information of entire mails which had received or sent in all days but I

  • Log in screen for Microsft is blank w/error msg

    I have the latest updates, that is not the issue. The log in screen for Skype accounts shows up fine but not for Microsoft accounts. IDK what to do and its been pissing me off for ages now. Any suggestions?

  • Permanently Hiding a specific File Extension in Finder

    Hello peeps, is what I'm asking for possible? What I have in mind is having it so that all images (png, jpg, etc.) in the Finder don't show their file extension. Is there a way to do this? Thanks, -temhawk