Skip to Content
author's profile photo Former Member
Former Member

Sending 5 tabs Excel through SAP using FM SO_NEW_DOCUMENT_ATT_SEND_API1

Hi Experts,

I am using function module SO_NEW_DOCUMENT_ATT_SEND_API1 tosend mails via SAP and attachment of type EXcel, I knew here how to add the attachment to excel, but my doubt is in my attachment of type excel , I could add data to only one sheet, I want data to add multiple sheets.

Could u please let me know how to do this,that is addind data to multiple sheets in excel.

If there is any other way and also there was no way also ,please let me know

Regards,

Siddivinesh

Edited by: Siddivinesh Jogu on Jul 21, 2009 8:51 AM

Edited by: Siddivinesh Jogu on Jul 21, 2009 8:55 AM

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • Posted on Jul 21, 2009 at 07:04 AM

    Hi Siddivinesh,

    Have a look at the examples provided by SAP.

    BCS_EXAMPLE*

    Check the below links once.

    send-mail-with-multiple-excel-attachments

    regards,

    Lakshman.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jul 21, 2009 at 09:36 AM

    Hello Frn ,

    you can send multiple attachment in a single mail ...

    below is the code ..

    DATA: LD_ERROR TYPE SY-SUBRC,

    LD_RECIEVER TYPE SY-SUBRC,

    LD_MTITLE LIKE SODOCCHGI1-OBJ_DESCR,

    LD_EMAIL LIKE SOMLRECI1-RECEIVER,

    LD_FORMAT TYPE SO_OBJ_TP ,

    LD_ATTDESCRIPTION TYPE SO_OBJ_NAM ,

    LD_ATTDESCRIPTION1 TYPE SO_OBJ_NAM ,

    LD_ATTFILENAME TYPE SO_OBJ_DES ,

    LD_SENDER_ADDRESS LIKE SOEXTRECI1-RECEIVER,

    LD_SENDER_ADDRESS_TYPE LIKE SOEXTRECI1-ADR_TYP,

    LD_RECEIVER LIKE SY-SUBRC.

    • here first attchement.

    LV_START = 1 . "head start .

    • Create attachment notification for success log

    T_PACKING_LIST-TRANSF_BIN = 'X'.

    T_PACKING_LIST-HEAD_START = LV_START.

    T_PACKING_LIST-HEAD_NUM = 1.

    T_PACKING_LIST-BODY_START = 1.

    • DESCRIBE TABLE t_attachment LINES t_packing_list-body_num.

    DESCRIBE TABLE PIT_ATTACH 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-BODY_NUM = T_PACKING_LIST-BODY_NUM.

    T_PACKING_LIST-DOC_SIZE = T_PACKING_LIST-BODY_NUM * 255.

    LV_START = LV_START + T_PACKING_LIST-BODY_NUM. "head start for second attachment

    APPEND T_PACKING_LIST.

    CLEAR T_PACKING_LIST.

    *******************************************************************************

    • same way attach second attachment ...

    • Create attachment notification

    T_PACKING_LIST-TRANSF_BIN = 'X'.

    T_PACKING_LIST-HEAD_START = LV_START.

    T_PACKING_LIST-HEAD_NUM = 1.

    T_PACKING_LIST-BODY_START = 1.

    • DESCRIBE TABLE t_attachment LINES t_packing_list-body_num.

    DESCRIBE TABLE PIT_ATTACH_ERROR LINES T_PACKING_LIST-BODY_NUM.

    T_PACKING_LIST-DOC_TYPE = LD_FORMAT.

    T_PACKING_LIST-OBJ_DESCR = LD_ATTDESCRIPTION1.

    T_PACKING_LIST-OBJ_NAME = LD_ATTFILENAME.

    T_PACKING_LIST-BODY_NUM = T_PACKING_LIST-BODY_NUM.

    T_PACKING_LIST-DOC_SIZE = T_PACKING_LIST-BODY_NUM * 255.

    APPEND T_PACKING_LIST.

    if stiil not resolved send yor mail id ....i will send you the code

    Thanks and Regards..

    Priyank Dxit

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.