<html><HEAD>
<STYLE type=text/css>p{margin: 0;}</STYLE>

<META content="MSHTML 6.00.2900.3676" name=GENERATOR></HEAD>
<BODY style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana,Arial,Helvetica,sans-serif">
<P>Hi all,</P>
<P>&nbsp;</P>
<P>I discovered where the evil is. In the old situation with BOR objects, the method has a return parameter (setting on the method). So the 'exceptions' are not exceptions but return values.</P>
<P>&nbsp;</P>
<P>Is there a possibility to use this with a Class method?</P>
<P>&nbsp;</P>
<P>Best regards,</P>
<P>Robert<BR><BR></P>
<P>On May 20, 2010 10:58 "Robert van den Berg" <A href="mailto:wug@bergtop-ict.nl">&lt;wug@bergtop-ict.nl&gt;</A> wrote:</P>
<BLOCKQUOTE type="cite">
<P>Mike,</P>
<P>&nbsp;</P>
<P>it does not realy need a statement to pass the value, does it?</P>
<P>&nbsp;</P>
<P>The export parameter is set by the normal ABAP statement:</P><FONT size=1>
<P>APPEND ls_amr TO amr_reject.</P></FONT>
<P>AMR_REJECT is set as exporting parameter.</P>
<P>&nbsp;</P>
<P>Regards,</P>
<P>Robert<BR><BR></P>
<P>On May 20, 2010 10:48 "Mike Gambier" <A href="mailto:madgambler@hotmail.com"><MADGAMBLER@HOTMAIL.COM></A>wrote:</P>
<BLOCKQUOTE type="cite">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=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>&nbsp;</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) &nbsp;– exact same behaviour as function modules.&nbsp; The test tool “cheats” a little. &nbsp;</SPAN></P>
<P class=ecxMsoNormal><SPAN style="FONT-SIZE: 11pt; COLOR: #1f497d; FONT-FAMILY: 'Calibri','sans-serif'"></SPAN>&nbsp;</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>&nbsp;</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>&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=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>&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="" target=_new></A></BLOCKQUOTE></BLOCKQUOTE></BODY></html>