Home > Ask the SAP software/management Experts > SAP workflow/webflow Questions & Answers > Time as a trigger for a workflow
Ask The SAP Expert: Questions & Answers
EMAIL THIS

Time as a trigger for a workflow

Alon Raskin EXPERT RESPONSE FROM: Alon Raskin

Pose a Question
Other SAP Categories
Meet all SAP Experts
Become an Expert for this site


Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us   


>
QUESTION POSED ON: 05 October 2001

Most of the workflow activities are triggered by an event such as a order creation or a closure. Can a workflow be triggered based on time, meaning if a service order is created, if a particular user status is not set within a particular time then a workflow to be triggered.


>

The immediate answer to this is No. A workflow can not be triggered if an object does not change to a particular status. At least not using the standard SAP tools that are provided. However, this is not to say that there is no way to implement this functionality. We can use the standard deadline monitoring functionality in conjunction with some of our other ?tools? to implement this.

Lets say, for the sake of the example, that we want to trigger a workflow if its status has not been set to TECO (technically complete) 2 days after it has been created.

As I see it there are 2 approaches in order to implement this functionality.

1. We could create a batch report which executes nightly (or every two days). The report could select all the Service Orders that were created on SY-DATUM ? 2 and that do not have a status of TECO. Once all those records are selected, the report could kick off a workflow for each Service Order which has not been Technically Complete. The workflow could be kicked off by using an event (using macro swc_raise_event) or by kicking the workflow off manually using Function Module SWW_WI_START_SIMPLE.

One of the benefits of this approach would be that you could easily tune the SELECT statements to ensure program efficiency.

The drawback to this approach is that the workflow wound only be kicked during the batch run. This may be acceptable but if it is not then you will need to take a look at option 2.

2. The second option would be to kick off a workflow for each Service Order created, wait till the deadline expires and then check its status to see if its status has changed. If the status has changed then terminate the workflow.

The drawbacks to this approach are
- The system may experience performance issues if a large number of Service Orders are created.
- Overhead of kicking a workflow off which may do nothing. This is because if the status has changed to TECO then we simply terminate. I suspect this would the case most of the time hence the unnecessary overhead.

The benefits of this approach
- The system will react immediately when the deadline expires. There is no need to wait till the nightly batch for the workflow to be kicked off.

Note: If you were to choose option 2 then here is an implementation tip. I would use a parallel fork in the workflow which does the wait and listens for the status change event (which can be configured using transaction BSVZ)). This way, as soon as the Service Order changes state, an even is raised and the workflow will terminate. This will prevent workflow from ?hanging around? unnecessarily.


Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us   



RELATED CONTENT
SAP workflow/webflow
How to send attachments in an SAP workflow item
How to configure SAP workflow clients
How to replace a cancelled SAP workflow item
Retrieving content from an SAP workflow attachment
Changing reserved status of a workflow item
Why you shouldn't change SAP-related workflows in an SWUI
Using change documents to update a Z table
Approving workflows from Outlook
Calling a custom workflow
Tools for enabling SAP screens on a BlackBerry

SAP workflow development
How to send attachments in an SAP workflow item
How to configure SAP workflow clients
How to do additional dialog processing after SAP COMMIT WORK statement
SAP TechEd Demo Jam 2009: Winners use beer keg in demo
How to replace a cancelled SAP workflow item
Retrieving content from an SAP workflow attachment
Changing reserved status of a workflow item
Why you shouldn't change SAP-related workflows in an SWUI
Finding BADIs you can use
Select Text fields: Case-insensitive

RELATED RESOURCES
2020software.com, trial software downloads for accounting software, ERP software, CRM software and business software systems
Search Bitpipe.com for the latest white papers and business webcasts
Whatis.com, the online computer dictionary



Search and Browse the Expert Answer Center
Search and browse more than 25,000 question and answer pairs from more than 250 TechTarget industry experts.
Browse our Expert Advice



SAP White Paper Topics
About Us  |  Contact Us  |  For Advertisers  |  For Business Partners  |  Site Index  |  RSS
SEARCH 
TechTarget provides technology professionals with the information they need to perform their jobs - from developing strategy, to making cost-effective purchase decisions and managing their organizations' technology projects - with its network of technology-specific websites, events and online magazines.

TechTarget Corporate Web Site  |  Media Kits  |  Site Map




All Rights Reserved, Copyright 2000 - 2010, TechTarget | Read our Privacy Policy
SearchSAP.com is a search service provided by TechTarget and is completely
independent of and not affiliated with SAP AG.
  TechTarget - The IT Media ROI Experts