Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

[background processing] multiple work sheets in single attachment file

Former Member
0 Likes
927

Hi,

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?

6 REPLIES 6
Read only

Former Member
0 Likes
720

HI,

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.

Read only

0 Likes
720

HI,

My question is not how to upload the file.

How to attach the file with multiple worksheets in Email application. we could it it with OLE. But i guess OLE is possible only when we execute the program in foreground.

I would like to get the similar functonality for email application too..

Read only

0 Likes
720

HI,

Any Work arounds to send multiple worksheet attachment in Email application?

Read only

Former Member
0 Likes
720

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_XML LENGTH l_xml_len IN BYTE MODE.

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.

ENDIF.

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

ADD 1 TO l_con_pos.

ENDDO.

ENDLOOP.

IF l_con_pos > 0.

APPEND wa_attachx TO i_attachx.

ENDIF.

  • Adding Attachment

CALL METHOD lv_document->add_attachment

EXPORTING

i_attachment_type = c_ext

i_attachment_size = l_size

i_attachment_subject = C_TITLE

i_att_content_hex = i_attachx[].

Read only

0 Likes
720

hi,

can i borrow your complete code on sending multiple worksheet in single attachment file.

thanks.

Read only

0 Likes
720

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

Suresh