<!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>Work Item Data Validation</TITLE>
</HEAD>
<BODY>
<P><FONT SIZE=3D2 FACE=3D"Arial">We've got a point in our Workflow =
where a work item is sent to a user (a SAP method calls a tran in =
change mode). We're assuming that the user will enter some data, =
but we'd like to add validation to make sure that he/she does =
(otherwise, it causes errors later in the process).</FONT></P>
<P><FONT SIZE=3D2 FACE=3D"Arial">My idea was to create a custom method =
by copying the SAP method and then add some validation code. This =
validation code would catch the invalid data, display an error message =
and then do an "exit_cancelled" to keep the work item in the =
user's queue (in process). However, after doing this there seems =
to be a update delay in Workflow - even after entering the required =
data, Workflow doesn't recognize it. The only ways I can get =
around the problem: 1) Keep re-executing the work item until Workflow =
sees the updated data; or 2) Put in a high numbered "do loop" =
to give Workflow a chance to get the updated data within the method (I =
do not like this due to performance reasons).</FONT></P>
<P><FONT SIZE=3D2 FACE=3D"Arial">I've attached the code for the method =
(with the "do loop"), which brings up an Engineering Change =
Request in change mode and verifies that an effectivity date has been =
entered. I've noted the original lines from the SAP method with =
"SAP". If anyone has any suggestions on how to get =
around this update delay, I'd appreciate it.</FONT></P>
<P><FONT SIZE=3D2 FACE=3D"Arial">Thanks,</FONT>
<BR><FONT SIZE=3D2 FACE=3D"Arial">Brad Schroeter</FONT>
<BR><FONT SIZE=3D2 FACE=3D"Arial">E-mail: BSchroeter@ti.com</FONT>
</P>
<BR>
<P><FONT SIZE=3D2 FACE=3D"Arial">* This method is modeled after method =
EDIT_SYNCHRON for object type </FONT>
<BR><FONT SIZE=3D2 FACE=3D"Arial">* =
ECM. &n=
bsp; &n=
bsp; &n=
bsp; &n=
bsp; &n=
bsp; </FONT>
<BR><FONT SIZE=3D2 FACE=3D"Arial">begin_method z_edit_synchron_validate =
changing =
container. =
"SAP </FONT>
<BR><FONT SIZE=3D2 FACE=3D"Arial">data: =
flg_wf like =
csdata-xfeld value =
'X'. &n=
bsp; "SAP </FONT>
<BR><FONT SIZE=3D2 FACE=3D"Arial">data: change_number like =
aenr-aennr. &=
nbsp; &=
nbsp; =
</FONT>
<BR><FONT SIZE=3D2 FACE=3D"Arial">data: valid_from_date like =
aenr-datuv. &=
nbsp; &=
nbsp; =
</FONT>
<BR><FONT SIZE=3D2 =
FACE=3D"Arial"> &nb=
sp; &nb=
sp; &nb=
sp; &nb=
sp; &nb=
sp; &nb=
sp; </FONT>
<BR><FONT SIZE=3D2 FACE=3D"Arial">export flg_wf to memory id =
'WFECM'. &nbs=
p; &nbs=
p; "SAP =
</FONT>
<BR><FONT SIZE=3D2 FACE=3D"Arial">set parameter id 'AEN' field =
object-key-changenumber. =
"SAP </FONT>
<BR><FONT SIZE=3D2 FACE=3D"Arial">call transaction 'CC32' and skip =
first =
screen.  =
; "SAP =
</FONT>
<BR><FONT SIZE=3D2 =
FACE=3D"Arial"> &nb=
sp; &nb=
sp; &nb=
sp; &nb=
sp; &nb=
sp; &nb=
sp; </FONT>
<BR><FONT SIZE=3D2 FACE=3D"Arial">do X =
times. =
=
=
=
=
</FONT>
<BR><FONT SIZE=3D2 FACE=3D"Arial"> select aennr =
datuv &=
nbsp; &=
nbsp; &=
nbsp; &=
nbsp; </FONT>
<BR><FONT SIZE=3D2 FACE=3D"Arial"> into: =
(change_number, =
valid_from_date) &n=
bsp; &n=
bsp; </FONT>
<BR><FONT SIZE=3D2 FACE=3D"Arial"> from =
aenr &n=
bsp; &n=
bsp; &n=
bsp; &n=
bsp; =
</FONT>
<BR><FONT SIZE=3D2 FACE=3D"Arial"> where aennr =3D =
object-key-changenumber. =
=
</FONT>
<BR><FONT SIZE=3D2 FACE=3D"Arial"> =
endselect. &n=
bsp; &n=
bsp; &n=
bsp; &n=
bsp; &n=
bsp; </FONT>
<BR><FONT SIZE=3D2 =
FACE=3D"Arial">enddo. &nb=
sp; &nb=
sp; &nb=
sp; &nb=
sp; &nb=
sp; </FONT>
<BR><FONT SIZE=3D2 =
FACE=3D"Arial"> &nb=
sp; &nb=
sp; &nb=
sp; &nb=
sp; &nb=
sp; </FONT>
<BR><FONT SIZE=3D2 FACE=3D"Arial">if valid_from_date is =
initial. &nbs=
p; &nbs=
p; &nbs=
p; </FONT>
<BR><FONT SIZE=3D2 FACE=3D"Arial"> call function =
'POPUP_TO_DISPLAY_TEXT' &=
nbsp; &=
nbsp; </FONT>
<BR><FONT SIZE=3D2 =
FACE=3D"Arial"> =
exporting &nb=
sp; &nb=
sp; &nb=
sp; &nb=
sp; </FONT>
<BR><FONT SIZE=3D2 =
FACE=3D"Arial"> =
titel =3D =
'Error'  =
;  =
; =
</FONT>
<BR><FONT SIZE=3D2 =
FACE=3D"Arial"> =
textline1 =3D 'Effectivity date has not been =
entered' </FONT>
<BR><FONT SIZE=3D2 =
FACE=3D"Arial"> =
start_column =3D =
13 &nbs=
p; &nbs=
p; &nbs=
p; </FONT>
<BR><FONT SIZE=3D2 =
FACE=3D"Arial"> =
start_row =3D =
13. &nb=
sp; &nb=
sp; &nb=
sp; </FONT>
<BR><FONT SIZE=3D2 FACE=3D"Arial"> =
exit_cancelled. &nb=
sp; &nb=
sp; &nb=
sp; &nb=
sp; </FONT>
<BR><FONT SIZE=3D2 =
FACE=3D"Arial">endif. &nb=
sp; &nb=
sp; &nb=
sp; &nb=
sp; &nb=
sp; </FONT>
</P>
</BODY>
</HTML>