<!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:st1 =
"urn:schemas-microsoft-com:office:smarttags"><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.2900.2963" name=GENERATOR><!--[if !mso]>
<STYLE>v\:* {
        BEHAVIOR: url(#default#VML)
}
o\:* {
        BEHAVIOR: url(#default#VML)
}
w\:* {
        BEHAVIOR: url(#default#VML)
}
.shape {
        BEHAVIOR: url(#default#VML)
}
</STYLE>
<![endif]--><o:SmartTagType name="PlaceName"
namespaceuri="urn:schemas-microsoft-com:office:smarttags"></o:SmartTagType><o:SmartTagType
name="PlaceType"
namespaceuri="urn:schemas-microsoft-com:office:smarttags"></o:SmartTagType><o:SmartTagType
name="place"
namespaceuri="urn:schemas-microsoft-com:office:smarttags"></o:SmartTagType><o:SmartTagType
name="PersonName"
namespaceuri="urn:schemas-microsoft-com:office:smarttags"></o:SmartTagType><!--[if !mso]>
<STYLE>st1\:* {
        BEHAVIOR: url(#default#ieooui)
}
</STYLE>
<![endif]-->
<STYLE>@font-face {
        font-family: Tahoma;
}
@font-face {
        font-family: sans-serif;
}
@page Section1 {size: 595.3pt 841.9pt; margin: 70.85pt 70.85pt 70.85pt 70.85pt; }
P.MsoNormal {
        FONT-SIZE: 12pt; MARGIN: 0cm 0cm 0pt; FONT-FAMILY: "Times New Roman"
}
LI.MsoNormal {
        FONT-SIZE: 12pt; MARGIN: 0cm 0cm 0pt; FONT-FAMILY: "Times New Roman"
}
DIV.MsoNormal {
        FONT-SIZE: 12pt; MARGIN: 0cm 0cm 0pt; FONT-FAMILY: "Times New Roman"
}
A:link {
        COLOR: blue; TEXT-DECORATION: underline
}
SPAN.MsoHyperlink {
        COLOR: blue; TEXT-DECORATION: underline
}
A:visited {
        COLOR: purple; TEXT-DECORATION: underline
}
SPAN.MsoHyperlinkFollowed {
        COLOR: purple; TEXT-DECORATION: underline
}
P {
        FONT-SIZE: 12pt; MARGIN-LEFT: 0cm; MARGIN-RIGHT: 0cm; FONT-FAMILY: "Times New Roman"; mso-margin-top-alt: auto; mso-margin-bottom-alt: auto
}
TT {
        FONT-FAMILY: "Courier New"
}
SPAN.EmailStyle19 {
        COLOR: navy; FONT-FAMILY: Arial; mso-style-type: personal-reply
}
DIV.Section1 {
        page: Section1
}
</STYLE>
</HEAD>
<BODY lang=HU vLink=purple link=blue>
<DIV dir=ltr align=left><SPAN class=922082006-12092006><FONT face=Arial
color=#0000ff size=2>Sorry I haven't replied earlier, it's been busy (still
is... but sometimes a coder needs a break!)</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=922082006-12092006><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=922082006-12092006><FONT face=Arial
color=#0000ff size=2>To get the work item ID, you can use the following code (at
least in 4.6C):</FONT></SPAN></DIV>
<DIV><FONT face="Courier New" color=#0000ff size=2>* Started from work
item?<BR>DATA: t_requester TYPE STANDARD TABLE OF
swotobjid,<BR> l_workitem TYPE
swwwihead-wi_id.<BR>FIELD-SYMBOLS: <requester> LIKE LINE OF
t_requester.</FONT></DIV>
<DIV><FONT face="Courier New"></FONT> </DIV>
<DIV><FONT face="Courier New" color=#0000ff size=2>CALL FUNCTION
'SWO_QUERY_REQUESTER'<BR>
TABLES<BR> requester =
t_requester<BR>
EXCEPTIONS<BR> not_found =
1<BR>
OTHERS = 99.<BR>IF syst-subrc = 0.<BR> LOOP AT
t_requester<BR> ASSIGNING
<requester><BR> WHERE objtype =
'WORKITEM'.<BR> l_workitem =
<requester>-objkey.<BR> ENDLOOP.<BR>ENDIF.</FONT></DIV>
<DIV><SPAN class=922082006-12092006><FONT face=Arial color=#0000ff
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=922082006-12092006><FONT face=Arial color=#0000ff size=2>I use
this when I want to determine if a method is being executed from a workitem or
in some other way (typically to test a method), but you should be able to then
either look the task up directly in SWWWIHEAD (this is of course NOT
recommended) or by using a WAPI method or the object type workitem (... actually
not). If you just want the task type the WAPI function
SAP_WAPI_GET_HEADER is probably your easiest solution. There you get
SWR_WIHDR-WI_RH_TASK which answers your question.</FONT></SPAN></DIV>
<DIV><SPAN class=922082006-12092006><FONT face=Arial color=#0000ff
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=922082006-12092006><FONT face=Arial color=#0000ff size=2>The
problem with the other suggested solution (binding) may be that the binding
occurs before the work item has been formed (committed to the database). I had
that problem when I wanted to set a latest end deadline depending on work item
creation time.</FONT></SPAN></DIV>
<DIV align=left><FONT face=Arial size=2>-- </FONT></DIV>
<DIV align=left><FONT face=Arial size=2>Kjetil Kilhavn, Statoil OFT GBS
BAS DEV SAP</FONT></DIV>
<DIV><FONT face=Arial color=#0000ff size=2></FONT> </DIV><BR>
<BLOCKQUOTE dir=ltr
style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #0000ff 2px solid; MARGIN-RIGHT: 0px">
<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>Márton
Zsolt<BR><B>Sent:</B> 11. september 2006 10:47<BR><B>To:</B> SAP Workflow
Users' Group<BR><B>Subject:</B> Object attachments <BR></FONT><BR></DIV>
<DIV></DIV>
<DIV class=Section1>
<P class=MsoNormal><FONT face=Arial color=navy size=2><SPAN lang=EN-US
style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">Hi
Teage,<o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial color=navy size=2><SPAN lang=EN-US
style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">I made those
connections (import parameter in my custom method, binding in the standard
task, etc) but I still can't get the task id, if I use my method as a default
method for my business object. <o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial color=navy size=2><SPAN lang=EN-US
style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">Double clicking on
the attachment, the mentioned container element is not filled. I can't get any
information about the task container.<o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial color=navy size=2><SPAN lang=EN-US
style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">What I'm doing
wrong?<o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial color=navy size=2><SPAN lang=EN-US
style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">Thanks,
zsolt<o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial color=navy size=2><SPAN lang=EN-US
style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial"><o:p> </o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial color=navy size=2><SPAN lang=EN-US
style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial"><o:p> </o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial color=navy size=2><SPAN lang=EN-US
style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial"><o:p> </o:p></SPAN></FONT></P>
<DIV>
<DIV class=MsoNormal style="TEXT-ALIGN: center" align=center><FONT
face="Times New Roman" size=3><SPAN lang=EN-US style="FONT-SIZE: 12pt">
<HR tabIndex=-1 align=center width="100%" SIZE=2>
</SPAN></FONT></DIV>
<P class=MsoNormal><B><FONT face=Tahoma size=2><SPAN lang=EN-US
style="FONT-WEIGHT: bold; FONT-SIZE: 10pt; FONT-FAMILY: Tahoma">From:</SPAN></FONT></B><FONT
face=Tahoma size=2><SPAN lang=EN-US
style="FONT-SIZE: 10pt; FONT-FAMILY: Tahoma"> sap-wug-bounces@mit.edu
[mailto:sap-wug-bounces@mit.edu] <B><SPAN style="FONT-WEIGHT: bold">On Behalf
Of </SPAN></B>Tedde Taege<BR><B><SPAN
style="FONT-WEIGHT: bold">Sent:</SPAN></B> Friday, September 08, 2006 4:55
PM<BR><B><SPAN style="FONT-WEIGHT: bold">To:</SPAN></B> <st1:PersonName
w:st="on">SAP Workflow Users' Group</st1:PersonName><BR><B><SPAN
style="FONT-WEIGHT: bold">Subject:</SPAN></B> RE: Object attachments in a
decision step</SPAN></FONT><SPAN lang=EN-US><o:p></o:p></SPAN></P></DIV>
<P class=MsoNormal><FONT face="Times New Roman" size=3><SPAN lang=EN-US
style="FONT-SIZE: 12pt"><o:p> </o:p></SPAN></FONT></P>
<P class=MsoNormal style="MARGIN-BOTTOM: 12pt"><FONT face="Times New Roman"
size=3><SPAN lang=EN-US style="FONT-SIZE: 12pt"><BR></SPAN></FONT><FONT
face=sans-serif size=2><SPAN lang=EN-US
style="FONT-SIZE: 10pt; FONT-FAMILY: sans-serif">Inside of your workflow, you
should have the element _Workitem. The _Workitem element is a business
object of type flowitem. It has a wealth of information. To access
it inside of your task, you need to bind it from the workflow into the
standard task... The import parameter of business object method must be
set up to accept the attribute from the standard task. You will need to
create an import parameter of type business object
Flowitem.</SPAN></FONT><SPAN lang=EN-US> <BR><BR></SPAN><FONT face=sans-serif
size=2><SPAN lang=EN-US style="FONT-SIZE: 10pt; FONT-FAMILY: sans-serif">After
you make these connections, then you should be able to get object inside of
your method from the task container, instantiate it, and access its
attributes.</SPAN></FONT><SPAN lang=EN-US> <BR></SPAN><FONT face=sans-serif
size=2><SPAN lang=EN-US
style="FONT-SIZE: 10pt; FONT-FAMILY: sans-serif">-------------------------------------------------------------------------------------<BR>Tedde
Taege<BR><st1:place w:st="on"><st1:PlaceType
w:st="on">University</st1:PlaceType> of <st1:PlaceName
w:st="on">Nebraska</st1:PlaceName></st1:place> Computing Services
Network<BR>SAP Development 402 472-7544</SPAN></FONT><SPAN lang=EN-US>
<BR><BR><o:p></o:p></SPAN></P>
<TABLE class=MsoNormalTable style="WIDTH: 100%" cellPadding=0 width="100%"
border=0>
<TBODY>
<TR>
<TD
style="PADDING-RIGHT: 0.75pt; PADDING-LEFT: 0.75pt; PADDING-BOTTOM: 0.75pt; WIDTH: 40%; PADDING-TOP: 0.75pt"
vAlign=top width="40%">
<P class=MsoNormal><B><FONT face=sans-serif size=1><SPAN lang=EN-US
style="FONT-WEIGHT: bold; FONT-SIZE: 7.5pt; FONT-FAMILY: sans-serif">Márton
Zsolt <Zsolt.Marton@t-systems.co.hu></SPAN></FONT></B><FONT
face=sans-serif size=1><SPAN lang=EN-US
style="FONT-SIZE: 7.5pt; FONT-FAMILY: sans-serif"> </SPAN></FONT><SPAN
lang=EN-US><BR></SPAN><FONT face=sans-serif size=1><SPAN lang=EN-US
style="FONT-SIZE: 7.5pt; FONT-FAMILY: sans-serif">Sent by:
sap-wug-bounces@mit.edu</SPAN></FONT><SPAN lang=EN-US>
<o:p></o:p></SPAN></P>
<P><FONT face=sans-serif size=1><SPAN lang=EN-US
style="FONT-SIZE: 7.5pt; FONT-FAMILY: sans-serif">09/08/2006 09:43
AM</SPAN></FONT><SPAN lang=EN-US> <o:p></o:p></SPAN></P>
<TABLE class=MsoNormalTable cellPadding=0 border=1>
<TBODY>
<TR>
<TD
style="PADDING-RIGHT: 0.75pt; PADDING-LEFT: 0.75pt; BACKGROUND: white; PADDING-BOTTOM: 0.75pt; PADDING-TOP: 0.75pt"
vAlign=top bgColor=white>
<P class=MsoNormal style="TEXT-ALIGN: center" align=center><FONT
face=sans-serif size=1><SPAN lang=EN-US
style="FONT-SIZE: 7.5pt; FONT-FAMILY: sans-serif">Please respond
to<BR>"<st1:PersonName w:st="on">SAP Workflow Users'
Group</st1:PersonName>" <sap-wug@mit.edu></SPAN></FONT><SPAN
lang=EN-US><o:p></o:p></SPAN></P></TD></TR></TBODY></TABLE>
<P><FONT face="Times New Roman" size=3><SPAN lang=EN-US
style="FONT-SIZE: 12pt"><o:p></o:p></SPAN></FONT></P></TD>
<TD
style="PADDING-RIGHT: 0.75pt; PADDING-LEFT: 0.75pt; PADDING-BOTTOM: 0.75pt; WIDTH: 59%; PADDING-TOP: 0.75pt"
vAlign=top width="59%">
<TABLE class=MsoNormalTable style="WIDTH: 100%" cellPadding=0
width="100%" border=0>
<TBODY>
<TR>
<TD
style="PADDING-RIGHT: 0.75pt; PADDING-LEFT: 0.75pt; PADDING-BOTTOM: 0.75pt; PADDING-TOP: 0.75pt"
vAlign=top>
<P class=MsoNormal style="TEXT-ALIGN: right" align=right><FONT
face=sans-serif size=1><SPAN lang=EN-US
style="FONT-SIZE: 7.5pt; FONT-FAMILY: sans-serif">To</SPAN></FONT><SPAN
lang=EN-US><o:p></o:p></SPAN></P></TD>
<TD
style="PADDING-RIGHT: 0.75pt; PADDING-LEFT: 0.75pt; PADDING-BOTTOM: 0.75pt; PADDING-TOP: 0.75pt"
vAlign=top>
<P class=MsoNormal><FONT face=sans-serif size=1><SPAN lang=EN-US
style="FONT-SIZE: 7.5pt; FONT-FAMILY: sans-serif">"<st1:PersonName
w:st="on">SAP Workflow Users' Group</st1:PersonName>"
<sap-wug@mit.edu></SPAN></FONT><SPAN lang=EN-US>
<o:p></o:p></SPAN></P></TD></TR>
<TR>
<TD
style="PADDING-RIGHT: 0.75pt; PADDING-LEFT: 0.75pt; PADDING-BOTTOM: 0.75pt; PADDING-TOP: 0.75pt"
vAlign=top>
<P class=MsoNormal style="TEXT-ALIGN: right" align=right><FONT
face=sans-serif size=1><SPAN lang=EN-US
style="FONT-SIZE: 7.5pt; FONT-FAMILY: sans-serif">cc</SPAN></FONT><SPAN
lang=EN-US><o:p></o:p></SPAN></P></TD>
<TD
style="PADDING-RIGHT: 0.75pt; PADDING-LEFT: 0.75pt; PADDING-BOTTOM: 0.75pt; PADDING-TOP: 0.75pt"
vAlign=top>
<P class=MsoNormal><FONT face="Times New Roman" size=3><SPAN
lang=EN-US
style="FONT-SIZE: 12pt"><o:p> </o:p></SPAN></FONT></P></TD></TR>
<TR>
<TD
style="PADDING-RIGHT: 0.75pt; PADDING-LEFT: 0.75pt; PADDING-BOTTOM: 0.75pt; PADDING-TOP: 0.75pt"
vAlign=top>
<P class=MsoNormal style="TEXT-ALIGN: right" align=right><FONT
face=sans-serif size=1><SPAN lang=EN-US
style="FONT-SIZE: 7.5pt; FONT-FAMILY: sans-serif">Subject</SPAN></FONT><SPAN
lang=EN-US><o:p></o:p></SPAN></P></TD>
<TD
style="PADDING-RIGHT: 0.75pt; PADDING-LEFT: 0.75pt; PADDING-BOTTOM: 0.75pt; PADDING-TOP: 0.75pt"
vAlign=top>
<P class=MsoNormal><FONT face=sans-serif size=1><SPAN lang=EN-US
style="FONT-SIZE: 7.5pt; FONT-FAMILY: sans-serif">RE: Object
attachments in a decision step</SPAN></FONT><SPAN
lang=EN-US><o:p></o:p></SPAN></P></TD></TR></TBODY></TABLE>
<P class=MsoNormal><FONT face="Times New Roman" size=3><SPAN lang=EN-US
style="FONT-SIZE: 12pt"><o:p> </o:p></SPAN></FONT></P>
<TABLE class=MsoNormalTable cellPadding=0 border=0>
<TBODY>
<TR>
<TD
style="PADDING-RIGHT: 0.75pt; PADDING-LEFT: 0.75pt; PADDING-BOTTOM: 0.75pt; PADDING-TOP: 0.75pt"
vAlign=top>
<P class=MsoNormal><FONT face="Times New Roman" size=3><SPAN
lang=EN-US
style="FONT-SIZE: 12pt"><o:p> </o:p></SPAN></FONT></P></TD>
<TD
style="PADDING-RIGHT: 0.75pt; PADDING-LEFT: 0.75pt; PADDING-BOTTOM: 0.75pt; PADDING-TOP: 0.75pt"
vAlign=top>
<P class=MsoNormal><FONT face="Times New Roman" size=3><SPAN
lang=EN-US
style="FONT-SIZE: 12pt"><o:p> </o:p></SPAN></FONT></P></TD></TR></TBODY></TABLE>
<P class=MsoNormal><FONT face="Times New Roman" size=3><SPAN lang=EN-US
style="FONT-SIZE: 12pt"><o:p></o:p></SPAN></FONT></P></TD></TR></TBODY></TABLE>
<P class=MsoNormal style="MARGIN-BOTTOM: 12pt"><FONT face="Times New Roman"
size=3><SPAN lang=EN-US
style="FONT-SIZE: 12pt"><BR><BR><BR></SPAN></FONT><FONT face=Arial color=navy
size=2><SPAN lang=EN-US
style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">Hi
all,</SPAN></FONT><SPAN lang=EN-US> <BR></SPAN><FONT face=Arial color=navy
size=2><SPAN lang=EN-US
style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial"> </SPAN></FONT><SPAN
lang=EN-US> <BR></SPAN><FONT face=Arial color=navy size=2><SPAN lang=EN-US
style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">We are in
5.0.</SPAN></FONT><SPAN lang=EN-US> <BR></SPAN><FONT face=Arial color=navy
size=2><SPAN lang=EN-US
style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">I'm using a custom
method as a default method for a business object. I have to use the workflow
id (or the task id ) in my method. Is this possible, to get this information
(WS...) ?</SPAN></FONT><SPAN lang=EN-US> <BR></SPAN><FONT face=Arial
color=navy size=2><SPAN lang=EN-US
style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">I tried the following
abap code</SPAN></FONT><SPAN lang=EN-US> <BR></SPAN><FONT face=Arial
color=navy size=2><SPAN lang=EN-US
style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial"> </SPAN></FONT><SPAN
lang=EN-US> <BR></SPAN><FONT face=Arial color=navy size=2><SPAN lang=EN-US
style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">swc_get_element
container '_Workitem'
workingwi. </SPAN></FONT><SPAN
lang=EN-US><BR></SPAN><FONT face=Arial color=navy size=2><SPAN lang=EN-US
style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">swc_get_property
workingwi 'WorkitemTask'
task.
</SPAN></FONT><SPAN lang=EN-US><BR></SPAN><FONT face=Arial color=navy
size=2><SPAN lang=EN-US
style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial"> </SPAN></FONT><SPAN
lang=EN-US> <BR></SPAN><FONT face=Arial color=navy size=2><SPAN lang=EN-US
style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">but, the task is
empty. </SPAN></FONT><SPAN lang=EN-US><BR></SPAN><FONT face=Arial color=navy
size=2><SPAN lang=EN-US
style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">Thanks</SPAN></FONT><SPAN
lang=EN-US> <BR></SPAN><FONT face=Arial color=navy size=2><SPAN lang=EN-US
style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">Zsolt</SPAN></FONT><SPAN
lang=EN-US> <BR></SPAN><FONT face=Arial color=navy size=2><SPAN lang=EN-US
style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial"> </SPAN></FONT><TT><FONT
face="Courier New" size=2><SPAN lang=EN-US
style="FONT-SIZE: 10pt">_______________________________________________</SPAN></FONT></TT><FONT
face="Courier New" size=2><SPAN lang=EN-US
style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"><BR><TT><FONT
face="Courier New">SAP-WUG mailing list</FONT></TT><BR><TT><FONT
face="Courier New">SAP-WUG@mit.edu</FONT></TT><BR><TT><FONT
face="Courier New">http://mailman.mit.edu/mailman/listinfo/sap-wug</FONT></TT></SPAN></FONT><SPAN
lang=EN-US><o:p></o:p></SPAN></P></DIV></BLOCKQUOTE><p></p><p><font size=1>-------------------------------------------------------------------<br>The information contained in this message may be CONFIDENTIAL and is<br>intended for the addressee only. Any unauthorised use, dissemination of the<br>information or copying of this message is prohibited. If you are not the<br>addressee, please notify the sender immediately by return e-mail and delete<br>this message.<br>Thank you.</font size></BODY></HTML>