Application Development 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: 

Regarding submitting of two reports into single email

Former Member
0 Kudos

hi all,

I am facing one problem that i need to attach two reports outputs into emails. I am getting one attachment for one report exactly. How we can submit second report and how we can attach second report output as second attachment at the time of sending emails.

Please suggest how we can solve this.

Thanx & Regards

Rami Reddy

3 REPLIES 3

venkat_o
Active Contributor
0 Kudos

Hi Rami Reddy, If you have two pdf internal tables ready with data. Then attaching two attachments is not going to be big problem. Try the below way.


"Write Packing List for Attachment 1
     w_packing_list-transf_bin = 'X'.
     w_packing_list-head_start = 1.
     w_packing_list-head_num   = 1.
     w_packing_list-body_start = 1.
     DESCRIBE TABLE i_attachment LINES w_packing_list-body_num.
     w_packing_list-doc_type   = 'PDF'.
     w_packing_list-obj_descr  = 'PDF Attachment 1'.
     w_packing_list-obj_name   = 'PDF_ATTACHMENT_1'.
     w_packing_list-doc_size   = w_packing_list-body_num * 255.
     APPEND w_packing_list TO i_packing_list.
     CLEAR  w_packing_list.

     "Fill the document data and get size of attachment
     w_document_data-obj_langu  = sy-langu.
     READ TABLE i_attachment INTO w_attachment INDEX g_tab_lines.
     w_document_data-doc_size = ( g_tab_lines - 1 ) * 255 + STRLEN( w_attachment ).
          
     "Write Packing List for Attachment 2
     w_packing_list-transf_bin = 'X'.
     w_packing_list-head_start = 1.
     w_packing_list-head_num   = 1.
     w_packing_list-body_start = 1.
     DESCRIBE TABLE i_attachment LINES w_packing_list-body_num.
     w_packing_list-doc_type   = 'PDF'.
     w_packing_list-obj_descr  = 'PDF Attachment 2'.
     w_packing_list-obj_name   = 'PDF_ATTACHMENT_2'.
     w_packing_list-doc_size   = w_packing_list-body_num * 255.
     APPEND w_packing_list TO i_packing_list.
     CLEAR  w_packing_list.

     "Fill the document data and get size of attachment
     w_document_data-obj_langu  = sy-langu.
     READ TABLE i_attachment INTO w_attachment INDEX g_tab_lines.
     w_document_data-doc_size = ( g_tab_lines - 1 ) * 255 + STRLEN( w_attachment ).
Thanks Venkat.O

Former Member
0 Kudos

hi venkat,

i am not getting with this code. Can you explain me in detail.

Thanx & Regards

Rami Reddy

Former Member
0 Kudos

Hi,

Have a look at this thread for a sample code.

[;

Regards,

Vikranth