Work Item Data Validation

Schroeter, Brad BSchroeter at ti.com
Fri Feb 18 17:54:12 EST 2000


Thanks for the reply Stephen (and Martin).
 
Stephen,
I'm not real conversant with the difference between asynchronous/synchronous
tasks and terminating events, so any more detail you can add is greatly
appreciated.  Would I have to add any additional Workflow steps after the
change ECR task in regards to your solution below?
 
p.s. A change document is created when I enter the effectivity on the ECR.
 
 
Regards,
Brad
BSchroeter at ti.com
 
-----Original Message-----
From: Stephan Becker [mailto:stephan.becker at walldorftech.com]
Sent: Friday, February 18, 2000 1:41 AM
To: SAP-WUG at MITVMA.MIT.EDU
Subject: Re: Work Item Data Validation
 
 
The update lag is a problem that occurs frequently with workflow. I had the
same issue with updates in MM a while back; I solved it by convincing SAP to
change the timing of the workflow event creation.
In your case, that's not an option.
The safest thing would be to establish an event creation, with using
SWC_EVENT_CREATE in a user exit or using an existing event creation (change
document etc.). Then make the user decision task asynchronous, and use that
event as a terminating event. That would fire (assuming the event creation
in the application is late enough in the update task) after the change is
registered in the database, as opposed to when the dialog session finished
(i.e. the user hits save and the standard task ends).
Alternatively, use function module "RZL_SLEEP" to make the method pause for
a little while and then continue. Better than the continuous selects for
performance.
 
Let me know if you need more info.
 
Stephan Becker
 
-----Original Message-----
From: SAP Workflow [mailto:Owner-SAP-WUG at MITVMA.MIT.EDU]On Behalf Of
Martin Maguth (USA)
Sent: 18 February 2000 00:03
To: SAP-WUG at MITVMA.MIT.EDU
Subject: Re: Work Item Data Validation
 
 
brad:
 
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.
 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.mit.edu/pipermail/sap-wug/attachments/20000218/ba8e4eb1/attachment.htm


More information about the SAP-WUG mailing list