Technology Blogs by Members
Explore a vibrant mix of technical expertise, industry insights, and tech buzz in member blogs covering SAP products, technology, and events. Get in the mix!
cancel
Showing results for 
Search instead for 
Did you mean: 
alejandroge
Discoverer
Sometimes we need to call a workflow process from our SAP ABAP programs and implementations in an easy form with Object Oriented Programming capabilities, but many times we found SAP business workflow implementations are Business Object Oriented and this way is too tricky and old fashioned for us.

Good news! SAP Business Workflow allows to be called through our own Event-Class with our own parameters without create a Business Object Repository. This example shows a simple way to call a workflow process from Event-Class into a Class Method or SAP ABAP Program.

  1. Create a reference to SAP Business Interface in our class (trx SE24). With this way we are able to use our SAP ABAP Class into SAP Business Workflow Event Containers. Please add the interface parameters below:



  • BI_OBJECT

  • BI_PERSISTENT

  • IF_WORKFLOW


Captura de pantalla 2017-08-27 a la(s) 12.10.27 p.m.

2. Create our event with parameters compatible with our Workflow Input Parameters.

  • EJECUTAR_WORKFLOW (Execute workflow): class event for launch our SAP Business Workflow.


Captura de pantalla 2017-08-27 a la(s) 12.12.49 p.m.

  • Event Parameters for EJECUTAR_WORKFLOW event.


Captura de pantalla 2017-08-27 a la(s) 12.16.03 p.m.

3. Binding our SAP Business Workflow object template (trx PFCT) to be launched by our SAP ABAP Event Class in Triggering Events and activate it (Green Button indicates event activation).

Captura de pantalla 2017-08-27 a la(s) 12.20.24 p.m.

  • Select ABAP Object Class and click Call Binding Editor ( Button Captura de pantalla 2017-08-27 a la(s) 12.22.26 p.m. ) and Bind our Event Parameters with Workflow Parameters (and save).


Captura de pantalla 2017-08-27 a la(s) 12.23.55 p.m.

4. Calling workflow from method-class. (Code Example).

  • Get our Event Container Workflow (a reference to our event container parameters).


Captura de pantalla 2017-08-27 a la(s) 12.35.43 p.m.

 

  • Set workflow Variables for Event (setting variables one by one with our values for launch our SAP Business Workflow).


Captura de pantalla 2017-08-27 a la(s) 12.36.14 p.m.

  • Calling Workflow Event Class (Raise our Event with our parameters).


Captura de pantalla 2017-08-27 a la(s) 12.36.26 p.m.

… And that’s all folks. With this way we can call our SAP Business Workflow from our SAP ABAP Class Method.

Enjoy it!
Labels in this area