<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Verdana
}
--></style>
</head>
<body class='hmmessage'>
Robert,<BR>
&nbsp;<BR>
This may well be a buggy bit of Workflow OO binding from ABAP Class Method to Workflow Container and not actually to do with the 'old' habit that ABAP used to have of blatting parameters when an Exception was thrown, which is what I think Jocelyn is alluding to. (Correct me if I'm wrong Jocelyn)<BR>
&nbsp;<BR>
A quick way to test would be to write yourself a noddy SE38 Program to invoke the same Method that the Task is invoking and debug it, or failing that test the Task directly for example in SWDD with a break-point in and see for yourself. You'll probably have to turn on system debugging to dip into the kernel though so it might be a bit of a mission :(<BR>
&nbsp;<BR>
This may also depend on which flavour of the Workflow container you're using too. We've had mixed results when using the 'old' Persistence approach as opposed to the new XML one by the way and by mixed I mean inconclusive which&nbsp;has been&nbsp;a bit frustrating.<BR>
&nbsp;<BR>
My suspicion is that the ABAP Class Method is returning the value but then subsequently the Workflow Engine&nbsp;could be&nbsp;ignoring the value and&nbsp;not bothering to&nbsp;bind it back to the Workflow Container, choosing to focus instead&nbsp;on the exception.<BR>
&nbsp;<BR>
Mike GT<BR>&nbsp;<BR>
<HR id=stopSpelling>
From: wug@bergtop-ict.nl<BR>To: sap-wug@mit.edu; sap-wug@mit.edu<BR>Subject: Re: RE: exception in class and passing of parameters<BR>Date: Thu, 20 May 2010 10:58:14 +0200<BR><BR>
<STYLE>
.ExternalClass p
{;}
</STYLE>

Mike,<BR>
&nbsp;<BR>
it does not realy need a statement to pass the value, does it?<BR>
&nbsp;<BR>
The export parameter is set by the normal ABAP statement:<BR><FONT size=1>
APPEND ls_amr TO amr_reject.<BR></FONT>
AMR_REJECT is set as exporting parameter.<BR>
&nbsp;<BR>
Regards,<BR>
Robert<BR><BR><BR>
On May 20, 2010 10:48 "Mike Gambier" <A href="mailto:madgambler@hotmail.com">&lt;madgambler@hotmail.com&gt;</A> wrote:<BR>
<BLOCKQUOTE>Jocelyn,<BR>&nbsp;<BR>I'm not sure that's entirely accurate anymore.&nbsp;ABAP was adjusted some time ago&nbsp;to return EXPORTING, TABLES&nbsp;and CHANGING parameters in FMs or ABAP Class Methods&nbsp;<STRONG>even</STRONG> if you raise an exception.<BR>&nbsp;<BR>We have several examples of where an Exception is thrown and we can still trust the value of an Exporting 'Error' flag or Application Log instance&nbsp;as well.<BR>&nbsp;<BR>The flaw highlighted by Robert&nbsp;I think is buried in the way the value being received is being bound (or not) into the Method container.<BR>&nbsp;<BR>Mike GT<BR>&nbsp;<BR>
<HR id=ecxstopSpelling>
From: jocelyn.dart@sap.com<BR>To: sap-wug@mit.edu<BR>Date: Thu, 20 May 2010 10:30:07 +0200<BR>Subject: RE: exception in class and passing of parameters<BR><BR>
<STYLE>
.ExternalClass p.ecxMsoNormal, .ExternalClass li.ecxMsoNormal, .ExternalClass div.ecxMsoNormal
{margin-bottom:.0001pt;font-size:12.0pt;font-family:'Times New Roman','serif';}
.ExternalClass a:link, .ExternalClass span.ecxMsoHyperlink
{color:blue;text-decoration:underline;}
.ExternalClass a:visited, .ExternalClass span.ecxMsoHyperlinkFollowed
{color:purple;text-decoration:underline;}
.ExternalClass p
{margin-bottom:.0001pt;font-size:12.0pt;font-family:'Times New Roman','serif';}
.ExternalClass span.ecxEmailStyle18
{font-family:'Calibri','sans-serif';color:#1F497D;}
.ExternalClass .ecxMsoChpDefault
{font-size:10.0pt;}
@page Section1
{size:612.0pt 792.0pt;}
.ExternalClass div.ecxSection1
{page:Section1;}
</STYLE>

<DIV class=ecxecxSection1>
<P class=ecxecxMsoNormal><SPAN style="FONT-SIZE: 11pt; COLOR: #1f497d; FONT-FAMILY: 'Calibri','sans-serif'">Hi Robert, </SPAN></P>
<P class=ecxecxMsoNormal><SPAN style="FONT-SIZE: 11pt; COLOR: #1f497d; FONT-FAMILY: 'Calibri','sans-serif'"></SPAN>&nbsp;</P>
<P class=ecxecxMsoNormal><SPAN style="FONT-SIZE: 11pt; COLOR: #1f497d; FONT-FAMILY: 'Calibri','sans-serif'">If you raise an exception, the exporting parameters are NOT returned to the calling application (not just workflow – all calling applications) &nbsp;– exact same behaviour as function modules.&nbsp; The test tool “cheats” a little. &nbsp;</SPAN></P>
<P class=ecxecxMsoNormal><SPAN style="FONT-SIZE: 11pt; COLOR: #1f497d; FONT-FAMILY: 'Calibri','sans-serif'"></SPAN>&nbsp;</P>
<P class=ecxecxMsoNormal><SPAN style="FONT-SIZE: 11pt; COLOR: #1f497d; FONT-FAMILY: 'Calibri','sans-serif'">So for a synchronous task either use an additional exporting parameter to indicate success/failure or use an exception class to update the workflow log with your returned value.</SPAN></P>
<P class=ecxecxMsoNormal><SPAN style="FONT-SIZE: 11pt; COLOR: #1f497d; FONT-FAMILY: 'Calibri','sans-serif'">Or raise an event (with or without parameters) – and make your task asynchronous. </SPAN></P>
<P class=ecxecxMsoNormal><SPAN style="FONT-SIZE: 11pt; COLOR: #1f497d; FONT-FAMILY: 'Calibri','sans-serif'"></SPAN>&nbsp;</P>
<P class=ecxecxMsoNormal><SPAN style="FONT-SIZE: 11pt; COLOR: #1f497d; FONT-FAMILY: 'Calibri','sans-serif'">Regards,</SPAN></P>
<P class=ecxecxMsoNormal><SPAN style="FONT-SIZE: 11pt; COLOR: #1f497d; FONT-FAMILY: 'Calibri','sans-serif'">Jocelyn </SPAN></P>
<P class=ecxecxMsoNormal><SPAN style="FONT-SIZE: 11pt; COLOR: #1f497d; FONT-FAMILY: 'Calibri','sans-serif'"></SPAN>&nbsp;</P>
<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=ecxecxMsoNormal><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>Robert van den Berg <BR><B>Sent:</B> Thursday, 20 May 2010 6:17 PM<BR><B>To:</B> SAP Workflow Users' Group<BR><B>Subject:</B> exception in class and passing of parameters</SPAN></P></DIV></DIV>
<P class=ecxecxMsoNormal>&nbsp;</P><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Verdana','sans-serif'">Hi Group,</SPAN><BR><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Verdana','sans-serif'">&nbsp;</SPAN><BR><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Verdana','sans-serif'">I have a task which uses a method of a class. This&nbsp;method has export parameters and exceptions.</SPAN><BR><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Verdana','sans-serif'">Before the exception is raised, the export parameter is set.</SPAN><BR><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Verdana','sans-serif'">&nbsp;</SPAN><BR><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Verdana','sans-serif'">The problem is that, when the exception is raised, the export parameter is empty. When I test the method from the class builder, the export parameter contains a value but when I test the workflow, the workflow container is empty.</SPAN><BR><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Verdana','sans-serif'">&nbsp;</SPAN><BR><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Verdana','sans-serif'">Does anyone have an idea?</SPAN><BR><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Verdana','sans-serif'">&nbsp;</SPAN><BR><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Verdana','sans-serif'">Regards,</SPAN><BR><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Verdana','sans-serif'">Robert</SPAN><BR><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Verdana','sans-serif'">&nbsp;</SPAN><BR></DIV><BR>
<HR>
Get a free e-mail account with Hotmail. Sign-up now. <A href="http:///"></A></BLOCKQUOTE>                                               <br /><hr />Get a new e-mail account with Hotmail – Free. <a href='http://clk.atdmt.com/UKM/go/197222280/direct/01/' target='_new'>Sign-up now.</a></body>
</html>