<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV=3D"Content-Type" CONTENT=3D"text/html; =
charset=3Diso-8859-1">
<META NAME=3D"Generator" CONTENT=3D"MS Exchange Server version =
5.5.2448.0">
<TITLE>RE: Work Item Data Validation</TITLE>
</HEAD>
<BODY>
 
<P><FONT SIZE=3D2>Thanks for the reply Stephen (and Martin).</FONT>
</P>
 
<P><FONT SIZE=3D2>Stephen,</FONT>
<BR><FONT SIZE=3D2>I'm not real conversant with the difference between =
asynchronous/synchronous tasks and terminating events, so any more =
detail you can add is greatly appreciated.&nbsp; Would I have to add =
any additional Workflow steps after the change ECR task in regards to =
your solution below?</FONT></P>
 
<P><FONT SIZE=3D2>p.s. A change document is created when I enter the =
effectivity on the ECR.</FONT>
</P>
<BR>
 
<P><FONT SIZE=3D2>Regards,</FONT>
<BR><FONT SIZE=3D2>Brad</FONT>
<BR><FONT SIZE=3D2>BSchroeter@ti.com</FONT>
</P>
 
<P><FONT SIZE=3D2>-----Original Message-----</FONT>
<BR><FONT SIZE=3D2>From: Stephan Becker [<A =
HREF=3D"mailto:stephan.becker@walldorftech.com">mailto:stephan.becker@wa=
lldorftech.com</A>]</FONT>
<BR><FONT SIZE=3D2>Sent: Friday, February 18, 2000 1:41 AM</FONT>
<BR><FONT SIZE=3D2>To: SAP-WUG@MITVMA.MIT.EDU</FONT>
<BR><FONT SIZE=3D2>Subject: Re: Work Item Data Validation</FONT>
</P>
<BR>
 
<P><FONT SIZE=3D2>The update lag is a problem that occurs frequently =
with workflow. I had the</FONT>
<BR><FONT SIZE=3D2>same issue with updates in MM a while back; I solved =
it by convincing SAP to</FONT>
<BR><FONT SIZE=3D2>change the timing of the workflow event =
creation.</FONT>
<BR><FONT SIZE=3D2>In your case, that's not an option.</FONT>
<BR><FONT SIZE=3D2>The safest thing would be to establish an event =
creation, with using</FONT>
<BR><FONT SIZE=3D2>SWC_EVENT_CREATE in a user exit or using an existing =
event creation (change</FONT>
<BR><FONT SIZE=3D2>document etc.). Then make the user decision task =
asynchronous, and use that</FONT>
<BR><FONT SIZE=3D2>event as a terminating event. That would fire =
(assuming the event creation</FONT>
<BR><FONT SIZE=3D2>in the application is late enough in the update =
task) after the change is</FONT>
<BR><FONT SIZE=3D2>registered in the database, as opposed to when the =
dialog session finished</FONT>
<BR><FONT SIZE=3D2>(i.e. the user hits save and the standard task =
ends).</FONT>
<BR><FONT SIZE=3D2>Alternatively, use function module =
&quot;RZL_SLEEP&quot; to make the method pause for</FONT>
<BR><FONT SIZE=3D2>a little while and then continue. Better than the =
continuous selects for</FONT>
<BR><FONT SIZE=3D2>performance.</FONT>
</P>
 
<P><FONT SIZE=3D2>Let me know if you need more info.</FONT>
</P>
 
<P><FONT SIZE=3D2>Stephan Becker</FONT>
</P>
 
<P><FONT SIZE=3D2>-----Original Message-----</FONT>
<BR><FONT SIZE=3D2>From: SAP Workflow [<A =
HREF=3D"mailto:Owner-SAP-WUG@MITVMA.MIT.EDU">mailto:Owner-SAP-WUG@MITVMA=
.MIT.EDU</A>]On Behalf Of</FONT>
<BR><FONT SIZE=3D2>Martin Maguth (USA)</FONT>
<BR><FONT SIZE=3D2>Sent: 18 February 2000 00:03</FONT>
<BR><FONT SIZE=3D2>To: SAP-WUG@MITVMA.MIT.EDU</FONT>
<BR><FONT SIZE=3D2>Subject: Re: Work Item Data Validation</FONT>
</P>
<BR>
 
<P><FONT SIZE=3D2>brad:</FONT>
</P>
 
<P><FONT SIZE=3D2>have you tried calling the transaction with a =
batch-input, such as :</FONT>
</P>
 
<P><FONT SIZE=3D2>DATA: BEGIN OF I_BDCDATA OCCURS 0.</FONT>
<BR><FONT SIZE=3D2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; INCLUDE =
STRUCTURE BDCDATA.</FONT>
<BR><FONT SIZE=3D2>DATA: END OF I_BDCDATA.</FONT>
</P>
 
<P><FONT SIZE=3D2>REFRESH: I_BDCDATA.</FONT>
</P>
 
<P><FONT SIZE=3D2>&nbsp; CALL TRANSACTION TCODE USING I_BDCDATA</FONT>
<BR><FONT =
SIZE=3D2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb=
sp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb=
sp;&nbsp; MODE&nbsp;&nbsp; 'A'</FONT>
<BR><FONT =
SIZE=3D2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb=
sp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb=
sp;&nbsp; UPDATE 'S'.</FONT>
</P>
<BR>
 
<P><FONT SIZE=3D2>&nbsp; maybe this will help...</FONT>
</P>
 
<P><FONT SIZE=3D2>martin</FONT>
</P>
 
<P><FONT SIZE=3D2>-----Original Message-----</FONT>
<BR><FONT SIZE=3D2>From: Schroeter, Brad [<A =
HREF=3D"mailto:BSchroeter@ti.com">mailto:BSchroeter@ti.com</A>]</FONT>
<BR><FONT SIZE=3D2>Sent: Thursday, February 17, 2000 4:29 PM</FONT>
<BR><FONT SIZE=3D2>To: SAP-WUG@MITVMA.MIT.EDU</FONT>
<BR><FONT SIZE=3D2>Subject: Work Item Data Validation</FONT>
</P>
<BR>
<BR>
 
<P><FONT SIZE=3D2>We've got a point in our Workflow where a work item =
is sent to a user (a SAP</FONT>
<BR><FONT SIZE=3D2>method calls a tran in change mode).&nbsp; We're =
assuming that the user will</FONT>
<BR><FONT SIZE=3D2>enter some data, but we'd like to add validation to =
make sure that he/she</FONT>
<BR><FONT SIZE=3D2>does (otherwise, it causes errors later in the =
process).</FONT>
</P>
 
<P><FONT SIZE=3D2>My idea was to create a custom method by copying the =
SAP method and then add</FONT>
<BR><FONT SIZE=3D2>some validation code.&nbsp; This validation code =
would catch the invalid data,</FONT>
<BR><FONT SIZE=3D2>display an error message and then do an =
&quot;exit_cancelled&quot; to keep the work</FONT>
<BR><FONT SIZE=3D2>item in the user's queue (in process).&nbsp; =
However, after doing this there</FONT>
<BR><FONT SIZE=3D2>seems to be a update delay in Workflow - even after =
entering the required</FONT>
<BR><FONT SIZE=3D2>data, Workflow doesn't recognize it.&nbsp; The only =
ways I can get around the</FONT>
<BR><FONT SIZE=3D2>problem: 1) Keep re-executing the work item until =
Workflow sees the updated</FONT>
<BR><FONT SIZE=3D2>data; or 2) Put in a high numbered &quot;do =
loop&quot; to give Workflow a chance to</FONT>
<BR><FONT SIZE=3D2>get the updated data within the method (I do not =
like this due to</FONT>
<BR><FONT SIZE=3D2>performance reasons).</FONT>
</P>
 
<P><FONT SIZE=3D2>I've attached the code for the method (with the =
&quot;do loop&quot;), which brings up</FONT>
<BR><FONT SIZE=3D2>an Engineering Change Request in change mode and =
verifies that an</FONT>
<BR><FONT SIZE=3D2>effectivity date has been entered.&nbsp; I've noted =
the original lines from the</FONT>
<BR><FONT SIZE=3D2>SAP method with &quot;SAP&quot;.&nbsp; If anyone has =
any suggestions on how to get around</FONT>
<BR><FONT SIZE=3D2>this update delay, I'd appreciate it.</FONT>
</P>
 
<P><FONT SIZE=3D2>Thanks,</FONT>
<BR><FONT SIZE=3D2>Brad Schroeter</FONT>
<BR><FONT SIZE=3D2>E-mail: BSchroeter@ti.com</FONT>
</P>
<BR>
 
<P><FONT SIZE=3D2>* This method is modeled after method EDIT_SYNCHRON =
for object type</FONT>
<BR><FONT SIZE=3D2>* ECM.</FONT>
<BR><FONT SIZE=3D2>begin_method z_edit_synchron_validate changing =
container.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
&quot;SAP</FONT>
<BR><FONT SIZE=3D2>data: =
flg_wf&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; like =
csdata-xfeld value =
'X'.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&n=
bsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &quot;SAP</FONT>
<BR><FONT SIZE=3D2>data: change_number&nbsp;&nbsp; like =
aenr-aennr.</FONT>
<BR><FONT SIZE=3D2>data: valid_from_date like aenr-datuv.</FONT>
</P>
 
<P><FONT SIZE=3D2>export flg_wf to memory id =
'WFECM'.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
&quot;SAP</FONT>
<BR><FONT SIZE=3D2>set parameter id 'AEN' field =
object-key-changenumber.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &quot;SAP</FONT>
<BR><FONT SIZE=3D2>call transaction 'CC32' and skip first =
screen.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp=
;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
&quot;SAP</FONT>
</P>
 
<P><FONT SIZE=3D2>do X times.</FONT>
<BR><FONT SIZE=3D2>&nbsp;&nbsp; select aennr datuv</FONT>
<BR><FONT SIZE=3D2>&nbsp;&nbsp;&nbsp; into: (change_number, =
valid_from_date)</FONT>
<BR><FONT SIZE=3D2>&nbsp;&nbsp;&nbsp; from&nbsp; aenr</FONT>
<BR><FONT SIZE=3D2>&nbsp;&nbsp;&nbsp; where aennr =3D =
object-key-changenumber.</FONT>
<BR><FONT SIZE=3D2>&nbsp;&nbsp; endselect.</FONT>
<BR><FONT SIZE=3D2>enddo.</FONT>
</P>
 
<P><FONT SIZE=3D2>if valid_from_date is initial.</FONT>
<BR><FONT SIZE=3D2>&nbsp;&nbsp; call function =
'POPUP_TO_DISPLAY_TEXT'</FONT>
<BR><FONT SIZE=3D2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
exporting</FONT>
<BR><FONT =
SIZE=3D2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
titel&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =3D 'Error'</FONT>
<BR><FONT =
SIZE=3D2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
textline1&nbsp;&nbsp;&nbsp; =3D 'Effectivity date has not been =
entered'</FONT>
<BR><FONT =
SIZE=3D2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
start_column =3D 13</FONT>
<BR><FONT =
SIZE=3D2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
start_row&nbsp;&nbsp;&nbsp; =3D 13.</FONT>
<BR><FONT SIZE=3D2>&nbsp;&nbsp; exit_cancelled.</FONT>
<BR><FONT SIZE=3D2>endif.</FONT>
</P>
 
</BODY>
</HTML>