Triggering work flow with class event


 

Step0. We have the structure.

 This structure has to be used in the class method.


Step1. Go to Tx- SE24 and create a class.

Step2. Provide the description and save.

 Step3. Go to the interfaces. 

Step4. To enable a class to trigger work flow, it has to implement interface IF_WORKFLOW. When it is implemented it also implements INTERFACE : BI_OBJECT and BI_PERSISTENT.

 
 Step5. In the attribute section define two attribute and one choose as key attribute.

Step6. In the Events section, define an event. Now goto methods section.

 
 Step7. Define constructor.

Step8. Define constructor importing parameter.

 
 Step9. Implement constructor method.


Step10. Do some coding.

 
 Step11. Create another method.

Step12. Implement the method.

Call the standard class CL_SWF_EVT_EVENT=>RAISE to raise event.

Step13. Now define the method FIND_BY_LPOR.

Step14. Put below code.

 
Step15. Now define method LPOR.

Step16. Put below coding.

All other methods of the class should be activated.

 
 Step17. So here Users : Tx- SBWP.

Step18. Go to the workflow header in Tx- SWDD.

Step19.  Here initially we triggered by business object event. Now we have to change with Class event.

Step20. provide the class, event and activate it.  Go Back.

 Step21. So here we have the final Work Flow.

Step22. Create a report and  call the method to raise the Class event.

 
 Step23. So here report output.

Step24. In Tx- SBWP we have received an email. Double click on it.

Step25. So its the mail body send by the work flow.

Step26. Go to Tx- SWI1 to see the work flow log.

 Step27. Select the work flow and see the log.

Step28. Click on the graphical view button.

 
 Step29.  The successful mail send step is displayed in the log.

 

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s