How to Create and Trigger Class Based Workflow from Web Dynpro ABAP – Part 4
How to create and trigger class based workflow – Part 3 Continue..
Now go to Methods tab of Main View and Double click on ONACTIONREGISTER Method.
Enter below Code in OnActionRegister Event.
ONACTIONREGISTER |
---|
method ONACTIONREGISTER . * Data Declaration for Employee Node * Data Declaration for Class DATA lr_wf_demo TYPE REF TO ZCL_WF_DEMO. * navigate from <CONTEXT> to <EMPLOYEE> via lead selection * get element via lead selection * getting Employee ID * Trigger Workflow CREATE OBJECT lr_wf_demo. lr_wf_demo->register_employee( exporting i_empid = lv_emp_id ). IF sy-subrc = 0. * report message ENDIF. |
( Refer How to create and trigger class based workflow – part 1 for quick code reference of class zcl_wf_demo )
Step 3: Create Application.
Save and Activate the Web Dynpro Component. Create the Web Dynpro Application and Save it.
Enter description and Click on Ok.
Save the Web Dynpro ABAP Application.
Result
Right Click on the Web Dynpro ABAP Application and click on Test.
Enter Employee ID and Click on Register.
Now we can see the success message.
Now go to SBWP Transaction and Click on Inbox.
Conclusion
Here I demonstrated a simple Web Dynpro ABAP Application which triggers Workflow. This helps to create ABAP Class, Workflow and Triggering Workflow from Web Dynpro ABAP as per Our Requirements.
Very Nice..
Good Work.....Very helpful
nice documents...very helpful to me...
Verry Nice Thank You,
i think i can need this...
Hello,
First of all thanks for such valuable info its really appriciable.
I did it step by step as shown in sceen shot but unfortunately it did not work
in my case .
For more clarification of my problem i have attached sceen shots.
Please help to sort out my problem.
Regards
Kumar.
1)
2)
3)
4)![]()
5)![]()
6)
Hello,
I am waiting for response if somebody help me out.
Thanks & Regards
Kumar
HI Kumar,
Please debug your register_employee method and check the emmp_id have correct transport into the workflow class.
Hi Kumar,
Try to change the level of method GET_EMPNAME to Static Method
Regards
Hi Kiran Kumar,
Kiran Kumar Valluru
I have got a question. Im doing custom workflow for SAP SRM ROS process. I have a workflow class as you mentioned, workflow template design as you mentioned, now i do want to trigger this workflow from a standard sap class (once after Save – Business partner). So can we implement the same webdynpro workflow trigger code to the post exit of the sap standard class?
Appreciating your help!
Thanks,
Rani.
Hello,
All you have to do is to raise the event as described in https://blogs.sap.com/2012/03/17/how-to-create-and-trigger-class-based-workflow-from-web-dynpro-abap-part-1/ (either OO event or the Function module mentioned).
Furthermore, use discussions section to get quick responses from fellow members.
Regards,
Kiran