<!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> </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 DATASET technique and use application server instead of Front
end.</FONT></SPAN></DIV>
<DIV><FONT face=Arial color=#0000ff size=2></FONT> </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> </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> </o:p></SPAN></P></DIV></SPAN></DIV></DIV></DIV></DIV>
<DIV> </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 attach to a
task 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> </DIV>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN
class=484433517-23012009>Now, where I am stumped. 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> </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> </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> </DIV>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff
size=2></FONT> </DIV>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2>CALL FUNCTION
'PTRM_WEB_FORM_PDF_GET'<BR> EXPORTING<BR>
i_employeenumber = object-key-employeenumber<BR>
i_tripnumber =
object-key-tripnumber<BR>*
i_periodnumber = '000'<BR>*
i_trip_component = ' '<BR>* i_trip_data_source =
'DB'<BR> i_display_form = '
'<BR>
i_language = sy-langu<BR>
IMPORTING<BR>
e_pdf_form =
lwa_pdf_form<BR> TABLES<BR>
et_return =
et_return.</FONT></DIV>
<DIV><FONT face=Arial color=#0000ff size=2></FONT> </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> </DIV>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2>**
container<BR>*IF g_pdf_my_container IS INITIAL.<BR>* CREATE OBJECT
g_pdf_my_container<BR>*
EXPORTING<BR>* container_name =
'HTML_FORM'<BR>* EXCEPTIONS<BR>*
OTHERS = 1.<BR>* IF
sy-subrc <> 0.<BR>* ENDIF.<BR>*ENDIF.<BR>*<BR>** html control<BR>*IF
g_pdf_html_control IS INITIAL.<BR>* CREATE OBJECT
g_pdf_html_control<BR>*
EXPORTING<BR>* parent =
g_pdf_my_container<BR>*
EXCEPTIONS<BR>* OTHERS = 1.<BR>* IF sy-subrc
<> 0.<BR>* ENDIF.<BR>*ENDIF.<BR>*<BR>*alignment = align_at_left +
align_at_right
+<BR>*
align_at_top + align_at_bottom.<BR>*<BR>*CALL METHOD
g_pdf_html_control->set_alignment<BR>* EXPORTING<BR>*
alignment = alignment<BR>* EXCEPTIONS<BR>*
OTHERS = 1.<BR>*IF sy-subrc <>
0.<BR>*ENDIF.<BR>*<BR>*l_pdf_size = XSTRLEN( lwa_pdf_form ).<BR>*l_len =
l_pdf_size.<BR>*WHILE l_len >= 1000.<BR>* l_pdf_line =
lwa_pdf_form+l_offset(1000).<BR>* APPEND l_pdf_line TO
l_pdf_data.<BR>* ADD 1000 TO l_offset.<BR>* SUBTRACT 1000 FROM
l_len.<BR>*ENDWHILE.<BR>*IF l_len > 0.<BR>* l_pdf_line =
lwa_pdf_form+l_offset(l_len).<BR>* APPEND l_pdf_line TO
l_pdf_data.<BR>*ENDIF.<BR>*<BR>*l_myurl = 'PDF.pdf'.<BR>*CALL METHOD
g_pdf_html_control->load_data<BR>* EXPORTING<BR>*
url =
l_myurl<BR>*
size =
l_pdf_size<BR>*
type =
'application'<BR>* subtype =
'pdf'<BR>* IMPORTING<BR>* assigned_url =
l_url<BR>* CHANGING<BR>* data_table =
l_pdf_data<BR>* EXCEPTIONS<BR>*
OTHERS = 1.<BR>*IF sy-subrc <>
0.<BR>*ENDIF.</FONT></DIV>
<DIV><FONT face=Arial color=#0000ff size=2></FONT> </DIV>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2>** show
data<BR>*CALL METHOD g_pdf_html_control->show_data<BR>*
EXPORTING<BR>* url = l_url<BR>*
EXCEPTIONS<BR>* OTHERS = 1.<BR>*IF sy-subrc <>
0.<BR>*ENDIF.</FONT></DIV>
<DIV><FONT face=Arial color=#0000ff size=2></FONT> </DIV>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2>*BREAK-POINT ID
ztravel.<BR>swc_get_element container 'zTaskID' 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> </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> </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>
EXPORTING<BR> workitem_id =
workitem_id<BR> att_header =
att_header<BR>
att_bin =
att_bin<BR> document_owner = sy-uname<BR>
language = sy-langu<BR>
do_commit = 'X'<BR>
IMPORTING<BR> return_code =
return_code<BR>
att_id = att_id<BR>
TABLES<BR> message_lines =
message_lines<BR> message_struct =
message_struct.</FONT></DIV>
<DIV><FONT face=Arial color=#0000ff size=2></FONT> </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>