Tuesday, 14 July 2015

Workflow : Demo9- Uses of CASE in Multiple Condition

--------------------------------------------------------------------------------------------------------------------------------
Check Link : Workflow : Demo3- Triggering work flow with class event

Post Summary : Using Multiple Condition CASE type in the work flow. User will provide a sales document number and from that we will get a sales document type like sales order, debit memo request, credit memo request , Inquiry or Quotation and then triggering a work flow. 
The sales doc type will be compared in the Multiple condition in the work flow and according a mail will be send to the user with a proper text.

Step1. Create a class in SE24 and implement the interface IF_WORKFLOW so that this class can participate in workflow.









 Create an event and maintain the exporting parameter.










Define a constructor with an importing parameter.














Implement other methods and provide below code.










 In this method trigger the event  which will start the workflow by passing the sales document type.


Step2.  Create tow container parameters. One which creates an instance of the triggering class and other is to hold the sales doc type passed from the triggering event.


















Move to the header of the work flow. Maintain the class event and the binding and activate it. Save and back to the  work flow home screen.

















 Double  click and select multiple condition.













 Provide condition as  CASE and a comparision  variable and a set of matching values and the outcome name.














For each output  create a send mail step and provide the subject text and body text as shown. 
Repeat the same step for each outcome of the multiple condition.























Activate the workflow.


Step3. Here we have some sales documents in VBAK table with different AUART type.




Step4. Small report program which reads a sales doc and trigger the workflow by event and passes the sales document type to the workflow.








Step5. Go To Tx- SWI1 and see the work flow graph log and observe which outcome line is processed.









--------------------------------------------------------------------------------------------------------------------------------

No comments:

Comments system

Disqus Shortname