<!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.3395" name=GENERATOR>
<STYLE>@font-face {
        font-family: Cambria Math;
}
@font-face {
        font-family: Calibri;
}
@font-face {
        font-family: Tahoma;
}
@page Section1 {size: 612.0pt 792.0pt; margin: 72.0pt 72.0pt 72.0pt 72.0pt; }
P.MsoNormal {
        FONT-SIZE: 12pt; MARGIN: 0cm 0cm 0pt; FONT-FAMILY: "Times New Roman","serif"
}
LI.MsoNormal {
        FONT-SIZE: 12pt; MARGIN: 0cm 0cm 0pt; FONT-FAMILY: "Times New Roman","serif"
}
DIV.MsoNormal {
        FONT-SIZE: 12pt; MARGIN: 0cm 0cm 0pt; FONT-FAMILY: "Times New Roman","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: #1f497d; FONT-FAMILY: "Calibri","sans-serif"; mso-style-type: personal-reply
}
.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-GB vLink=purple link=blue>
<DIV dir=ltr align=left><SPAN class=905051116-27082008><FONT face=Arial
color=#0000ff size=2>Another FM to try is SAP_WAPI_WORKITEMS_BY_TASK and then
SAP_WAPI_READ_CONTAINER to get the result. If you know up front the
requirement to report on the results I think having Z tables would work
better (but do we ever know all the requirements at the design
phase?). </FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=905051116-27082008><FONT face=Arial
color=#0000ff></FONT></SPAN> </DIV>
<DIV><!--StartFragment -->
<STYLE type=text/css>
SPAN {
font-family: "Courier New";
font-size: 10pt;
color: #000000;
background: #FFFFFF;
}
.L1S31 {
font-style: italic;
color: #808080;
}
.L1S33 {
color: #4DA619;
}
.L1S52 {
color: #0000FF;
}
</STYLE>
<SPAN><SPAN
class=L1S31>* get the tasks that qualify from selections</SPAN><BR> <SPAN
class=L1S52>call</SPAN> <SPAN class=L1S52>function</SPAN> <SPAN
class=L1S33>'SAP_WAPI_WORKITEMS_BY_TASK'</SPAN><BR> <SPAN
class=L1S52>exporting</SPAN><BR> <SPAN
class=L1S52>time</SPAN> = ls_time<BR> selection_status_variant = p_ss_var<SPAN
class=905051116-27082008> "<- closed tasks so you can see the
results</SPAN><BR> <SPAN
class=L1S52>tables</SPAN><BR> task_filter = lt_tasks<SPAN
class=905051116-27082008> "<- prefill with the tasks to look
for</SPAN><BR> worklist = lt_worklist.</SPAN>
</DIV>
<DIV><FONT face="Courier New" size=2></FONT> </DIV>
<DIV><FONT face="Courier New" size=2><!--StartFragment --><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;
}
.L1S33 {
color: #4DA619;
}
.L1S52 {
color: #0000FF;
}
</STYLE>
</FONT></FONT></FONT><!--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=L1S31>* for each entry need to read container info </SPAN></SPAN></DIV>
<DIV><SPAN><SPAN class=L1S31></SPAN> <SPAN
class=L1S52>loop</SPAN> <SPAN
class=L1S52>at</SPAN> lt_worklist <SPAN
class=L1S52>assigning</SPAN> <lfs_wihdr>.<BR><BR> <SPAN
class=L1S52>refresh</SPAN>: lt_cntr, lt_borobj, lt_allobj.<BR> <SPAN
class=L1S52>call</SPAN> <SPAN class=L1S52>function</SPAN> <SPAN
class=L1S33>'SAP_WAPI_READ_CONTAINER'</SPAN><BR> <SPAN
class=L1S52>exporting</SPAN><BR> workitem_id = <lfs_wihdr>-wi_id<BR> <SPAN
class=L1S52>tables</SPAN><BR> simple_container = lt_cntr<BR> subcontainer_bor_objects = lt_borobj<BR> subcontainer_all_objects = lt_allobj.<BR><BR><SPAN
class=L1S31>* Determine the object of the wf task and set keys</SPAN><BR> <SPAN
class=L1S52>loop</SPAN> <SPAN class=L1S52>at</SPAN> lt_cntr <SPAN
class=L1S52>assigning</SPAN> <lfs_cntr>.<BR> <SPAN
class=L1S52>if</SPAN> <lfs_cntr>-element = <SPAN
class=L1S33>'_WI_RESULT'</SPAN> <SPAN
class=L1S52>or</SPAN> </SPAN><SPAN><lfs_cntr>-element = <SPAN
class=L1S33>'APPRDESC'</SPAN>. <BR> gs_tbl-wi_result = <lfs_cntr>-<SPAN
class=L1S52>value</SPAN>.<BR> <SPAN
class=L1S52>endif</SPAN>.</SPAN> </DIV>
<DIV><FONT face="Courier New" size=2></FONT> </DIV>
<DIV><SPAN class=905051116-27082008>...</SPAN></DIV>
<DIV><SPAN class=905051116-27082008>I never got a way to interpret the -value to
the defined outcome so I coded the mapping of the result value to a text
description. any feedback on how to get the wf definition text would be
good to know.</SPAN></DIV>
<DIV><SPAN class=905051116-27082008></SPAN> </DIV>
<DIV><SPAN class=905051116-27082008>Now I know we don't want to read tables
directly but I had to get the Date of execution for the report so I did the
following: </SPAN><SPAN class=905051116-27082008></SPAN><SPAN
class=905051116-27082008></SPAN></DIV>
<DIV><SPAN class=905051116-27082008><!--StartFragment --><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;
}
.L1S33 {
color: #4DA619;
}
.L1S52 {
color: #0000FF;
}
</STYLE>
</FONT></FONT><SPAN><SPAN
class=L1S31>* For completed tasks get who and when the task was completed.</SPAN><BR><SPAN
class=L1S31>* Date isn't returned by the WAPI so we have to read it. Option</SPAN><BR><SPAN
class=L1S31>* to read the table SWWLOGHIST exists but there are more entries</SPAN><BR><SPAN
class=L1S31>* then reading header table.</SPAN><BR> <SPAN
class=L1S52>if</SPAN> <SPAN
class=L1S52>not</SPAN> lt_worklist[] <SPAN
class=L1S52>is</SPAN> <SPAN
class=L1S52>initial</SPAN>.<BR><BR> <SPAN
class=L1S52>select</SPAN> wi_id wi_aed wi_aagent <SPAN
class=L1S52>from</SPAN> swwwihead<BR> <SPAN
class=L1S52>into</SPAN> <SPAN
class=L1S52>table</SPAN> lt_loghist<BR> <SPAN
class=L1S52>for</SPAN> <SPAN class=L1S52>all</SPAN> entries <SPAN
class=L1S52>in</SPAN> lt_worklist<BR> <SPAN
class=L1S52>where</SPAN> wi_id = lt_worklist-wi_id.<BR><BR> <SPAN
class=L1S52>sort</SPAN> lt_loghist <SPAN
class=L1S52>by</SPAN> wi_id.<BR><BR><SPAN
class=L1S31>* need to get the wf initiator</SPAN><BR> <SPAN
class=L1S52>select</SPAN> wi_id wi_aagent wi_text wi_cd wi_ct wi_stat wi_rh_task wi_chckwi<BR> <SPAN
class=L1S52>from</SPAN> swwwihead<BR> <SPAN
class=L1S52>into</SPAN> <SPAN
class=L1S52>table</SPAN> lt_wf<BR> <SPAN
class=L1S52>for</SPAN> <SPAN class=L1S52>all</SPAN> entries <SPAN
class=L1S52>in</SPAN> lt_worklist<BR> <SPAN
class=L1S52>where</SPAN> wi_id = lt_worklist-wi_chckwi.<BR><BR> <SPAN
class=L1S52>sort</SPAN> lt_wf <SPAN
class=L1S52>by</SPAN> wi_id.<BR><BR> <SPAN
class=L1S31>"for subflows get the parent wf initiator</SPAN><BR> <SPAN
class=L1S52>loop</SPAN> <SPAN class=L1S52>at</SPAN> lt_wf <SPAN
class=L1S52>assigning</SPAN> <lfs_wf> <SPAN
class=L1S52>where</SPAN> wi_chckwi <> <SPAN
class=L1S33>' '</SPAN>.<BR> <SPAN
class=L1S52>select</SPAN> <SPAN
class=L1S52>single</SPAN> wi_aagent <SPAN
class=L1S52>from</SPAN> swwwihead <SPAN
class=L1S52>into</SPAN> <lfs_wf>-wi_aagent<BR> <SPAN
class=L1S52>where</SPAN> wi_id = <lfs_wf>-wi_chckwi.<BR> <SPAN
class=L1S52>endloop</SPAN>.<BR><BR> <SPAN
class=L1S52>endif</SPAN>.</SPAN><FONT face="Times New Roman" size=3>
</FONT></SPAN></DIV>
<DIV><SPAN class=905051116-27082008></SPAN> </DIV>
<DIV align=left>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt" align=left><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">Regards<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; mso-bidi-font-family: 'Times New Roman'"><o:p></o:p></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> Mike Pokraka
[mailto:wug@workflowconnections.com] <BR><B>Sent:</B> Thursday, August 21, 2008
3:47 AM<BR><B>To:</B> 'SAP Workflow Users' Group'<BR><B>Subject:</B> RE: Custom
report to know the workflow approval status<BR></FONT><BR></DIV>
<DIV></DIV>
<DIV class=Section1>
<P class=MsoNormal><SPAN
style="FONT-SIZE: 11pt; COLOR: #1f497d; FONT-FAMILY: 'Calibri','sans-serif'">Please
AVOID accessing tables directly if you have an alternative. Use FM
SAP_WAPI_WORKITEMS_TO_OBJECT.<o:p></o:p></SPAN></P>
<P class=MsoNormal><SPAN
style="FONT-SIZE: 11pt; COLOR: #1f497d; FONT-FAMILY: 'Calibri','sans-serif'"><o:p> </o:p></SPAN></P>
<P class=MsoNormal><SPAN
style="FONT-SIZE: 11pt; COLOR: #1f497d; FONT-FAMILY: 'Calibri','sans-serif'"><o:p> </o:p></SPAN></P>
<DIV
style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0cm; BORDER-TOP: medium none; PADDING-LEFT: 4pt; PADDING-BOTTOM: 0cm; BORDER-LEFT: blue 1.5pt solid; PADDING-TOP: 0cm; BORDER-BOTTOM: medium none">
<DIV>
<DIV
style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0cm; BORDER-TOP: #b5c4df 1pt solid; PADDING-LEFT: 0cm; PADDING-BOTTOM: 0cm; BORDER-LEFT: medium none; PADDING-TOP: 3pt; BORDER-BOTTOM: medium none">
<P class=MsoNormal><B><SPAN lang=EN-US
style="FONT-SIZE: 10pt; FONT-FAMILY: 'Tahoma','sans-serif'">From:</SPAN></B><SPAN
lang=EN-US style="FONT-SIZE: 10pt; FONT-FAMILY: 'Tahoma','sans-serif'">
sap-wug-bounces@mit.edu [mailto:sap-wug-bounces@mit.edu] <B>On Behalf Of
</B>Ibrahim Khan<BR><B>Sent:</B> 21 August 2008 06:31<BR><B>To:</B> SAP Workflow
Users' Group<BR><B>Subject:</B> Re: Custom report to know the workflow approval
status<o:p></o:p></SPAN></P></DIV></DIV>
<P class=MsoNormal><o:p> </o:p></P>
<DIV>
<P class=MsoNormal style="MARGIN-BOTTOM: 12pt">I am working on the Appropriation
Request workflow for PS.<BR>The information is not stored in standard tables
because the approvers are dynamic and selected while creating the Appropriation
request.<BR>In this case I need to explore the workflow related tables to create
this custom report.<o:p></o:p></P>
<DIV>
<P class=MsoNormal>On Thu, Aug 21, 2008 at 11:58 AM, Rahul Shukla <<A
href="mailto:rahul_ariean@yahoo.com">rahul_ariean@yahoo.com</A>>
wrote:<o:p></o:p></P>
<P class=MsoNormal>Pls go to se12 and search for swww*, there are header and
workitem tables from where based upon ur object name and task names, you can
retrieve such information.<BR><BR>You may need to join ur custom tables too to
get the next level of approvers , if you are maintaing
there.<BR><BR>Regards,<BR>Rahul<BR>Something that can't be re-cycled is Wasted
Time.<BR><BR><BR>--- On Thu, 8/21/08, Ibrahim Khan <<A
href="mailto:ikhansap@gmail.com">ikhansap@gmail.com</A>> wrote:<BR><BR>>
From: Ibrahim Khan <<A
href="mailto:ikhansap@gmail.com">ikhansap@gmail.com</A>><BR>> Subject:
Custom report to know the workflow approval status<BR>> To: "SAP Workflow
Users' Group" <<A
href="mailto:SAP-WUG@mit.edu">SAP-WUG@mit.edu</A>><BR>> Date: Thursday,
August 21, 2008, 8:44 AM<o:p></o:p></P>
<DIV>
<DIV>
<P class=MsoNormal>> Hi Friends,<BR>> For one of my custom workflow the
client needs a custom<BR>> report to know the<BR>> approval status. This
custom workflow will be a multilevel<BR>> approval and they<BR>> want to
know the status based on the object key(document<BR>> number) like
who<BR>> has approved it at what time, who else has to approve etc<BR>>
which standard<BR>> workflow tables can be used for this? Please
advice.<o:p></o:p></P></DIV></DIV>
<P class=MsoNormal>> _______________________________________________<BR>>
SAP-WUG mailing list<BR>> <A
href="mailto:SAP-WUG@mit.edu">SAP-WUG@mit.edu</A><BR>> <A
href="http://mailman.mit.edu/mailman/listinfo/sap-wug"
target=_blank>http://mailman.mit.edu/mailman/listinfo/sap-wug</A><BR><BR><BR><BR>_______________________________________________<BR>SAP-WUG
mailing list<BR><A href="mailto:SAP-WUG@mit.edu">SAP-WUG@mit.edu</A><BR><A
href="http://mailman.mit.edu/mailman/listinfo/sap-wug"
target=_blank>http://mailman.mit.edu/mailman/listinfo/sap-wug</A><o:p></o:p></P></DIV>
<P class=MsoNormal><o:p> </o:p></P></DIV></DIV></DIV></BODY></HTML>