<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML xmlns="http://www.w3.org/TR/REC-html40" xmlns:v = 
"urn:schemas-microsoft-com:vml" xmlns:o = 
"urn:schemas-microsoft-com:office:office" xmlns:w = 
"urn:schemas-microsoft-com:office:word" xmlns:m = 
"http://schemas.microsoft.com/office/2004/12/omml"><HEAD>
<META http-equiv=Content-Type content="text/html; charset=us-ascii">
<META content="MSHTML 6.00.2900.5726" name=GENERATOR>
<STYLE>@font-face {
        font-family: Cambria Math;
}
@font-face {
        font-family: Calibri;
}
@page Section1 {size: 8.5in 11.0in; margin: 1.0in 1.0in 1.0in 1.0in; }
P.MsoNormal {
        FONT-SIZE: 11pt; MARGIN: 0in 0in 0pt; FONT-FAMILY: "Calibri","sans-serif"
}
LI.MsoNormal {
        FONT-SIZE: 11pt; MARGIN: 0in 0in 0pt; FONT-FAMILY: "Calibri","sans-serif"
}
DIV.MsoNormal {
        FONT-SIZE: 11pt; MARGIN: 0in 0in 0pt; FONT-FAMILY: "Calibri","sans-serif"
}
A:link {
        COLOR: blue; TEXT-DECORATION: underline; mso-style-priority: 99
}
SPAN.MsoHyperlink {
        COLOR: blue; TEXT-DECORATION: underline; mso-style-priority: 99
}
A:visited {
        COLOR: purple; TEXT-DECORATION: underline; mso-style-priority: 99
}
SPAN.MsoHyperlinkFollowed {
        COLOR: purple; TEXT-DECORATION: underline; mso-style-priority: 99
}
SPAN.EmailStyle17 {
        COLOR: windowtext; FONT-FAMILY: "Calibri","sans-serif"; mso-style-type: personal-compose
}
.MsoChpDefault {
        mso-style-type: export-only
}
DIV.Section1 {
        page: Section1
}
</STYLE>
<!--[if gte mso 9]><xml>
 <o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
 <o:shapelayout v:ext="edit">
  <o:idmap v:ext="edit" data="1" />
 </o:shapelayout></xml><![endif]--></HEAD>
<BODY lang=EN-US vLink=purple link=blue>
<DIV dir=ltr align=left><SPAN class=359191022-23012009><FONT face=Arial 
color=#0000ff size=2>Hi Rick,</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=359191022-23012009><FONT face=Arial 
color=#0000ff size=2></FONT></SPAN>&nbsp;</DIV>
<DIV dir=ltr align=left><SPAN class=359191022-23012009><FONT face=Arial 
color=#0000ff size=2>There is a blog on SDN ( Right now I do not have direct 
link, if I get it, I'll mention the same) .. Pls check if that helps to 
you.</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=359191022-23012009><FONT face=Arial 
color=#0000ff size=2>For background tasks I believe you will have to try the 
OPEN&nbsp;DATASET technique and use application server instead of Front 
end.</FONT></SPAN></DIV>
<DIV><FONT face=Arial color=#0000ff size=2></FONT>&nbsp;</DIV>
<DIV align=left>
<DIV dir=ltr align=left><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">
<DIV dir=ltr align=left><SPAN class=265481700-09012009></SPAN><SPAN 
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">Regards<SPAN 
class=359191022-23012009>&nbsp;</SPAN><o:p></o:p></SPAN></DIV>
<DIV align=left>
<DIV align=left>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt"><SPAN 
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">Akshay Bhagwat</SPAN></P>
<DIV 
style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; PADDING-BOTTOM: 1pt; BORDER-LEFT: medium none; PADDING-TOP: 0in; BORDER-BOTTOM: windowtext 1pt solid; mso-element: para-border-div; mso-border-bottom-alt: solid windowtext .75pt">
<P class=MsoNormal 
style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; MARGIN: 0in 0in 0pt; BORDER-LEFT: medium none; PADDING-TOP: 0in; BORDER-BOTTOM: medium none; mso-border-bottom-alt: solid windowtext .75pt; mso-padding-alt: 0in 0in 1.0pt 0in"><SPAN 
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"><o:p>&nbsp;</o:p></SPAN></P></DIV></SPAN></DIV></DIV></DIV></DIV>
<DIV>&nbsp;</DIV><BR>
<DIV class=OutlookMessageHeader lang=en-us dir=ltr align=left>
<HR tabIndex=-1>
<FONT face=Tahoma size=2><B>From:</B> sap-wug-bounces@mit.edu 
[mailto:sap-wug-bounces@mit.edu] <B>On Behalf Of </B>Sample, 
Rick<BR><B>Sent:</B> Friday, January 23, 2009 12:43 PM<BR><B>To:</B> SAP 
Workflow Users' Group<BR><B>Subject:</B> Attatching PDF File in background 
step<BR></FONT><BR></DIV>
<DIV></DIV>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN 
class=484433517-23012009>I have a need to get a Trip PDF and attach it to a Task 
in a background step. </SPAN></FONT></DIV>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN 
class=484433517-23012009>I get the PDF just fine. I&nbsp;attach to a 
task&nbsp;in FORE GROUND just fine and dandy. </SPAN></FONT></DIV>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN 
class=484433517-23012009></SPAN></FONT>&nbsp;</DIV>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN 
class=484433517-23012009>Now, where I am stumped.&nbsp;How to attach in a 
background step. </SPAN></FONT></DIV>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN 
class=484433517-23012009>I obviously can not use GUI controls to achieve this, 
so anyone have an idea or three, or an example to reference? 
</SPAN></FONT></DIV>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN 
class=484433517-23012009></SPAN></FONT>&nbsp;</DIV>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN 
class=484433517-23012009>Thanks much! </SPAN></FONT></DIV><FONT face=Arial 
color=#0000ff size=2><SPAN class=484433517-23012009></SPAN></FONT><FONT 
face=Arial color=#0000ff size=2>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff 
size=2></FONT>&nbsp;</DIV>
<DIV dir=ltr align=left><SPAN 
style="FONT-SIZE: 8pt; COLOR: #3399cc; FONT-FAMILY: Arial"><SPAN 
style="FONT-WEIGHT: bold; COLOR: #000000">Rick Sample</SPAN> <SPAN 
style="COLOR: #000000">| </SPAN>Office (314) 573-5700<SPAN 
style="COLOR: #000000"> | </SPAN><A 
href="mailto:rick.sample@graybar.com">rick.sample@graybar.com</A> <BR><A 
href="http://www.graybar.com/" target=_BLANK>www.graybar.com</A> - <I>Graybar 
Works to Your Advantage</I> </SPAN></DIV>
<DIV dir=ltr align=left><SPAN 
style="FONT-SIZE: 8pt; COLOR: #3399cc; FONT-FAMILY: Arial"><EM></EM></SPAN></FONT>&nbsp;</DIV>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff 
size=2></FONT>&nbsp;</DIV>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2>CALL FUNCTION 
'PTRM_WEB_FORM_PDF_GET'<BR>&nbsp; EXPORTING<BR>&nbsp;&nbsp;&nbsp; 
i_employeenumber&nbsp;&nbsp; = object-key-employeenumber<BR>&nbsp;&nbsp;&nbsp; 
i_tripnumber&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; = 
object-key-tripnumber<BR>*&nbsp;&nbsp;&nbsp; 
i_periodnumber&nbsp;&nbsp;&nbsp;&nbsp; = '000'<BR>*&nbsp;&nbsp;&nbsp; 
i_trip_component&nbsp;&nbsp; = ' '<BR>*&nbsp;&nbsp;&nbsp; i_trip_data_source = 
'DB'<BR>&nbsp;&nbsp;&nbsp; i_display_form&nbsp;&nbsp;&nbsp;&nbsp; = ' 
'<BR>&nbsp;&nbsp;&nbsp; 
i_language&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; = sy-langu<BR>&nbsp; 
IMPORTING<BR>&nbsp;&nbsp;&nbsp; 
e_pdf_form&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; = 
lwa_pdf_form<BR>&nbsp; TABLES<BR>&nbsp;&nbsp;&nbsp; 
et_return&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; = 
et_return.</FONT></DIV>
<DIV><FONT face=Arial color=#0000ff size=2></FONT>&nbsp;</DIV>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2>LOG-POINT ID 
ztravel FIELDS et_return.<BR>LOG-POINT ID ztravel FIELDS log_crap 
'4_gotPDF_return_code?'.</FONT></DIV>
<DIV><FONT face=Arial color=#0000ff size=2></FONT>&nbsp;</DIV>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2>** 
container<BR>*IF g_pdf_my_container IS INITIAL.<BR>*&nbsp; CREATE OBJECT 
g_pdf_my_container<BR>*&nbsp;&nbsp;&nbsp; 
EXPORTING<BR>*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; container_name = 
'HTML_FORM'<BR>*&nbsp;&nbsp;&nbsp; EXCEPTIONS<BR>*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
OTHERS&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; = 1.<BR>*&nbsp; IF 
sy-subrc &lt;&gt; 0.<BR>*&nbsp; ENDIF.<BR>*ENDIF.<BR>*<BR>** html control<BR>*IF 
g_pdf_html_control IS INITIAL.<BR>*&nbsp; CREATE OBJECT 
g_pdf_html_control<BR>*&nbsp;&nbsp;&nbsp; 
EXPORTING<BR>*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; parent = 
g_pdf_my_container<BR>*&nbsp;&nbsp;&nbsp; 
EXCEPTIONS<BR>*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; OTHERS = 1.<BR>*&nbsp; IF sy-subrc 
&lt;&gt; 0.<BR>*&nbsp; ENDIF.<BR>*ENDIF.<BR>*<BR>*alignment = align_at_left + 
align_at_right 
+<BR>*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
align_at_top + align_at_bottom.<BR>*<BR>*CALL METHOD 
g_pdf_html_control-&gt;set_alignment<BR>*&nbsp; EXPORTING<BR>*&nbsp;&nbsp;&nbsp; 
alignment = alignment<BR>*&nbsp; EXCEPTIONS<BR>*&nbsp;&nbsp;&nbsp; 
OTHERS&nbsp;&nbsp;&nbsp; = 1.<BR>*IF sy-subrc &lt;&gt; 
0.<BR>*ENDIF.<BR>*<BR>*l_pdf_size = XSTRLEN( lwa_pdf_form ).<BR>*l_len = 
l_pdf_size.<BR>*WHILE l_len &gt;= 1000.<BR>*&nbsp; l_pdf_line = 
lwa_pdf_form+l_offset(1000).<BR>*&nbsp; APPEND l_pdf_line TO 
l_pdf_data.<BR>*&nbsp; ADD 1000 TO l_offset.<BR>*&nbsp; SUBTRACT 1000 FROM 
l_len.<BR>*ENDWHILE.<BR>*IF l_len &gt; 0.<BR>*&nbsp; l_pdf_line = 
lwa_pdf_form+l_offset(l_len).<BR>*&nbsp; APPEND l_pdf_line TO 
l_pdf_data.<BR>*ENDIF.<BR>*<BR>*l_myurl = 'PDF.pdf'.<BR>*CALL METHOD 
g_pdf_html_control-&gt;load_data<BR>*&nbsp; EXPORTING<BR>*&nbsp;&nbsp;&nbsp; 
url&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; = 
l_myurl<BR>*&nbsp;&nbsp;&nbsp; 
size&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; = 
l_pdf_size<BR>*&nbsp;&nbsp;&nbsp; 
type&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; = 
'application'<BR>*&nbsp;&nbsp;&nbsp; subtype&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; = 
'pdf'<BR>*&nbsp; IMPORTING<BR>*&nbsp;&nbsp;&nbsp; assigned_url = 
l_url<BR>*&nbsp; CHANGING<BR>*&nbsp;&nbsp;&nbsp; data_table&nbsp;&nbsp; = 
l_pdf_data<BR>*&nbsp; EXCEPTIONS<BR>*&nbsp;&nbsp;&nbsp; 
OTHERS&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; = 1.<BR>*IF sy-subrc &lt;&gt; 
0.<BR>*ENDIF.</FONT></DIV>
<DIV><FONT face=Arial color=#0000ff size=2></FONT>&nbsp;</DIV>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2>** show 
data<BR>*CALL METHOD g_pdf_html_control-&gt;show_data<BR>*&nbsp; 
EXPORTING<BR>*&nbsp;&nbsp;&nbsp; url&nbsp;&nbsp;&nbsp; = l_url<BR>*&nbsp; 
EXCEPTIONS<BR>*&nbsp;&nbsp;&nbsp; OTHERS = 1.<BR>*IF sy-subrc &lt;&gt; 
0.<BR>*ENDIF.</FONT></DIV>
<DIV><FONT face=Arial color=#0000ff size=2></FONT>&nbsp;</DIV>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2>*BREAK-POINT ID 
ztravel.<BR>swc_get_element container 'zTaskID'&nbsp; ztaskid.<BR>LOG-POINT ID 
ztravel FIELDS ztaskid.<BR>LOG-POINT ID ztravel FIELDS log_crap 
'4_got_ztaskid?'.<BR>workitem_id = ztaskid.</FONT></DIV>
<DIV><FONT face=Arial color=#0000ff size=2></FONT>&nbsp;</DIV>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff 
size=2>att_header-file_type = 'B'.<BR>att_header-file_name = 
'PDF'.<BR>att_header-file_extension = 'PDF'.<BR>att_bin = 
lwa_pdf_form.</FONT></DIV>
<DIV><FONT face=Arial color=#0000ff size=2></FONT>&nbsp;</DIV>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2>BREAK-POINT ID 
ztravel.<BR>CALL FUNCTION 'SAP_WAPI_ATTACHMENT_ADD'<BR>&nbsp; 
EXPORTING<BR>&nbsp;&nbsp;&nbsp; workitem_id&nbsp;&nbsp;&nbsp; = 
workitem_id<BR>&nbsp;&nbsp;&nbsp; att_header&nbsp;&nbsp;&nbsp;&nbsp; = 
att_header<BR>&nbsp;&nbsp;&nbsp; 
att_bin&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; = 
att_bin<BR>&nbsp;&nbsp;&nbsp; document_owner = sy-uname<BR>&nbsp;&nbsp;&nbsp; 
language&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; = sy-langu<BR>&nbsp;&nbsp;&nbsp; 
do_commit&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; = 'X'<BR>&nbsp; 
IMPORTING<BR>&nbsp;&nbsp;&nbsp; return_code&nbsp;&nbsp;&nbsp; = 
return_code<BR>&nbsp;&nbsp;&nbsp; 
att_id&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; = att_id<BR>&nbsp; 
TABLES<BR>&nbsp;&nbsp;&nbsp; message_lines&nbsp; = 
message_lines<BR>&nbsp;&nbsp;&nbsp; message_struct = 
message_struct.</FONT></DIV>
<DIV><FONT face=Arial color=#0000ff size=2></FONT>&nbsp;</DIV>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2>LOG-POINT ID 
ztravel FIELDS return_code.<BR>LOG-POINT ID ztravel FIELDS log_crap 
'4_attach_return_code?'.</FONT></DIV><SPAN 
style="FONT-SIZE: 8pt; COLOR: #3399cc; FONT-FAMILY: Arial"></SPAN><FONT 
face=Arial color=navy size=2></FONT><P><strong><span style='font-size:10.0pt;font-family:
"Palatino Linotype","serif";color:green'> Please do not print this email unless it is absolutely necessary. </span></strong><span style='font-family:"Arial","sans-serif"'><o:p></o:p></span></p>


<p> The information contained in this electronic message and any attachments to this message are intended for the exclusive use of the addressee(s) and may contain proprietary, confidential or privileged information. If you are not the intended recipient, you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately and destroy all copies of this message and any attachments. </p>

<p>WARNING: Computer viruses can be transmitted via email. The recipient should check this email and any attachments for the presence of viruses. The company accepts no liability for any damage caused by any virus transmitted by this email. </p>
<p>
www.wipro.com
</p>
</BODY></HTML>