Menu
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.
The ABAP code below is a full code listing to execute function module SAPWAPISTARTWORKFLOW including all data declarations. The code uses the latest in-line data DECLARATION SYNTAX but I have included an ABAP code snippet at the end to show how declarations would look using the original method of declaring data variables up front. Oct 07, 2012 Create a simple SAP Workflow and then initiate it via a custom Web Dynpro for ABAP app. It is recommended then you first view part 2 and part 3 of my SAP Tutorial series. See all SAP Tutorials. May 08, 2019 How To Call Workflow From Abap Program Sap Rating: 3,9/5 2436 votes I am developing in ABAP.I have a requirement to trigger a custom event in an ABAP Z-program.Can anyone pls tell me how can I call a custom event in a Z-program to send an email.(please note: It is not workflow, I need to complete this task in the Z-program). Calling another program from list in ABAP. Sometimes we require to call another ABAP program from a current running ABAP program ( list ). Here we are going to check the available methods for that. Trigger SAP Workflow event from ABAP code Trigger Event from ABAP code In order to trigger an event from within any ABAP code simply call function module SWEEVVENTCREATE.
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.
- 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
2. Create our event with parameters compatible with our Workflow Input Parameters.
- EJECUTAR_WORKFLOW (Execute workflow): class event for launch our SAP Business Workflow.
- Event Parameters for EJECUTAR_WORKFLOW event.
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).
- Select ABAP Object Class and click Call Binding Editor ( Button ) and Bind our Event Parameters with Workflow Parameters (and save).
4. Calling workflow from method-class. (Code Example).
- Get our Event Container Workflow (a reference to our event container parameters).
![Call Call](/uploads/1/2/9/4/129447329/122057970.png)
- Set workflow Variables for Event (setting variables one by one with our values for launch our SAP Business Workflow).
How To Call Workflow From Abap Program Sapporo
- Calling Workflow Event Class (Raise our Event with our parameters).
… And that’s all folks. With this way we can call our SAP Business Workflow from our SAP ABAP Class Method.
How To Call Workflow From Abap Program Sapphires
Enjoy it!