<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=us-ascii">
<META content="MSHTML 6.00.6000.16757" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV dir=ltr align=left><SPAN class=297315221-05012009><FONT face=Arial
color=#0000ff size=2>Hi Alex, </FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=297315221-05012009><FONT face=Arial
color=#0000ff size=2>It's possible to pass information into the exception
class. I have in the past used this to put more details into the workflow
log - you may also be able to use this to write your own log, but I haven't
explored this myself. </FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=297315221-05012009><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=297315221-05012009><FONT face=Arial
color=#0000ff size=2>You need to create your own sub class of either
CX_BO_TEMPORARY, CX_BO_SYSTEM or CX_BO_APPLICATION depending on the type of
error response you want the workflow to take. If you then create
additional attributes of your sub class, you will find the RAISE EXCEPTION
statement will automatically allow you to pass values to these attributes (use
the ABAP "pattern" feature as usual to help create the raise exception
statement). </FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=297315221-05012009><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=297315221-05012009><FONT face=Arial
color=#0000ff size=2>It is NOT however appropriate to use an exception to update
the workflow container - this would be contrary to good OO and workflow design
and is not permitted. </FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=297315221-05012009><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=297315221-05012009><FONT face=Arial
color=#0000ff size=2>If you need a message to be returned immediately to the
user then you have a number of strategies available:</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=297315221-05012009><FONT face=Arial
color=#0000ff size=2>1) If the task is a dialog task the application you are
calling should return a message to the user directly. You will need your task to
be either asynchronous or use a completion condition to check whether the step
has been completed correctly.</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=297315221-05012009><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=297315221-05012009><FONT face=Arial
color=#0000ff size=2>2) If the task is a background task, the application should
return a code indicating that there is an error and any details of the error
as exporting parameters - you can then design your workflow flowchart to
send a message to the user if that error occurs. You should do this
instead of raising an exception - as you actually don't want the workflow to
stop in the event of error. </FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=297315221-05012009><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=297315221-05012009><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=297315221-05012009><FONT face=Arial
color=#0000ff size=2>Hope that helps.</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=297315221-05012009><FONT face=Arial
color=#0000ff size=2>Regards,</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=297315221-05012009><FONT face=Arial
color=#0000ff size=2>Jocelyn </FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=297315221-05012009><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=297315221-05012009><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=297315221-05012009><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV><BR>
<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>Florin Wach
(gmx)<BR><B>Sent:</B> Tuesday, 30 December 2008 7:12 AM<BR><B>To:</B> SAP
Workflow Users' Group<BR><B>Subject:</B> [LIKELY JUNK]Re: Worklow using OO:
Container values not set when temporaryexceptionraised<BR></FONT><BR></DIV>
<DIV></DIV>
<DIV><FONT face=Arial size=2>Hello Alex,</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>it's a normal behaviour to have no dataflow on an
exception, so it'll be rather difficult to pass any information with that
exception. You may think of subtyping the exception class to fill your own
exception-message (using msgv1, v2...) -- yes this will work. No, I don't know
how to read this information from a completed work item, though you had to know
the precessor.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>However I would recommend to continue using the
RAISE EXCEPTION TYPE CX_BO_TEMPORARY and that you have your own exception
handling with an exporting parameter ERROR_RESULT and the internal table of
BAPIRET giving more detailed information. Before you raise the exception, you'll
read your /own/ retry count of this work item (it's stored in the SWWWIHEAD
table) and that you omit the RAISE statement and set the error flag instead,
returning immediatly.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>Best wishes, Happy New Year,</FONT></DIV>
<DIV><FONT face=Arial size=2> Florin</FONT></DIV>
<BLOCKQUOTE
style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
<DIV style="FONT: 10pt arial">----- Original Message ----- </DIV>
<DIV
style="BACKGROUND: #e4e4e4; FONT: 10pt arial; font-color: black"><B>From:</B>
<A title=workflow@heidiandalex.com
href="mailto:workflow@heidiandalex.com">Alex Flow</A> </DIV>
<DIV style="FONT: 10pt arial"><B>To:</B> <A title=sap-wug@mit.edu
href="mailto:sap-wug@mit.edu">sap-wug@mit.edu</A> </DIV>
<DIV style="FONT: 10pt arial"><B>Sent:</B> Monday, December 29, 2008 4:54
PM</DIV>
<DIV style="FONT: 10pt arial"><B>Subject:</B> Worklow using OO: Container
values not set when temporary exceptionraised</DIV>
<DIV><BR></DIV>I have a task that is supposed to return the error messages in
the event of a failure. I'm using temporary errors so that it will retry
a couple of times before giving up.<BR><BR>When it fails I would like to know
what that error message was and then send a mail to the user with details of
the error. The error step is modeled and I'm using a bapiret message to
pass around the information. The strange thing is that the return
messages are never filled after the temporary exception is raised.<BR><BR>The
problem is that it seems that after <SPAN><SPAN
class=L0S52>RAISE</SPAN> EXCEPTION <SPAN
class=L0S52>TYPE</SPAN> cx_bo_temporary the return values aren't moved
back to the container. I know the container bindings are all ok because
if I remove the raise exception everything proceeds as expected and the
bapiret is filled.<BR><BR></SPAN><SPAN>I've tried checking through various oss
notes and the sap help but no luck. The background step is synchronous
so I would expect that on completion OR temporary error the container is
updated. <BR><BR></SPAN><SPAN>My question is: is this normal behaviour
for no return parameters to be filled if there is a temporary exception?
i.e. is this a bug or a feature? I don't remember if this is the same if
done with the older business objects when an exception is raised.<BR><BR>A
simplified version of the code is just:<BR><BR>ex_bapiret = lx_bapiret. " both
are type bapiret2_tab and lx_bapiret has a single line in it<BR>raise
exception type cx_bo_temporary.<BR><BR>Otherwise does anyone know a good
method to create a custom temporary message and use it to pass data to the
next task? I couldn't see a simple way to bind the results of a
temporary error to the container values.<BR><BR>Thanks and have a good new
year,<BR><BR>-Alex<BR></SPAN>
<P>
<HR>
<P></P>_______________________________________________<BR>SAP-WUG mailing
list<BR>SAP-WUG@mit.edu<BR>http://mailman.mit.edu/mailman/listinfo/sap-wug<BR></BLOCKQUOTE></BODY></HTML>