<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Verdana
}
--></style>
</head>
<body class='hmmessage'>
Jocelyn,<BR>
<BR>
I'm not sure that's entirely accurate anymore. ABAP was adjusted some time ago to return EXPORTING, TABLES and CHANGING parameters in FMs or ABAP Class Methods <STRONG>even</STRONG> if you raise an exception.<BR>
<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 as well.<BR>
<BR>
The flaw highlighted by Robert I think is buried in the way the value being received is being bound (or not) into the Method container.<BR>
<BR>
Mike GT<BR> <BR>
<HR id=stopSpelling>
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=ecxSection1>
<P class=ecxMsoNormal><SPAN style="FONT-SIZE: 11pt; COLOR: #1f497d; FONT-FAMILY: 'Calibri','sans-serif'">Hi Robert, </SPAN></P>
<P class=ecxMsoNormal><SPAN style="FONT-SIZE: 11pt; COLOR: #1f497d; FONT-FAMILY: 'Calibri','sans-serif'"> </SPAN></P>
<P class=ecxMsoNormal><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) – exact same behaviour as function modules. The test tool “cheats” a little. </SPAN></P>
<P class=ecxMsoNormal><SPAN style="FONT-SIZE: 11pt; COLOR: #1f497d; FONT-FAMILY: 'Calibri','sans-serif'"> </SPAN></P>
<P class=ecxMsoNormal><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=ecxMsoNormal><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=ecxMsoNormal><SPAN style="FONT-SIZE: 11pt; COLOR: #1f497d; FONT-FAMILY: 'Calibri','sans-serif'"> </SPAN></P>
<P class=ecxMsoNormal><SPAN style="FONT-SIZE: 11pt; COLOR: #1f497d; FONT-FAMILY: 'Calibri','sans-serif'">Regards,</SPAN></P>
<P class=ecxMsoNormal><SPAN style="FONT-SIZE: 11pt; COLOR: #1f497d; FONT-FAMILY: 'Calibri','sans-serif'">Jocelyn </SPAN></P>
<P class=ecxMsoNormal><SPAN style="FONT-SIZE: 11pt; COLOR: #1f497d; FONT-FAMILY: 'Calibri','sans-serif'"> </SPAN></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=ecxMsoNormal><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=ecxMsoNormal> </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'"> </SPAN><BR>
<SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Verdana','sans-serif'">I have a task which uses a method of a class. This 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'"> </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'"> </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'"> </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'"> </SPAN><BR></DIV>                                            <br /><hr />Get a free e-mail account with Hotmail. Sign-up now. <a href='' target='_new'></a></body>
</html>