Work Item Data Validation

Schroeter, Brad BSchroeter at ti.com
Thu Feb 17 16:29:19 EST 2000


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).
 
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).
 
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.
 
Thanks,
Brad Schroeter
E-mail: BSchroeter at ti.com
 
 
* This method is modeled after method EDIT_SYNCHRON for object type
* ECM.
begin_method z_edit_synchron_validate changing container.           "SAP
data: flg_wf          like csdata-xfeld value 'X'.                  "SAP
data: change_number   like aenr-aennr.
data: valid_from_date like aenr-datuv.
 
export flg_wf to memory id 'WFECM'.                                 "SAP
set parameter id 'AEN' field object-key-changenumber.               "SAP
call transaction 'CC32' and skip first screen.                      "SAP
 
do X times.
   select aennr datuv
    into: (change_number, valid_from_date)
    from  aenr
    where aennr = object-key-changenumber.
   endselect.
enddo.
 
if valid_from_date is initial.
   call function 'POPUP_TO_DISPLAY_TEXT'
        exporting
          titel        = 'Error'
          textline1    = 'Effectivity date has not been entered'
          start_column = 13
          start_row    = 13.
   exit_cancelled.
endif.
 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.mit.edu/pipermail/sap-wug/attachments/20000217/2ad9ff51/attachment.htm


More information about the SAP-WUG mailing list