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

Multiple attachments in one mail

Former Member
0 Likes
1,066

Hi Experts,

My three ALV report is scheduled through sm36 and sending three attachment as a html file with customized variant to one person. Now my requirement is to send these three attachments in one mail. Please suggest me the ways.

Is this  possible through SM36 or Coding?

Regards,

Anshuman

5 REPLIES 5
Read only

FredericGirod
Active Contributor
0 Likes
878

Hi,

make a little search on the forum, mail with attachments is one of the most asked question

regards

Fred

Read only

arindam_m
Active Contributor
0 Likes
878

Hi,

Just check the program code each will be having its code to send the report output as HTML attachment. There might be a development required. May be a new program to check that these programs have completed and then read each spool in HTML and send across as HTML attachments in a single mail.

Cheers,

Arindam

Read only

0 Likes
878

This message was moderated.

Read only

VijayaKrishnaG
Active Contributor
0 Likes
878

Hi Anshuman,

You can do this through coding itself, use CL_DOCUMENT_BCS class.

CALL METHOD document->add_attachment

     EXPORTING

       i_attachment_type    = '<value>'                                    " HTML/PDF/DOC

       i_attachment_subject = '<subject_to_attachement>'       " Any text

       i_attachment_size    = <file_size>                                 "eg: lp_pdf_size (TYPE so_obj_len)

       i_att_content_hex    = <file_content>                            "eg: lt_solix_tab (Type solix_tab )

  *   Then call below method to set document, add document to send request

   send_request->set_document( document ).

Like this you can do for multiple Attachments.

You can refer report "BCS_EXAMPLE_6" which demonstrates sending files attachment through mails. PDF attachment considered for demonstration, you can try with HTML.

Thanks & Regards,

-VIJAY

Read only

tolga_polat
Active Participant
0 Likes
878

Hi Anshuman,

here is the code example : http://scn.sap.com/thread/3345900

You can call method add_attachment more than one to add multiable attachment.

Regards

Tolga