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

[background processing] multiple work sheets in single attachment file


I would like to attach multiple worksheets in single attachment file in background processing.

I checked it is possible to download to PC by foreground execution using OLE. Is there any way to handle the same when executing background?

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Mar 16, 2009 at 09:11 AM


    It is not possible to read the excel sheet in the background processing instead

    Using Tcode CG3Y & CG3Z upload the excel sheet to application server and read the data from the application server in the background.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jul 08, 2009 at 03:15 PM

    As Excel can read and write xml files, generated Binary Data using the xml DOM concept. iXML Stream Factory.

    TYPES: BEGIN OF xml_line,

    data(1024) TYPE x,

    END OF xml_line.

    DATA: l_xml_table TYPE TABLE OF xml_line.

    • Creating a stream factory

    l_streamfactory = l_ixml->create_stream_factory( ).

    • Connect internal XML table to stream factory

    l_ostream = l_streamfactory->create_ostream_itable( table = l_xml_table ).

    • Rendering the document

    l_renderer = l_ixml->create_renderer( ostream = l_ostream

    document = l_document ).

    l_rc = l_renderer->render( ).

    • Saving the XML document

    l_xml_size = l_ostream->get_num_written_raw( ).

    • Preparing contents of attachment with Change Log

    l_con_pos = 0.


    DESCRIBE FIELD wa_attachx LENGTH l_con_len IN BYTE MODE.

    LOOP AT l_xml_table INTO wa_xml.

    ASSIGN wa_xml TO <fs_con> CASTING.

    CHECK sy-subrc EQ 0.

    DO l_xml_len TIMES.

    l_xml_pos = sy-index - 1.

    IF l_con_pos = l_con_len.

    APPEND wa_attachx TO i_attachx.

    FREE wa_attachx.

    l_con_pos = 0.


    MOVE <fs_con>l_xml_pos(1) TO wa_attachx-linel_con_pos(1).

    ADD 1 TO l_con_pos.



    IF l_con_pos > 0.

    APPEND wa_attachx TO i_attachx.


    • Adding Attachment

    CALL METHOD lv_document->add_attachment


    i_attachment_type = c_ext

    i_attachment_size = l_size

    i_attachment_subject = C_TITLE

    i_att_content_hex = i_attachx[].

    Add a comment
    10|10000 characters needed characters exceeded

    • Hello,

      Having a similar requirement...formatting the data for multiple worksheet and sending the same in background ...could you please share some ideas on this...

      i have done the below

      1) i did multiple excel sheet generation in foreground .

      2) able to send the mail of the same too in foreground ..

      Need input for the below .

      to make the creation of excel with multiple sheet and sending the mail in background ....

      Thanks and Regards


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.