<!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.2650.12">
<TITLE>Validation within custom method</TITLE>
</HEAD>
<BODY>
<P><FONT SIZE=3D2 FACE=3D"Arial">Within a custom method I'm trying to =
validate that a user has made an entry in a date field (it's not =
required by the transaction but we need for our process). I =
copied a SAP method and added some validation to have Workflow keep =
calling the transaction until the user enters a date.</FONT></P>
<P><FONT SIZE=3D2 FACE=3D"Arial">1) Is there a better way to do this =
without doing "wait up to x seconds" and selecting from a =
database within the method?</FONT></P>
<P><FONT SIZE=3D2 FACE=3D"Arial">2) If not, what's the best way to =
figure out the number of seconds in the "wait" =
statement? I just picked 5 and it works fine in our development =
system, but I'm not sure if that will always be long enough to =
recognize a database update in a production system.</FONT></P>
<P><FONT SIZE=3D2 FACE=3D"Arial">-Brad</FONT>
</P>
<P><FONT SIZE=3D2 =
FACE=3D"Arial">---------------------------------------------------------=
--------</FONT>
</P>
<P><FONT SIZE=3D2 FACE=3D"Arial">while val_flag <> 'X'.</FONT>
</P>
<P><FONT SIZE=3D2 FACE=3D"Arial"> call transaction 'CC32' and =
skip first screen.</FONT>
</P>
<P><FONT SIZE=3D2 FACE=3D"Arial">* Wait for ECR table (AENR) to be =
updated.</FONT>
<BR><FONT SIZE=3D2 FACE=3D"Arial"> wait up to 5 seconds.</FONT>
</P>
<P><FONT SIZE=3D2 FACE=3D"Arial">* Get ECR effectivity (valid from) =
date.</FONT>
<BR><FONT SIZE=3D2 FACE=3D"Arial"> select single datuv</FONT>
<BR><FONT SIZE=3D2 FACE=3D"Arial"> into =
valid_from_date</FONT>
<BR><FONT SIZE=3D2 FACE=3D"Arial"> from =
aenr</FONT>
<BR><FONT SIZE=3D2 FACE=3D"Arial"> where aennr =3D =
object-key-changenumber.</FONT>
</P>
<P><FONT SIZE=3D2 FACE=3D"Arial">* If effectivity (valid from) date is =
blank, display error; otherwise</FONT>
<BR><FONT SIZE=3D2 FACE=3D"Arial">* set validation flag.</FONT>
<BR><FONT SIZE=3D2 FACE=3D"Arial"> if valid_from_date is =
initial.</FONT>
<BR><FONT SIZE=3D2 FACE=3D"Arial"> call function =
'POPUP_TO_DISPLAY_TEXT'</FONT>
<BR><FONT SIZE=3D2 FACE=3D"Arial"> =
exporting</FONT>
<BR><FONT SIZE=3D2 =
FACE=3D"Arial"> =
titel &=
nbsp; =3D 'Error'</FONT>
<BR><FONT SIZE=3D2 =
FACE=3D"Arial"> =
textline1 =3D 'Please enter =
effectivity (valid from) date'</FONT>
<BR><FONT SIZE=3D2 =
FACE=3D"Arial"> =
start_column =3D 13</FONT>
<BR><FONT SIZE=3D2 =
FACE=3D"Arial"> =
start_row =3D 13</FONT>
<BR><FONT SIZE=3D2 FACE=3D"Arial"> else.</FONT>
<BR><FONT SIZE=3D2 FACE=3D"Arial"> val_flag =3D =
'X'.</FONT>
<BR><FONT SIZE=3D2 FACE=3D"Arial"> endif.</FONT>
<BR><FONT SIZE=3D2 =
FACE=3D"Arial"> &nb=
sp; </FONT>
<BR><FONT SIZE=3D2 FACE=3D"Arial">endwhile.</FONT>
</P>
</BODY>
</HTML>