Deadline is mot triggering
hi ,
im working on deadline.
i have given 5 min time as deadline time from WI CREATION option.
but the deadline is not triggering.even i checked the transaction SWWA ,there the interval upto next deadline is given as 3 min. so i ched up to 8 min for deadline . but still i did not get any deadline.
help me in this issue ..
Raghu
Hi raghu,
The working of the deadline monitoring also depends upon the background time configured by the administrator/basis people.
Example
If you have schedule the latest start of your workitem as 3 min at 16:00 hrs & the workitem is scheduled for 5 min.
For instance the last background time was carried out at 16:01 hrs.
Now you would expect that the workitem which is in waiting state should be in your inbox at 16:03 hrs but actually it would come to your inbox at 16:06 hrs when the next background job will be carried out.Till then the workitem which is in a ready state would wait for the background to be carried out.
Hope this helps.
Best of luck,
Bhumika
Similar Messages
-
Bpm block deadline branch not triggering
For some reason, in one of my environment, the bpm block step's deadline branch doesn't get triggered. I couldn't figure it out.
I setup a 1 minute limit and it never calls the deadline branch. Same thing works in my dev environment.
please help.lot of other forum links has information regarding this. i should have searched first.
-
Hi,
The process is that
A sales orders are getting created with the batch job once the sales order has been generate a Output type is triggers
and mail sents to customer about the order confirmation.
The medium os output type is "Send external" and dispatch type is "3 - Send with application own transaction"
Our problem is this output type has not getting triggered it in Yellow only.
if we change the dispatch time form 3 to 4 - Send immidetiatly then its working fine.
why this is happening?
how to resolve this so that there will be smooth operation with dispatch time as 3?
regards,
anupSee, you can process a message immediately by updating the application document or you can process it at a later time. For later processing you must use the report program RSNAST00 or a corresponding application function.
Thus there are some individual possibilities are:
Time 1: The message is processed through report program RSNAST00. This report program can be scheduled periodically or started manually.
Time 2: As in time 1, but the message contains an earliest processing date and a requested processing time. The message is ignored by report program RSNAST00 before the requested date.
Time 3: The message is selected and processed by application specific programs. Processing can take place online or in the background.
Time 4: The message is processed when the application document is saved. No further processing of the message is necessary.
So, check your communication method & transmission medium for dispatch time 3 for your requirement : A sales orders are getting created with the batch job once the sales order has been generate a Output type is triggers and mail sents to customer about the order confirmation. Check the output condition record maintained.
Also you can use user exit MV45AFZZ for automatic generation of email.
Hope this can assist you.
Thanks & Regards
JP -
Hi Experts,
I set the Deadline(Latest End - Work item Creation - Modeled) in the user decision but the deadline is not triggering at all. Please guide me to resolve this.
Thanks,
SrikagHi,
Check if the deadline has the correct data.\
Go tot the workflow log, click on the workitem with the deadline and view te technical data.
There you should be able to view the deadline dates.
Alternatively switch to technical workitem display and change the workitem.
Now you should be able to see the deadlines and change them to a more convenient time for testing purposes.
Kind regards, Rob Dielemans -
Hi Experts,
I have created a custom workflow which has a user decision step. We have used a rule for agent assignment and we have also maintained General task: can be edited by all users. We have implemented deadline monitoring for this step.
When we moved this workflow to QA, agent assignment (General task: can be edited by all users) was not transported.
Now when we executed the workflow, agent was not determined, but still deadline emails were triggered.
Is this correct ? Shouldnt the workflow go into an Error state as no agent was determined ?
Note: I know that we can transport agent assignment using RE_RHMOVE30.
Thanks.Requested start states , when the workitem must be sent to user's inbox, In Simple, it mentions after how much interval of time the workitem will in the user's inbox
In your case after 3 Mins of.... (check it) the workitem will be in the user's inbox,
and coming to Latest End , it is a grace period to user to act on the workitems, if user does not act on the workitem then this deadline is reached, in your case teh suer has give one day , if he does not act on the workitem with in one day the deadline is reached. -
Hi,
In my scenario I have configured a BPM where in, if message does not get processed for 25 mins then I have used a control step in the block to trigger alert.
I have noticed that the message crossed the deadline time and triggered the alert.
But the problem is I cannot reprocess that messages as SXI_MONITOR shows chequered flag without any errors.
For your information both message status and outbound status is chequered flag. Also there are no errors shown in the workflow.
Can anybody help me to reprocess such a message?
Regards,
Suraj Kumarhi Suraj
logically if you are getting alert then it should come into errot but You can check the status of your workflow as:
goto transaction sxmb_moni there in your message there is a field PE click on that u will be directed to workflow of your message in that there is an icon for technical view click on that u will get all technical details of your process as well as status of your workflo whether it is completed or in error
there you will find where your logic is getting failed
hope this may help you in solving your problem
Thanks
sandeep
PS reward with points if helpful -
hi ,
im using the task to trigger work item to a person and scheduled a deadline. but suddenly my connection to the server has lost.
again i have opened my inbox i could not be able to have the workitem in my inbox.
but the deadline is already triggered to another person regarding this work item.
in this case how to get the workitem in my inbox?
how these kind of scenarios are being handled ?
RaghuYou can check which are the workflow you have started from
SBWP->OUTBOX ->Started Workflows. There you will get the workflow and check this from the Workflow log by hitting the Wflow Log button.
Thanks
Arghadip -
I have BPM
Blok1
Send Async step: Acknowledgement: Transport
Exception brach: CannotInsert
Deadline brach: Throw Exception CannotInsert
Block2
Mapping
Send
<b>BPM Monitoring</b>
Mapping
Workflow System Background work item created 13:33
Workflow System Background Processing Started 13:33 tRFC Entries
Workflow System Work Item Processing Complete <b>14:02</b>
Workflow System Result Processing 14:02
When I click on mapping I see
Current Creation 13:33 Start 14:02 End 14:02
When deadline throws an exception mapping works ~ 30 min
I have the same problem in other BPM with deadline.
Could someone explain me what is wrong with my BPM?
Message was edited by: Sergey ASergey,
You can set different options for the deadline branch. You should choose 'Creating the step'. This will cause deadline branch being triggered after 30 minutes of creating the first block.
You can also select e.g. 'Creating the process', this will cause the deadline to be triggered 30 minutes after creating the process, whereever the process is at that moment.
Kind regards,
Christiaan Schaake. -
Hi all ,i need a good documentation for a beginner in WORK FLOW ?
hi all ,
i need a good documentation for a beginner in WORK FLOW ?
please,try to send the attached documents as much as u can apart from giving the weblinks ?
hope you will send it soon ....
thanks & regards
vishnuvardhan k.v.Hi
Developing a simple application using steps "User Decision" and "Mail"
Basic terminology used in the workflow:
The workflow definition is the set of rules that determine the path that the process takes. For example, how a purchase requisition is processed, from the initial request to the creation of the purchase order
A Workflow Instance, which is often simply referred to as the workflow, is a single workflow run. For example, the processing of a single purchase requisition for computers.
The Tasks are the steps in the process, which have to be performed either by people or automatically by the software. For example, to check for the availability of the spare computers in the company.
A Work item is the task instance that is performed as a single workflow step. For example, check that there are no spare computers available in the company.
Agents are the people who process the tasks (via the work items). For example, requisitioner and a member of the purchasing department.
Container is the place where all the data used in the workflow is collected.
Binding is the set of rules that define which data is passed to which part of the process.
Building a simple workflow application
The central tool for creating, displaying and processing a workflow is the workflow builder (Transaction SWDD). Within the workflow builder you can create all components of a workflow, including all the containers you need for getting the data from one step to another.
Generally, most of the workflows are started by an event (for example, when a material is created or when a new purchase requisition arrives). You define which data from this event needs to be passed to the workflow via binding.
However you can also start any workflow directly. Let us create a simple workflow and start the workflow directly, using the testing tools.
Call transaction SWDD. When the workflow builder is called for the first time, a newly created initial workflow definition appears or else last created workflow appears. In such cases you can opt to create a new workflow by pressing Create New Workflow(ctrl + shft + F5). The following screen appears.
The initial workflow screen has the following parts:
a. The start of the workflow definition, indicated by .
b. The end of the workflow definition, indicated by .
c. The area in which you insert the new workflow definition is indicated by .
Now select the undefined step and select Create step or double click the undefined step. Now among the different steps chose the User Decision by double clicking on it.
Developing a simple application using steps "User Decision" and "Mail"
Previous
Now enter the title for the user decision Please make a decision. Also enter the decision texts as Approve and Reject. On pressing enter, the outcome values default to the Decision texts but you can specify your own names, if desired. Now we need to select the agent. Agent is the person to whom the work item needs to be sent.. Since this is just a beginning, we would hardcode the user name. Select the User from the drop down list and enter the user name to whom the work item needs to be sent. In general, this type of agent assignment is not done. Agents are generally assigned using the expression, agent assignment rule or organization object (job, position etc.).
Now select Transfer and to graphic button. Following screen appears:
Now we need to include a mail step to be sent to the requestor. Now select the line Approve and do a right click. Different options on shown on the context menu. Select Create.
Now select the step Send Mail from the list.
Developing a simple application using steps "User Decision" and "Mail"
...Previous
Now enter the subject and the body of the message for the mail to be sent.
Do not change the recipients. Our mail is intended for the persons who triggered this workflow. &_WF_INITIATOR& contains the value who executed the workflow. Since this is a test object, we are using &_WF_INITIATOR&. But we wouldnt be using this variable in real time scenarios. We would discuss about this in the coming documents.
Now select Transfer and to graphic button.
A popup appears requesting for the abbreviation and the name for this task. Enter the same and press enter.
Now enter the package as local object and press enter.
Follow the steps 5 through 9 for the step Reject. The following screen appears:
Press SAVE to save the workflow application. You need to enter an abbreviation and name for your workflow as shown below. You can change any of these at any later point. After saving, a number is assigned to your workflow starting with WS, as shown below.
Developing a simple application using steps "User Decision" and "Mail"
...Previous
To execute the workflow, activate it by choosing the activate button.
Test the workflow by choosing Test. The following screen appears.
Now choose Execute to start the workflow.
Now the recipient would receive a work item in his SAP® inbox (Transaction SBWP).
Now execute the work item by pressing Execute. The following screen appears:
Choose one among Approve or Reject as part of the user decision. He can select the third option to retain the work item in his inbox and make the decision later. Now suppose that the recipient has chosen one of the first options. Now a mail would be sent to the requestor with the status of his request.
Creating a Container element
This document details about creation of a container element in workflow and using it in the step "Mail".
Pre-requisites:
It is assumed that the reader of this Tutorial is aware of creating a workflow definition with the step Mail. If not, please go through the document on creating the same available, by clicking here.
Steps:
1. Create a workflow definition using the transaction SWDD.
2. Lets create a container element for Carrier id. Click on the Workflow Container on the left side of the screen (as shown in the screenshot below):
3. Now double-click on Double-Click to Create
4. Enter the details pertaining to CARRID here.
5. Click on tab Properties and select Import.
6. Click on Confirm (Enter).
7. Now the element created could be seen on the left side, below the Workflow Container.
Creating a Container element
Previous
1. Create a Mail step by double-clicking on Undefined step in the workflow.
2. Enter the recipient details in the Recipients box.
3. In the subject line, enter Carrid value entered is: and click on Insert Expression.
4. Select the element Carrid from the list.
5. Similarly enter the content in the Body area.
6. Save and activate the application.
Testing the Workflow application:
7. Test the workflow by clicking F8.
8. Enter the value of the Carrid as shown above and press execute.
9. A mail would be sent to the recipient mentioned earlier with the carrid value entered.
Condition Step
Agenda:
This document details about the steps Condition.
Pre-requisites: It is assumed that the reader of this document has a preliminary understanding of workflow and has worked with the container elements earlier. If not, please go through the first two Tutorials of workflow available in this site. (More details)
Procedure:
1. Create a new workflow definition.
2. Create a container element, CARRID (as demonstrated in tutorial 2).
3. Now click on undefined step and create the step Condition.
4. Enter the step name of your choice.
5. We would have the following condition here:
If carrid = AA.
Do this.
Else.
Do this.
Click on Click here to create a new condition. Following screen appears.
Double click on Carrid. Next click on = and enter the value AA in the constant field and press ENTER.
Enter the outcome names of your choice as shown above.
Click on Transfer and go to graphic.
As shown above, there are two branches here. One navigates to true, if CARRID = AA else the control takes the branch False.
Test the above scenario by inserting mail steps in the above 2 branches and by passing different CARRID values.
Condition Step
Agenda:
This document details about the steps Multiple Condition.
Pre-requisites: It is assumed that the reader of this document has a preliminary understanding of workflow and has worked with the container elements earlier. If not, please go through the first two Tutorials of workflow available in this site. (More details)
Procedure:
1. Create a new workflow definition.
2. Create a container element, CARRID (as demonstrated in tutorial 2).
3. Now click on undefined step and create the step Multiple Condition.
4. Enter the step name of your choice.
5. We would have the following condition here:
If carrid = AA.
Do this.
Elseif carrid = AH
DO this.
Elseif carrid = SQ
Do this.
Else.
Do this.
Select the CARRID using the F4 help for the comparison basis field.
Enter the values of the carrid under the Comparison values with the corresponding outcome name (of your choice)
Double click on Carrid. Next click on = and enter the value AA in the constant field and press ENTER.
Click on Transfer and go to graphic.
As observed above, there are different branches for each value of CARRID mentioned above.
Test the above scenario by inserting mail steps in all the branches and by passing different CARRID values.
Using "Container Operation" step
Agenda: Usage of step Container Operation.
Pre-requisites: It is assumed that the reader of this tutorial has worked in the concepts that are dealt in earlier tutorials. (click here for more details)
Scenario: In this tutorial, we would deal about how to work with the step Container Operation with an example of calculating the available seats by subtracting occupied seats from the maximum seats at the workflow level.
Procedure:
1. Create a new workflow definition using the transaction SWDD.
2. Create two container elements MaxSeats, Occ_Seats with the import property set. You can use the reference fields sflight-seatsmax, sflight-seatsocc for this.
3. Create another container element AvailableSeats without setting either import or export property as this is calculated within the workflow and used within the workflow. You might use any of the above reference fields as data types.
4. Define a new step Container Operation in the workflow definition by double-clicking on the Undefined step.
5. In this step, we would calculate the available seats from the max seats and seats occupied.
I would recommend entering all the container elements from the F4 help instead of typing them manually.
6. Return to the main screen.
7. Create a mail step after this to send the available seats information.
8. Test the above functionality by passing some values to the maximum and the seats occupied.
9. Result would be as follows:
Triggering Events Programmatically
Purpose: This document details the procedure in triggering the business object events programmatically.
Pre-requisites: It is assumed that the reader of this document is aware of the business object concepts and good in ABAP.
Procedure:
In this document, we would take an example of the business object BUS1001006 (Material) and the event CREATED. In general, this event is triggered whenever a material is created using a standard procedure like MM01 or any others. Now we would trigger this event from our own programs.
Following are the screenshots of the business object BUS1001006 and the event CREATED. Go to transaction SWO1 for more information of the business object.
Double-clicking on the key field parameter gives you technical information of the field.
In order to trigger an event programmatically, we would use the function module SWE_EVENT_CREATE.
Following is the sample code to trigger the events programmatically:
REPORT ZDEMO_TRIGGER_EVENT.
DATA: KEY LIKE SWEINSTCOU-OBJKEY.
KEY = '1163'. Material Number (hard-coded)
CALL FUNCTION 'SWE_EVENT_CREATE'
EXPORTING
objtype = 'BUS1001006'
objkey = KEY
event = 'CREATED'
CREATOR = ' '
TAKE_WORKITEM_REQUESTER = ' '
START_WITH_DELAY = ' '
START_RECFB_SYNCHRON = ' '
NO_COMMIT_FOR_QUEUE = ' '
DEBUG_FLAG = ' '
NO_LOGGING = ' '
IDENT =
IMPORTING
EVENT_ID =
TABLES
EVENT_CONTAINER =
EXCEPTIONS
OBJTYPE_NOT_FOUND = 1
OTHERS = 2
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ELSE.
WRITE 'Event Triggered'.
ENDIF.
COMMIT WORK.
In order to test whether the event is getting triggered or not, we can make use of Event Trace. Switch on the event trace using the transaction SWELS.
Press Switch On.
Now execute the program developed earlier. Now switch-off the event trace using the same transaction SWELS.
Now go to transaction SWEL. Here you can list out the events triggered in the particular period of time. Here is the event-trace list:
Deadline Monitoring in SAP Workflow
A major advantage of workflow is the ability to monitor the workflow steps according to a predefined schedule. Following are different deadlines that can be monitored against each workflow step:
Requested Start
Latest Start
Requested End
Latest End
In this example, we will define a deadline to the User Decision example created earlier (click here). Following is the screenshot of the application developed using the User Decision example:
We would extend this example to the deadline monitoring.
In the User Decision step, click on the latest end tab.
By default, No deadline monitoring is active (as seen in the above screenshot).
Choose the Work Item Creation from the list box.
After selecting Work Item Creation, chose an offset of 5 minutes. This means that the work item must be executed within 5 minutes of the creation, if not this would trigger.
Deadline Monitoring in SAP Workflow
Enter recipient details to whom the message to be escalated, if the work item is not executed with in 5 minutes after work item creation.
Save and activate the workflow definition.
Testing the workflow application:
Execute your workflow.
Check for the work item in the SAP Inbox. This time do NOT execute the work item.
Wait for the deadline to be triggered. After that, a deadline message is delivered to the recipient mentioned in the Latest End tab. See the screenshot below.
Dont worry if the deadline message doesnt appear immediately after 5 minutes. This depends on various factors including how the deadline monitoring program is scheduled and also on the availability of the background processors.
Use SWWA to check how the deadline monitoring program is scheduled in program.
For example, assume that our work item has been created at 09:10 hrs and the deadline message is expected to trigger at 09:15 hrs. From the above screenshot, it is understood that the background program is scheduled to execute for every 3 minutes. Assume that the last run of the program is at 09:14hrs and the next run is expected at 09:17hrs. So even our deadline expires at 09:15, the deadline message would appear only at 09:17hrs after execution of the background program.
Some more points
In our above example, we have used the deadline on the Work Item creation time. i.e., 5 minutes after creation time, the deadline message would be sent. Now we would check the other option Expression. Here we can mention the date and time, when the deadline message should appear irrespective of the work item creation date/time.
As seen in the above screenshot, we can provide the target date and time by which the task should be finished. Container elements could be used in this case. Please refer to our example on creation of container elements (click here).
Personal Substitute in Workflow
Requirement: Need to have at least one substitute who can act upon work items in your absence.
Important: The appointed substitute would be able to see all your work items. A substitute cannot be assigned for only particular area of organization or any other item. So need to ensure that the substitute have the necessary authorizations to act upon the work items.
Procedure:
1. Go to SAP Business Work Place (TCode: SBWP)
2. Now from the menu bar, select Settings à Workflow settings à Maintain Substitute
3. Highlight/Select the name on the window, in this case SAPDEV02 and click on Create Substitute.
4. List of users available in the system are displayed.
5. Select the required substitute user name. Following screen appears.
Validity field describes about the period in which the setting would be active. Note that the dates on the screen would range from the current date to 31st Dec 9999.
Regarding the checkbox Substitution active, it is advised to leave this checkbox unchecked for system performance reasons. A check in this box indicates that the substitution is permanent and if left unchecked it is treated as as-needed. A permanent substitute will automatically receive the primary users work items in their own box. In the case of as-needed, substitute must manually adopt the work items from the primary users inbox.
6. Save the entries
7. Click Enter to leave the screen.
Adopting a Substitute in Workflow
If you have been designated as an as-needed substitute, you must manually adopt the substitution. If you are designated as a permanent substitute, the work items would automatically appear in the inbox.
Before adopting a substitution, there are 19 work items in the inbox. See the screenshot below:
To adopt a substitution, select Settings à Workflow settings à adopt substitution.
Select the corresponding User-id (if you have been assigned as a substitute for multiple people, then this option would allow you to select the user name of whom you would to check the work items)
The corresponding users work items would appear in our inbox now.
You can end the substitution, by selecting settings à Workflow settings à End substitution.
Note: Substitutes can only adopt work items that are directly routed to the person for whom they are a substitute. If you are a substitute for a user (SAPDEV02) who has been made a substitute for another user (SAPDEV01), you will only see work items for user SAPDEV02 and not of the user SAPDEV01.
Notification of Work Items via e-Mail
SAP provides us with a facility of notifying the user via the email address of your choice when there are any pending work items in the SAP Inbox..
1. Go to Transaction SO13.
2. Click on Automatic Forwarding tab.
3. Click on Create icon .
4. Enter the details in the above screen.
5. Click ENTER to complete the entries.
6. Now the notification would be received at the provided email address if there are any pending work items in the inbox.
Filtering the Work Items in the SAP Inbox using BADI
This document details about the procedure in filtering some of the work items from the SAP inbox using a BADi.
Following is the screenshot of the SAP inbox, before implementing BADi:
The BADi that is used in filtering the work items is WF_BWP_SELECT_FILTER. To implement the BADi, go to transaction SE18. From the menu, select Implementation à Create. (See the screenshot below)
Enter the implementation name and press ENTER
Enter any meaningful short text for the implementation and click on the tab Interface
The implementing class, ZCL_IM_BWP_SELECT_FILTER, is automatically proposed. Double click on the implementing class name.
You are now navigated to the class builder. Now double-click on the method name shown on the screen (see the snapshot below)
Now let us filter out the work items belonging to the task TS2000066. See the code below:
Activate the method and also the implementation. In the state of active, you wouldnt be able to make any changes. To make any changes, we need to deactivate it and then make the changes.
Now check the inbox and would notice that the work items related to that task are no more appearing.
To notice the differences, try activating and deactivating the BADi implementation.
Workflow tutorials with step-by-step and with screenshots are available at http://www.****************/Tutorials/Workflow/Workflow.htm
http://help.sap.com/saphelp_erp2005vp/helpdata/en/42/c14a9b55103116e10000000a1553f7/frameset.htm
http://help.sap.com/saphelp_erp2005vp/helpdata/en/c5/e4a930453d11d189430000e829fbbd/frameset.htm
http://www.sapgenie.com/workflow/
http://www.sap-img.com/workflow/sap-workflow.htm
http://help.sap.com/saphelp_47x200/helpdata/en/3d/6a9b3c874da309e10000000a114027/frameset.htm
http://help.sap.com/printdocu/core/Print46c/en/data/pdf/PSWFL/PSWFL.pdf
http://help.sap.com/saphelp_47x200/helpdata/en/4a/dac507002f11d295340000e82dec10/frameset.htm
http://www.workflowing.com/id18.htm
http://www.e-workflow.org/
http://web.mit.edu/sapr3/dev/newdevstand.html
http://www.sap-basis-abap.com/wf/sap-business-workflow.htm
https://forums.sdn.sap.com/click.jspa?searchID=791580&messageID=2857887
https://forums.sdn.sap.com/click.jspa?searchID=791580&messageID=2855919
https://forums.sdn.sap.com/click.jspa?searchID=791580&messageID=2735228
http://help.sap.com/printdocu/core/Print46c/en/data/pdf/BCBMTWFMSTART/BCBMTWFMSTART.pdf
http://help.sap.com/printdocu/core/Print46c/en/data/pdf/BCBMTWFMDEMO/BCBMTWFMDEMO.pdf
http://help.sap.com/printdocu/core/Print46c/en/data/pdf/BCBMTWFMPM/BCBMTWFMPM.pdf
http://help.sap.com/printdocu/core/Print46c/en/data/pdf/PSWFL/PSWFL.pdf
debug a workflow.
This has a step by step procedure :
http://fuller.mit.edu/workflow/debugging.pdf
www.erpgenie.com/sap/workflow/debugging.htm
http://www.erpgenie.com/workflow/debugging.htm?2b5de440 -
Customer master workflow - email
Hi WF Consultants,
I am New to WF, I did Practice on Examples which is available on net.
Now i am going to do my Objects....
I have requirement like ..
1) USER's are informed by de way of e-mail (MS-OUTLOOK) to other users whenever customer/vendor masters are created.
Please help me there are any standard T-code is there OR what are the <b>steps</b> i have to follow in this Object...
Points will be rewarded.
Thanks in advance...
Naresh KumarHi Naresh,
Check this info.
Developing a simple application using steps "User Decision" and "Mail"
Basic terminology used in the workflow:
The workflow definition is the set of rules that determine the path that the process takes. For example, how a purchase requisition is processed, from the initial request to the creation of the purchase order
A Workflow Instance, which is often simply referred to as the workflow, is a single workflow run. For example, the processing of a single purchase requisition for computers.
The Tasks are the steps in the process, which have to be performed either by people or automatically by the software. For example, to check for the availability of the spare computers in the company.
A Work item is the task instance that is performed as a single workflow step. For example, check that there are no spare computers available in the company.
Agents are the people who process the tasks (via the work items). For example, requisitioner and a member of the purchasing department.
Container is the place where all the data used in the workflow is collected.
Binding is the set of rules that define which data is passed to which part of the process.
Building a simple workflow application
The central tool for creating, displaying and processing a workflow is the workflow builder (Transaction SWDD). Within the workflow builder you can create all components of a workflow, including all the containers you need for getting the data from one step to another.
Generally, most of the workflows are started by an event (for example, when a material is created or when a new purchase requisition arrives). You define which data from this event needs to be passed to the workflow via binding.
However you can also start any workflow directly. Let us create a simple workflow and start the workflow directly, using the testing tools.
Call transaction SWDD. When the workflow builder is called for the first time, a newly created initial workflow definition appears or else last created workflow appears. In such cases you can opt to create a new workflow by pressing Create New Workflow(ctrl + shft + F5). The following screen appears.
The initial workflow screen has the following parts:
a. The start of the workflow definition, indicated by .
b. The end of the workflow definition, indicated by .
c. The area in which you insert the new workflow definition is indicated by .
Now select the undefined step and select Create step or double click the undefined step. Now among the different steps chose the User Decision by double clicking on it.
Developing a simple application using steps "User Decision" and "Mail"
Previous
Now enter the title for the user decision Please make a decision. Also enter the decision texts as Approve and Reject. On pressing enter, the outcome values default to the Decision texts but you can specify your own names, if desired. Now we need to select the agent. Agent is the person to whom the work item needs to be sent.. Since this is just a beginning, we would hardcode the user name. Select the User from the drop down list and enter the user name to whom the work item needs to be sent. In general, this type of agent assignment is not done. Agents are generally assigned using the expression, agent assignment rule or organization object (job, position etc.).
Now select Transfer and to graphic button. Following screen appears:
Now we need to include a mail step to be sent to the requestor. Now select the line Approve and do a right click. Different options on shown on the context menu. Select Create.
Now select the step Send Mail from the list.
Developing a simple application using steps "User Decision" and "Mail"
...Previous
Now enter the subject and the body of the message for the mail to be sent.
Do not change the recipients. Our mail is intended for the persons who triggered this workflow. &_WF_INITIATOR& contains the value who executed the workflow. Since this is a test object, we are using &_WF_INITIATOR&. But we wouldnt be using this variable in real time scenarios. We would discuss about this in the coming documents.
Now select Transfer and to graphic button.
A popup appears requesting for the abbreviation and the name for this task. Enter the same and press enter.
Now enter the package as local object and press enter.
Follow the steps 5 through 9 for the step Reject. The following screen appears:
Press SAVE to save the workflow application. You need to enter an abbreviation and name for your workflow as shown below. You can change any of these at any later point. After saving, a number is assigned to your workflow starting with WS, as shown below.
Developing a simple application using steps "User Decision" and "Mail"
...Previous
To execute the workflow, activate it by choosing the activate button.
Test the workflow by choosing Test. The following screen appears.
Now choose Execute to start the workflow.
Now the recipient would receive a work item in his SAP® inbox (Transaction SBWP).
Now execute the work item by pressing Execute. The following screen appears:
Choose one among Approve or Reject as part of the user decision. He can select the third option to retain the work item in his inbox and make the decision later. Now suppose that the recipient has chosen one of the first options. Now a mail would be sent to the requestor with the status of his request.
Creating a Container element
This document details about creation of a container element in workflow and using it in the step "Mail".
Pre-requisites:
It is assumed that the reader of this Tutorial is aware of creating a workflow definition with the step Mail. If not, please go through the document on creating the same available, by clicking here.
Steps:
1. Create a workflow definition using the transaction SWDD.
2. Lets create a container element for Carrier id. Click on the Workflow Container on the left side of the screen (as shown in the screenshot below):
3. Now double-click on Double-Click to Create
4. Enter the details pertaining to CARRID here.
5. Click on tab Properties and select Import.
6. Click on Confirm (Enter).
7. Now the element created could be seen on the left side, below the Workflow Container.
Creating a Container element
Previous
1. Create a Mail step by double-clicking on Undefined step in the workflow.
2. Enter the recipient details in the Recipients box.
3. In the subject line, enter Carrid value entered is: and click on Insert Expression.
4. Select the element Carrid from the list.
5. Similarly enter the content in the Body area.
6. Save and activate the application.
Testing the Workflow application:
7. Test the workflow by clicking F8.
8. Enter the value of the Carrid as shown above and press execute.
9. A mail would be sent to the recipient mentioned earlier with the carrid value entered.
Condition Step
Agenda:
This document details about the steps Condition.
Pre-requisites: It is assumed that the reader of this document has a preliminary understanding of workflow and has worked with the container elements earlier. If not, please go through the first two Tutorials of workflow available in this site. (More details)
Procedure:
1. Create a new workflow definition.
2. Create a container element, CARRID (as demonstrated in tutorial 2).
3. Now click on undefined step and create the step Condition.
4. Enter the step name of your choice.
5. We would have the following condition here:
If carrid = AA.
Do this.
Else.
Do this.
Click on Click here to create a new condition. Following screen appears.
Double click on Carrid. Next click on = and enter the value AA in the constant field and press ENTER.
Enter the outcome names of your choice as shown above.
Click on Transfer and go to graphic.
As shown above, there are two branches here. One navigates to true, if CARRID = AA else the control takes the branch False.
Test the above scenario by inserting mail steps in the above 2 branches and by passing different CARRID values.
Condition Step
Agenda:
This document details about the steps Multiple Condition.
Pre-requisites: It is assumed that the reader of this document has a preliminary understanding of workflow and has worked with the container elements earlier. If not, please go through the first two Tutorials of workflow available in this site. (More details)
Procedure:
1. Create a new workflow definition.
2. Create a container element, CARRID (as demonstrated in tutorial 2).
3. Now click on undefined step and create the step Multiple Condition.
4. Enter the step name of your choice.
5. We would have the following condition here:
If carrid = AA.
Do this.
Elseif carrid = AH
DO this.
Elseif carrid = SQ
Do this.
Else.
Do this.
Select the CARRID using the F4 help for the comparison basis field.
Enter the values of the carrid under the Comparison values with the corresponding outcome name (of your choice)
Double click on Carrid. Next click on = and enter the value AA in the constant field and press ENTER.
Click on Transfer and go to graphic.
As observed above, there are different branches for each value of CARRID mentioned above.
Test the above scenario by inserting mail steps in all the branches and by passing different CARRID values.
Using "Container Operation" step
Agenda: Usage of step Container Operation.
Pre-requisites: It is assumed that the reader of this tutorial has worked in the concepts that are dealt in earlier tutorials. (click here for more details)
Scenario: In this tutorial, we would deal about how to work with the step Container Operation with an example of calculating the available seats by subtracting occupied seats from the maximum seats at the workflow level.
Procedure:
1. Create a new workflow definition using the transaction SWDD.
2. Create two container elements MaxSeats, Occ_Seats with the import property set. You can use the reference fields sflight-seatsmax, sflight-seatsocc for this.
3. Create another container element AvailableSeats without setting either import or export property as this is calculated within the workflow and used within the workflow. You might use any of the above reference fields as data types.
4. Define a new step Container Operation in the workflow definition by double-clicking on the Undefined step.
5. In this step, we would calculate the available seats from the max seats and seats occupied.
I would recommend entering all the container elements from the F4 help instead of typing them manually.
6. Return to the main screen.
7. Create a mail step after this to send the available seats information.
8. Test the above functionality by passing some values to the maximum and the seats occupied.
9. Result would be as follows:
Triggering Events Programmatically
Purpose: This document details the procedure in triggering the business object events programmatically.
Pre-requisites: It is assumed that the reader of this document is aware of the business object concepts and good in ABAP.
Procedure:
In this document, we would take an example of the business object BUS1001006 (Material) and the event CREATED. In general, this event is triggered whenever a material is created using a standard procedure like MM01 or any others. Now we would trigger this event from our own programs.
Following are the screenshots of the business object BUS1001006 and the event CREATED. Go to transaction SWO1 for more information of the business object.
Double-clicking on the key field parameter gives you technical information of the field.
In order to trigger an event programmatically, we would use the function module SWE_EVENT_CREATE.
Following is the sample code to trigger the events programmatically:
REPORT ZDEMO_TRIGGER_EVENT.
DATA: KEY LIKE SWEINSTCOU-OBJKEY.
KEY = '1163'. Material Number (hard-coded)
CALL FUNCTION 'SWE_EVENT_CREATE'
EXPORTING
objtype = 'BUS1001006'
objkey = KEY
event = 'CREATED'
CREATOR = ' '
TAKE_WORKITEM_REQUESTER = ' '
START_WITH_DELAY = ' '
START_RECFB_SYNCHRON = ' '
NO_COMMIT_FOR_QUEUE = ' '
DEBUG_FLAG = ' '
NO_LOGGING = ' '
IDENT =
IMPORTING
EVENT_ID =
TABLES
EVENT_CONTAINER =
EXCEPTIONS
OBJTYPE_NOT_FOUND = 1
OTHERS = 2
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ELSE.
WRITE 'Event Triggered'.
ENDIF.
COMMIT WORK.
In order to test whether the event is getting triggered or not, we can make use of Event Trace. Switch on the event trace using the transaction SWELS.
Press Switch On.
Now execute the program developed earlier. Now switch-off the event trace using the same transaction SWELS.
Now go to transaction SWEL. Here you can list out the events triggered in the particular period of time. Here is the event-trace list:
Deadline Monitoring in SAP Workflow
A major advantage of workflow is the ability to monitor the workflow steps according to a predefined schedule. Following are different deadlines that can be monitored against each workflow step:
Requested Start
Latest Start
Requested End
Latest End
In this example, we will define a deadline to the User Decision example created earlier (click here). Following is the screenshot of the application developed using the User Decision example:
We would extend this example to the deadline monitoring.
In the User Decision step, click on the latest end tab.
By default, No deadline monitoring is active (as seen in the above screenshot).
Choose the Work Item Creation from the list box.
After selecting Work Item Creation, chose an offset of 5 minutes. This means that the work item must be executed within 5 minutes of the creation, if not this would trigger.
Deadline Monitoring in SAP Workflow
Enter recipient details to whom the message to be escalated, if the work item is not executed with in 5 minutes after work item creation.
Save and activate the workflow definition.
Testing the workflow application:
Execute your workflow.
Check for the work item in the SAP Inbox. This time do NOT execute the work item.
Wait for the deadline to be triggered. After that, a deadline message is delivered to the recipient mentioned in the Latest End tab. See the screenshot below.
Dont worry if the deadline message doesnt appear immediately after 5 minutes. This depends on various factors including how the deadline monitoring program is scheduled and also on the availability of the background processors.
Use SWWA to check how the deadline monitoring program is scheduled in program.
For example, assume that our work item has been created at 09:10 hrs and the deadline message is expected to trigger at 09:15 hrs. From the above screenshot, it is understood that the background program is scheduled to execute for every 3 minutes. Assume that the last run of the program is at 09:14hrs and the next run is expected at 09:17hrs. So even our deadline expires at 09:15, the deadline message would appear only at 09:17hrs after execution of the background program.
Some more points
In our above example, we have used the deadline on the Work Item creation time. i.e., 5 minutes after creation time, the deadline message would be sent. Now we would check the other option Expression. Here we can mention the date and time, when the deadline message should appear irrespective of the work item creation date/time.
As seen in the above screenshot, we can provide the target date and time by which the task should be finished. Container elements could be used in this case. Please refer to our example on creation of container elements (click here).
Personal Substitute in Workflow
Requirement: Need to have at least one substitute who can act upon work items in your absence.
Important: The appointed substitute would be able to see all your work items. A substitute cannot be assigned for only particular area of organization or any other item. So need to ensure that the substitute have the necessary authorizations to act upon the work items.
Procedure:
1. Go to SAP Business Work Place (TCode: SBWP)
2. Now from the menu bar, select Settings à Workflow settings à Maintain Substitute
3. Highlight/Select the name on the window, in this case SAPDEV02 and click on Create Substitute.
4. List of users available in the system are displayed.
5. Select the required substitute user name. Following screen appears.
Validity field describes about the period in which the setting would be active. Note that the dates on the screen would range from the current date to 31st Dec 9999.
Regarding the checkbox Substitution active, it is advised to leave this checkbox unchecked for system performance reasons. A check in this box indicates that the substitution is permanent and if left unchecked it is treated as as-needed. A permanent substitute will automatically receive the primary users work items in their own box. In the case of as-needed, substitute must manually adopt the work items from the primary users inbox.
6. Save the entries
7. Click Enter to leave the screen.
Adopting a Substitute in Workflow
If you have been designated as an as-needed substitute, you must manually adopt the substitution. If you are designated as a permanent substitute, the work items would automatically appear in the inbox.
Before adopting a substitution, there are 19 work items in the inbox. See the screenshot below:
To adopt a substitution, select Settings à Workflow settings à adopt substitution.
Select the corresponding User-id (if you have been assigned as a substitute for multiple people, then this option would allow you to select the user name of whom you would to check the work items)
The corresponding users work items would appear in our inbox now.
You can end the substitution, by selecting settings à Workflow settings à End substitution.
Note: Substitutes can only adopt work items that are directly routed to the person for whom they are a substitute. If you are a substitute for a user (SAPDEV02) who has been made a substitute for another user (SAPDEV01), you will only see work items for user SAPDEV02 and not of the user SAPDEV01.
Notification of Work Items via e-Mail
SAP provides us with a facility of notifying the user via the email address of your choice when there are any pending work items in the SAP Inbox..
1. Go to Transaction SO13.
2. Click on Automatic Forwarding tab.
3. Click on Create icon .
4. Enter the details in the above screen.
5. Click ENTER to complete the entries.
6. Now the notification would be received at the provided email address if there are any pending work items in the inbox.
Filtering the Work Items in the SAP Inbox using BADI
This document details about the procedure in filtering some of the work items from the SAP inbox using a BADi.
Following is the screenshot of the SAP inbox, before implementing BADi:
The BADi that is used in filtering the work items is WF_BWP_SELECT_FILTER. To implement the BADi, go to transaction SE18. From the menu, select Implementation à Create. (See the screenshot below)
Enter the implementation name and press ENTER
Enter any meaningful short text for the implementation and click on the tab Interface
The implementing class, ZCL_IM_BWP_SELECT_FILTER, is automatically proposed. Double click on the implementing class name.
You are now navigated to the class builder. Now double-click on the method name shown on the screen (see the snapshot below)
Now let us filter out the work items belonging to the task TS2000066. See the code below:
Activate the method and also the implementation. In the state of active, you wouldnt be able to make any changes. To make any changes, we need to deactivate it and then make the changes.
Now check the inbox and would notice that the work items related to that task are no more appearing.
To notice the differences, try activating and deactivating the BADi implementation.
Hope this resolves your query.
Reward all the helpful answers.
Regards -
Deadline after triggering an email to the customer // starting report
Hello Workflow Experts,
im new to creating workflows an i have an idea what i want to do but i havn't the skills, i hope you can help me.
I use the BUS2032-salesorder
My idea:
If my customer has false master data I send him an e-mail via "send mail" step an ask him for correct data. Now the customer has 2 weeks to answer on this mail. If he answeres in the times i will trigger a step where i want to change the master data BUS2032.ChangeFromData1. If the customer give me no answer after 2 weeks i will delete its master data from the system (BUS2032.delete).
How to do this? I need the time were the workitem "send mail" was startet. How can i get this time? Then i need any activity which creates a workitem if the mail of the customer received. And i need a condtion which compares the actual time with the time of creating the "send mail" workitem. How to get this in one worklfow and which attributes of the workflow container do i need?
Besides i want to trigger my own z_report out of my workflow, how to do this?
thank you for your help
Edited by: S.Simon89 on Aug 16, 2011 11:41 AMHello,
You really should take a workflow course or at least read the workflow book (www.workflowbook.com)
You wouldn't be sending the user an email, you would be sending him a workitem. You can set a latest end deadline (of e.g. two weeks) on the workitem. In the workitem you can direct him to a transaction where he can fix his data. If it expires you then have a step which calls a task which calls a method which executes your report. All very simple in workflow!
regards
Rick Bakker
hanabi technology -
Hi Folks,
I have done every setting in Swu3 and initally deadline for work flows use to trigger, But however for a strange reason they stopped Trigerring deadlines. please help me in trigerring the deadline since there are some work items need to go into deadline scheduling.
Thanks and Regards,
Krishna MukthineniCheck the deadline job if it is still running, sometimes it may have got struck.
Regards, IA -
Will the reserved work item triggers deadline?
hi,
im working on DMS workflow for the transaction CV02N.
when i got the work item , i have double clicked and it has taken me to cv02n transaction.
i did not do any thing in the transaction and came to my business workplace with out saving any thing .
now the work item status is RESERVED.
are these kind of reserved work items are able to trigger deadlines if i mention simple deadline for the work item?
RaghuHi Agardeep,
i have to use deadline with latest end tab for my scenario.
so, do this reserved work items are able to trigger deadlines for latest end?
please suggest
Raghu -
Action with start condition always triggers
Functionality required: "when its 4 days from the actual date an
Audit is to take place an e-mail should be triggered to the
audit attendees"
I have created a new date rule (4 days before - reminder) and
added this date rule to the date profile 000000000003. I am
using this date profile in my actions and have set a new start
condition to trigger an e-mail alert when "todays date" = my new
date rule. I have set up scheduled conditions which are met.
when i create transactions which meet both the scheduled and
start conditions (from my perspective) the action is getting
triggered to send the e-mail reminder. My new date rule is as
follows:
<?xml version="1.0"?>
<TimeRule>
<TimeRuleSource>
<ruleline>
<AssignTimeExp displaytype="AssignTime">
<VarTimeExp displayType="VarTime"
name="RESULT"
position='B'>
<VarObjectExp displaytype="VarObject"
name="SYSTEM"/>
</VarTimeExp>
<MoveTimeExp displaytype="MoveTime" direction="-">
<VarTimeExp displayType="VarTime"
name="ORDERACTUAL"
position="B">
<VarObjectExp displaytype="VarObject"
name="SYSTEM"/>
</VarTimeExp>
<ConstDuraExp displaytype="ConstDura"
duration="4" timeunit="DAY">
<VarObjectExp displaytype="VarObject"
name="SYSTEM"/>
</ConstDuraExp>
</MoveTimeExp>
</AssignTimeExp>
</ruleline>
</TimeRuleSource>
When i test it using various dates it seems to work as expected, it returms false when it should fail and true when it should suceed When tested from within the date rule for the FROM and TO date for todays dates i get the following:
Deadlines
Appointment Type RESULT
From SA 10.02.2007 14:27:52 GMTUK
From
Appointment Type ORDERACTUAL
From WE 14.02.2007 14:27:52
To WE 14.02.2007 14:27:52
Duration
Reference Objects
SYSTEM GMTUK CL_TIMECALENDAR_SIMPLE
In my start condition i am testing for my date rule (4 days
before - reminder) = todays date.
Can anyone explain why my start condition is always being triggered
Thanks in advance
EdHello Easwar Ram,
Thanks for your reply.
No, I didn't create an Action Profile. I use standard profile: /SCWM/TU (Shipping & Receiving - Transportation Unit).
I only have created a new Action Definition, Schedule and Start Conditions for this Definition. All work correctly with the exception of the button 'Start Condition Parameter'.
I don't know why the button appears because I didn't define a Condition Parameter for the Start Condition. And when I click on this button I get an error in standard SAP code:
1) li_bor_object ?= l_context->appl.
2) ls_bor_handle = li_bor_object->get_bor_object( ip_objtype = l_objtype ).
L_context->appl has value '' in the debugger. After line 1 the value of the li_bor_object is '' therefore line 2 terminates the transaction with error.
Maybe this occurs because the Action Profile uses a Persistent Class for Object Type instead of a Business Object Repository? -
Error in triggering background job
HI, I've been facing an error which a background job is being scheduled. The scenario is something like this ...
1) A third party schedulling system triggers a SAP job and monitors the progress
2) In SAP, the master job is been copied with a different user name and then released for processing.
3) There are multiple jobs which get triggered but there is one job which is causing a problem.
4) The job makes a copy an stays in a scheduled status without getting released. While i try to manually release the job it give me an error that cannot create record in the database.
5) Upon checking the system log it gives me this - Error: INSERT background sched. table(job $$$$).
There is already an entry for the specified job in the table TBTCS.
6) While checking the TBTCS table i've found multiple entries out there. Should this table be empty or have information about the runtime of this job.
Please help as this background job is causing concerns in archiving processess defined.
Thankx in advance for your help.
Arvind.the earlier problem of background job was solved by changing the output device assigned to user wf-batch .
regarding the transport request :
when i was trying to execute the step : "Schedule bakgrd for missed deadlines " MANUEL it was giving me an option of SAVE AND SCHEDULE . which was creating the transport request . but when i executed it automatically it worked fine without asking a request to me ... i don't know why )-: ... probablly we can specify a different interval then the standard of three minutes and which will be transported (it's just a guess) . i have executed it automatically ...
well thanks all for u r help
Maybe you are looking for
-
hai, Suppose itab is having 10 records, Write what will be the output of Loop at itab. if sy-tabix between 1 and 5. write: /sy-index. else if : sy-index between 6 and 10.
-
Ethernet connected Apple TV 3 can't play content. WiFi works fine. What gives?
Apple TV 3 has a strange problem since the latest update, 5.1. It is only partially functional when hard wired to my router, but is fully functional when connected wirelessly. When hardwired, I can control it with the iOS Remote app, airplay from iP
-
Import extremely slow from 9i to 10G
I am preparing a 10.2.0.4 database for testing, (upgrading from 9i) because we are also moving to a new server, I am going to use the exp/imp method. I created a new database after installing and patching the software, then created the necessary tabl
-
How to recover an iphoto book from backup
Hello, My wife managed to accidentally delete a 75 page iphoto book she's been working on for months. I have a backup of our iphoto library at an offsite location (read: not a time machine) and am in the process of transferring a copy of it to my lo
-
Hi, I have a main sequence file with 5 steps each of sequence call type. I use the multi threading option to generate individual reports for each of the sequences in the sequence call. I configured the report options call back for the main sequence.