Work Item Data Validation

Martin Maguth (USA) martin.maguth at ixos.com
Thu Feb 17 18:02:58 EST 2000


have you tried calling the transaction with a batch-input, such as :
 
DATA: BEGIN OF I_BDCDATA OCCURS 0.
        INCLUDE STRUCTURE BDCDATA.
DATA: END OF I_BDCDATA.
 
REFRESH: I_BDCDATA.
 
  CALL TRANSACTION TCODE USING I_BDCDATA
                         MODE   'A'
                         UPDATE 'S'.
 
 
  maybe this will help...
 
martin
 
-----Original Message-----
From: Schroeter, Brad [mailto:BSchroeter at ti.com]
Sent: Thursday, February 17, 2000 4:29 PM
To: SAP-WUG at MITVMA.MIT.EDU
Subject: Work Item Data Validation
 
 
 
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.
 


More information about the SAP-WUG mailing list