<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=us-ascii">
<META content="MSHTML 6.00.2900.3354" name=GENERATOR></HEAD>
<BODY>
<DIV dir=ltr align=left><SPAN class=658565420-30072008><FONT face=Arial
color=#0000ff size=2>You might be able to use the following ... I use it after
a smart form call where the control parameter getotf was
specified.</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=658565420-30072008></SPAN><SPAN
class=658565420-30072008><!--StartFragment --><FONT size=3><FONT face=Arial
color=#0000ff size=2></FONT></FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=658565420-30072008><FONT size=3><FONT
face="Times New Roman"><!--StartFragment -->
<STYLE type=text/css>
SPAN {
font-family: "Courier New";
font-size: 10pt;
color: #000000;
background: #FFFFFF;
}
.L1S31 {
font-style: italic;
color: #808080;
}
.L1S32 {
color: #3399FF;
}
.L1S33 {
color: #4DA619;
}
.L1S52 {
color: #0000FF;
}
</STYLE>
<SPAN><SPAN class=L1S52>form</SPAN> send_email <SPAN
class=L1S52>using</SPAN> ps_job_info <SPAN
class=L1S52>type</SPAN> ssfcrescl<BR> ps_nast <SPAN
class=L1S52>type</SPAN> nast<BR> ps_recip <SPAN
class=L1S52>type</SPAN> zrb_ad3display.<BR><BR> <SPAN
class=L1S52>data</SPAN>: l_len_in <SPAN
class=L1S52>like</SPAN> sood-objlen,<BR> l_subject <SPAN
class=L1S52>like</SPAN> sodocchgi1-obj_descr,<BR> lt_mess_bod <SPAN
class=L1S52>like</SPAN> solisti1 <SPAN
class=L1S52>occurs</SPAN> <SPAN class=L1S32>0</SPAN> <SPAN
class=L1S52>with</SPAN> <SPAN class=L1S52>header</SPAN> <SPAN
class=L1S52>line</SPAN>,<BR> lt_mess_att <SPAN
class=L1S52>like</SPAN> solisti1 <SPAN
class=L1S52>occurs</SPAN> <SPAN class=L1S32>0</SPAN> <SPAN
class=L1S52>with</SPAN> <SPAN class=L1S52>header</SPAN> <SPAN
class=L1S52>line</SPAN>,<BR> lt_tline <SPAN
class=L1S52>type</SPAN> <SPAN class=L1S52>table</SPAN> <SPAN
class=L1S52>of</SPAN> tline <SPAN class=L1S52>with</SPAN> <SPAN
class=L1S52>header</SPAN> <SPAN
class=L1S52>line</SPAN>,<BR> l_attachment_desc <SPAN
class=L1S52>type</SPAN> so_obj_nam,<BR> l_attachment_name <SPAN
class=L1S52>type</SPAN> so_obj_des,<BR> wa_buffer <SPAN
class=L1S52>type</SPAN> string, <SPAN
class=L1S31>"To convert from 132 to 255</SPAN><BR> l_error <SPAN
class=L1S52>type</SPAN> sy-subrc,<BR> l_address <SPAN
class=L1S52>like</SPAN> usaddress,<BR> l_address_string <SPAN
class=L1S52>type</SPAN> adr6-smtp_addr,<BR> lt_otf <SPAN
class=L1S52>type</SPAN> itcoo <SPAN
class=L1S52>occurs</SPAN> <SPAN class=L1S32>0</SPAN> <SPAN
class=L1S52>with</SPAN> <SPAN class=L1S52>header</SPAN> <SPAN
class=L1S52>line</SPAN>.<BR><BR><SPAN
class=L1S31>* Convert the OTF output to a PDF format for sending</SPAN><BR> lt_otf[] = ps_job_info-otfdata[].<BR> <SPAN
class=L1S52>call</SPAN> <SPAN class=L1S52>function</SPAN> <SPAN
class=L1S33>'CONVERT_OTF'</SPAN><BR> <SPAN
class=L1S52>exporting</SPAN><BR> <SPAN
class=L1S52>format</SPAN> = <SPAN
class=L1S33>'PDF'</SPAN><BR> max_linewidth = <SPAN
class=L1S32>132</SPAN><BR> <SPAN
class=L1S52>importing</SPAN><BR> bin_filesize = l_len_in<BR> <SPAN
class=L1S52>tables</SPAN><BR> otf = lt_otf<BR> <SPAN
class=L1S52>lines</SPAN> = lt_tline<BR> <SPAN
class=L1S52>exceptions</SPAN><BR> err_max_linewidth = <SPAN
class=L1S32>1</SPAN><BR> err_format = <SPAN
class=L1S32>2</SPAN><BR> err_conv_not_possible = <SPAN
class=L1S32>3</SPAN><BR> <SPAN
class=L1S52>others</SPAN> = <SPAN
class=L1S32>4</SPAN>.<BR> <SPAN class=L1S52>loop</SPAN> <SPAN
class=L1S52>at</SPAN> lt_tline.<BR> <SPAN
class=L1S52>translate</SPAN> lt_tline <SPAN
class=L1S52>using</SPAN> <SPAN
class=L1S33>'~'</SPAN>.<BR> <SPAN
class=L1S52>concatenate</SPAN> wa_buffer lt_tline <SPAN
class=L1S52>into</SPAN> wa_buffer.<BR> <SPAN
class=L1S52>endloop</SPAN>.<BR> <SPAN
class=L1S52>translate</SPAN> wa_buffer <SPAN
class=L1S52>using</SPAN> <SPAN class=L1S33>'~'</SPAN>.<BR> <SPAN
class=L1S52>do</SPAN>.<BR> lt_mess_att = wa_buffer.<BR> <SPAN
class=L1S52>append</SPAN> lt_mess_att.<BR> <SPAN
class=L1S52>shift</SPAN> wa_buffer <SPAN
class=L1S52>left</SPAN> <SPAN class=L1S52>by</SPAN> <SPAN
class=L1S32>255</SPAN> <SPAN
class=L1S52>places</SPAN>.<BR> <SPAN
class=L1S52>if</SPAN> wa_buffer <SPAN class=L1S52>is</SPAN> <SPAN
class=L1S52>initial</SPAN>.<BR> <SPAN
class=L1S52>exit</SPAN>.<BR> <SPAN
class=L1S52>endif</SPAN>.<BR> <SPAN
class=L1S52>enddo</SPAN>.<BR><BR><SPAN
class=L1S31>* Default subject matter</SPAN><BR> <SPAN
class=L1S52>concatenate</SPAN> <SPAN class=L1S33>'Object-'</SPAN>(<SPAN
class=L1S32>001</SPAN>) ps_nast-objky <SPAN
class=L1S52>into</SPAN> l_subject.<BR> l_attachment_desc = ps_nast-objky.<BR> <SPAN
class=L1S52>refresh</SPAN> lt_mess_bod.<BR> <SPAN
class=L1S52>concatenate</SPAN> <SPAN
class=L1S33>'See Attachment from SAP ('</SPAN>(<SPAN
class=L1S32>002</SPAN>)<BR> sy-sysid <SPAN
class=L1S33>'/'</SPAN> sy-mandt <SPAN
class=L1S33>')'</SPAN> <SPAN
class=L1S52>into</SPAN> lt_mess_bod.<BR> <SPAN
class=L1S52>translate</SPAN> lt_mess_bod <SPAN
class=L1S52>using</SPAN> <SPAN class=L1S33>'~ '</SPAN>. <SPAN
class=L1S52>append</SPAN> lt_mess_bod.<BR><BR><SPAN
class=L1S31>* Send file by email as .PDF</SPAN><BR> <SPAN
class=L1S52>perform</SPAN> send_file_as_email_attachment<BR> <SPAN
class=L1S52>tables</SPAN> lt_mess_bod<BR> lt_mess_att<BR> <SPAN
class=L1S52>using</SPAN> ps_recip-smtp_addr<BR> l_subject<BR> <SPAN
class=L1S33>'PDF'</SPAN><BR> l_attachment_name<BR> l_attachment_desc<BR> <SPAN
class=L1S52>changing</SPAN> l_error.<BR><BR><SPAN
class=L1S52>endform</SPAN>. <SPAN
class=L1S31>"send_email</SPAN></SPAN> </FONT></FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=658565420-30072008><FONT size=3><FONT
face="Times New Roman">
<STYLE type=text/css>
SPAN {
font-family: "Courier New";
font-size: 10pt;
color: #000000;
background: #FFFFFF;
}
.L1S31 {
font-style: italic;
color: #808080;
}
.L1S32 {
color: #3399FF;
}
.L1S33 {
color: #4DA619;
}
.L1S52 {
color: #0000FF;
}
</STYLE>
</FONT></FONT><SPAN><BR><SPAN
class=L1S52>form</SPAN> send_file_as_email_attachment <SPAN
class=L1S52>tables</SPAN> it_message<BR> it_attach<BR> <SPAN
class=L1S52>using</SPAN> p_email<BR> p_mtitle<BR> p_format<BR> p_filename<BR> p_attdescription<BR> <SPAN
class=L1S52>changing</SPAN> p_error.<BR><BR> <SPAN
class=L1S52>data</SPAN>: ld_error <SPAN
class=L1S52>type</SPAN> sy-subrc,<BR> ld_reciever <SPAN
class=L1S52>type</SPAN> sy-subrc,<BR> ld_mtitle <SPAN
class=L1S52>like</SPAN> sodocchgi1-obj_descr,<BR> ld_email <SPAN
class=L1S52>like</SPAN> somlreci1-receiver,<BR> ld_format <SPAN
class=L1S52>type</SPAN> so_obj_tp ,<BR> ld_attdescription <SPAN
class=L1S52>type</SPAN> so_obj_nam ,<BR> ld_attfilename <SPAN
class=L1S52>type</SPAN> so_obj_des ,<BR> ld_sender_address <SPAN
class=L1S52>like</SPAN> soextreci1-receiver,<BR> ld_sender_address_type <SPAN
class=L1S52>like</SPAN> soextreci1-adr_typ,<BR> ld_receiver <SPAN
class=L1S52>like</SPAN> sy-subrc.<BR><BR> <SPAN
class=L1S52>data</SPAN>: t_packing_list <SPAN
class=L1S52>like</SPAN> sopcklsti1 <SPAN
class=L1S52>occurs</SPAN> <SPAN class=L1S32>0</SPAN> <SPAN
class=L1S52>with</SPAN> <SPAN class=L1S52>header</SPAN> <SPAN
class=L1S52>line</SPAN>,<BR> t_contents <SPAN
class=L1S52>like</SPAN> solisti1 <SPAN
class=L1S52>occurs</SPAN> <SPAN class=L1S32>0</SPAN> <SPAN
class=L1S52>with</SPAN> <SPAN class=L1S52>header</SPAN> <SPAN
class=L1S52>line</SPAN>,<BR> t_receivers <SPAN
class=L1S52>like</SPAN> somlreci1 <SPAN
class=L1S52>occurs</SPAN> <SPAN class=L1S32>0</SPAN> <SPAN
class=L1S52>with</SPAN> <SPAN class=L1S52>header</SPAN> <SPAN
class=L1S52>line</SPAN>,<BR> t_attachment <SPAN
class=L1S52>like</SPAN> solisti1 <SPAN
class=L1S52>occurs</SPAN> <SPAN class=L1S32>0</SPAN> <SPAN
class=L1S52>with</SPAN> <SPAN class=L1S52>header</SPAN> <SPAN
class=L1S52>line</SPAN>,<BR> t_object_header <SPAN
class=L1S52>like</SPAN> solisti1 <SPAN
class=L1S52>occurs</SPAN> <SPAN class=L1S32>0</SPAN> <SPAN
class=L1S52>with</SPAN> <SPAN class=L1S52>header</SPAN> <SPAN
class=L1S52>line</SPAN>,<BR> w_cnt <SPAN
class=L1S52>type</SPAN> <SPAN
class=L1S52>i</SPAN>,<BR> w_sent_all(<SPAN
class=L1S32>1</SPAN>) <SPAN class=L1S52>type</SPAN> <SPAN
class=L1S52>c</SPAN>,<BR> w_doc_data <SPAN
class=L1S52>like</SPAN> sodocchgi1.<BR><BR> ld_email = p_email.<BR> ld_mtitle = p_mtitle.<BR> ld_format = p_format.<BR> ld_attdescription = p_attdescription.<BR> ld_attfilename = p_filename.<BR><BR><SPAN
class=L1S31>* Fill the document data.</SPAN><BR> w_doc_data-doc_size = <SPAN
class=L1S32>1</SPAN>.<BR><BR><SPAN
class=L1S31>* Populate the subject/generic message attributes</SPAN><BR> w_doc_data-obj_langu = sy-langu.<BR> w_doc_data-obj_name = <SPAN
class=L1S33>'saprpt'</SPAN>.<BR> w_doc_data-obj_descr = ld_mtitle .<BR> w_doc_data-sensitivty = <SPAN
class=L1S33>'F'</SPAN>.<BR><BR><SPAN
class=L1S31>* Fill the document data and get size of attachment</SPAN><BR> <SPAN
class=L1S52>clear</SPAN> w_doc_data.<BR> <SPAN
class=L1S52>read</SPAN> <SPAN
class=L1S52>table</SPAN> it_attach <SPAN
class=L1S52>index</SPAN> w_cnt.<BR> w_doc_data-doc_size =<BR> ( w_cnt - <SPAN
class=L1S32>1</SPAN> ) * <SPAN
class=L1S32>255</SPAN> + <SPAN
class=L1S52>strlen</SPAN>( it_attach ).<BR> w_doc_data-obj_langu = sy-langu.<BR> w_doc_data-obj_name = <SPAN
class=L1S33>'saprpt'</SPAN>.<BR> w_doc_data-obj_descr = ld_mtitle.<BR> w_doc_data-sensitivty = <SPAN
class=L1S33>'F'</SPAN>.<BR> <SPAN
class=L1S52>clear</SPAN> t_attachment.<BR> <SPAN
class=L1S52>refresh</SPAN> t_attachment.<BR> t_attachment[] = it_attach[].<BR><BR><SPAN
class=L1S31>* Describe the body of the message</SPAN><BR> <SPAN
class=L1S52>clear</SPAN> t_packing_list.<BR> <SPAN
class=L1S52>refresh</SPAN> t_packing_list.<BR> t_packing_list-transf_bin = space.<BR> t_packing_list-head_start = <SPAN
class=L1S32>1</SPAN>.<BR> t_packing_list-head_num = <SPAN
class=L1S32>0</SPAN>.<BR> t_packing_list-body_start = <SPAN
class=L1S32>1</SPAN>.<BR> <SPAN
class=L1S52>describe</SPAN> <SPAN
class=L1S52>table</SPAN> it_message <SPAN
class=L1S52>lines</SPAN> t_packing_list-body_num.<BR> t_packing_list-doc_type = <SPAN
class=L1S33>'RAW'</SPAN>.<BR> <SPAN
class=L1S52>append</SPAN> t_packing_list.<BR><BR><SPAN
class=L1S31>* Create attachment notification</SPAN><BR> t_packing_list-transf_bin = <SPAN
class=L1S33>'X'</SPAN>.<BR> t_packing_list-head_start = <SPAN
class=L1S32>1</SPAN>.<BR> t_packing_list-head_num = <SPAN
class=L1S32>1</SPAN>.<BR> t_packing_list-body_start = <SPAN
class=L1S32>1</SPAN>.<BR><BR> <SPAN
class=L1S52>describe</SPAN> <SPAN
class=L1S52>table</SPAN> t_attachment <SPAN
class=L1S52>lines</SPAN> t_packing_list-body_num.<BR> t_packing_list-doc_type = ld_format.<BR> t_packing_list-obj_descr = ld_attdescription.<BR> t_packing_list-obj_name = ld_attfilename.<BR> t_packing_list-doc_size = t_packing_list-body_num * <SPAN
class=L1S32>255</SPAN>.<BR> <SPAN
class=L1S52>append</SPAN> t_packing_list.<BR><BR><SPAN
class=L1S31>* Add the recipients email address</SPAN><BR> <SPAN
class=L1S52>clear</SPAN> t_receivers.<BR> <SPAN
class=L1S52>refresh</SPAN> t_receivers.<BR> t_receivers-receiver = ld_email.<BR> t_receivers-rec_type = <SPAN
class=L1S33>'U'</SPAN>.<BR> <SPAN
class=L1S52>append</SPAN> t_receivers.<BR><BR> <SPAN
class=L1S52>call</SPAN> <SPAN class=L1S52>function</SPAN> <SPAN
class=L1S33>'SO_NEW_DOCUMENT_ATT_SEND_API1'</SPAN><BR> <SPAN
class=L1S52>exporting</SPAN><BR> document_data = w_doc_data<BR> put_in_outbox = <SPAN
class=L1S33>'X'</SPAN><BR> commit_work = <SPAN
class=L1S33>'X'</SPAN><BR> <SPAN
class=L1S52>importing</SPAN><BR> sent_to_all = w_sent_all<BR> <SPAN
class=L1S52>tables</SPAN><BR> packing_list = t_packing_list<BR> contents_bin = t_attachment<BR> contents_txt = it_message<BR> receivers = t_receivers<BR> <SPAN
class=L1S52>exceptions</SPAN><BR> too_many_receivers = <SPAN
class=L1S32>1</SPAN><BR> document_not_sent = <SPAN
class=L1S32>2</SPAN><BR> document_type_not_exist = <SPAN
class=L1S32>3</SPAN><BR> operation_no_authorization = <SPAN
class=L1S32>4</SPAN><BR> parameter_error = <SPAN
class=L1S32>5</SPAN><BR> x_error = <SPAN
class=L1S32>6</SPAN><BR> enqueue_error = <SPAN
class=L1S32>7</SPAN><BR> <SPAN
class=L1S52>others</SPAN> = <SPAN
class=L1S32>8</SPAN>.<BR><BR><SPAN
class=L1S31>* Populate zerror return code</SPAN><BR> ld_error = sy-subrc.<BR><BR><SPAN
class=L1S52>endform</SPAN>. <SPAN
class=L1S31>"send_file_as_email_attachment</SPAN></SPAN><FONT
face="Times New Roman" size=3> </FONT></SPAN></DIV>
<DIV> </DIV>
<DIV align=left>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt" align=left><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">Regards<?xml:namespace prefix = o ns
= "urn:schemas-microsoft-com:office:office" /><o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt"><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"><o:p> </o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt"><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">Margaret
Schumacher<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt">
<P class=MsoNormal style="MARGIN: 0in 0in 0pt"><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"></SPAN></P></P></DIV><BR>
<DIV class=OutlookMessageHeader lang=en-us dir=ltr align=left>
<HR tabIndex=-1>
<FONT face=Tahoma size=2><B>From:</B> muralitharan.c@tcs.com
[mailto:muralitharan.c@tcs.com] <BR><B>Sent:</B> Tuesday, July 29, 2008 3:45
AM<BR><B>To:</B> sap-wug@mit.edu<BR><B>Subject:</B> Attaching Pdf file and
sending mail<BR></FONT><BR></DIV>
<DIV></DIV><BR><FONT face=sans-serif size=2>Hi All,</FONT> <BR><BR><FONT
face=sans-serif size=2>I'm creating a workflow for purchase request, when this
workflow triggered i have wrritten a rule to create a smartform and it'll be
convert into pdf file.</FONT> <BR><FONT face=sans-serif size=2>Now i need to
attach this file dynamically without downloading to local system it should
attach with work item and then this particular work item need to send as mail to
approver or particular user.</FONT> <BR><BR><FONT face=sans-serif size=2>I
request you to give me details about this.</FONT> <BR><BR><FONT face=sans-serif
size=2>Advance thanks!</FONT> <BR><BR><FONT face=sans-serif
size=2>Regards,</FONT> <BR><FONT face=sans-serif size=2><BR>Muralitharan
C<BR>Tata Consultancy Services<BR>Mailto: muralitharan.c@tcs.com<BR>Website:
http://www.tcs.com<BR>____________________________________________<BR>Experience
certainty. IT Services<BR>
Business
Solutions<BR>
Outsourcing<BR>____________________________________________</FONT><PRE>=====-----=====-----=====
Notice: The information contained in this e-mail
message and/or attachments to it may contain
confidential or privileged information. If you are
not the intended recipient, any dissemination, use,
review, distribution, printing or copying of the
information contained in this e-mail message
and/or attachments to it are strictly prohibited. If
you have received this communication in error,
please notify us by reply e-mail or telephone and
immediately and permanently delete the message
and any attachments. Thank you
</PRE></BODY></HTML>