Validation within custom method

Roehlen, Peter PRoehlen at powercor.com.au
Thu Sep 28 23:18:18 EDT 2000


Brad,
 
If it is a dialog method (ie SAP transaction call), then I'd suggest you
create a field exit (a couple of minutes work) to validate inside the
screen.  It's always better to catch the problem at the source.
 
Regards
 
Peter.
 
-----Original Message-----
From: Schroeter, Brad [mailto:BSchroeter at ti.com]
Sent: Friday, 29 September 2000 9:15 AM
To: SAP-WUG at MITVMA.MIT.EDU
Subject: Validation within custom method
 
 
 
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.
 
1) Is there a better way to do this without doing "wait up to x seconds" and
selecting from a database within the method?
 
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.
 
-Brad
 
-----------------------------------------------------------------
 
while val_flag <> 'X'.
 
  call transaction 'CC32' and skip first screen.
 
* Wait for ECR table (AENR) to be updated.
  wait up to 5 seconds.
 
* Get ECR effectivity (valid from) date.
  select single datuv
      into valid_from_date
      from aenr
    where aennr = object-key-changenumber.
 
* If effectivity (valid from) date is blank, display error; otherwise
* set validation flag.
  if valid_from_date is initial.
    call function 'POPUP_TO_DISPLAY_TEXT'
       exporting
          titel              = 'Error'
          textline1       = 'Please enter effectivity (valid from) date'
          start_column = 13
          start_row       = 13
  else.
     val_flag = 'X'.
  endif.
 
endwhile.
 
**********************************************************************
Powercor Australia Ltd. This email and any file attachments are
confidential and intended solely for the use of the individual or
entity to whom they are addressed. If you have received this email in
error please tell us immediately by return email and delete the
document.
**********************************************************************
 


More information about the SAP-WUG mailing list