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!
Showing results for 
Search instead for 
Did you mean: 
Active Contributor

In the first part How to create and trigger class based workflow - part 1, we have seen creating a class using IF_WORKFLOW interface. Now we will see, how to create workflow.

Creating Workflow

Step 1: Creating Workflow.

Go to SWDD Transaction and click on Create button to create new Workflow.

Step 1.1: Creating Attributes.

Under Navigation Area Work flow container will be selected, If not select Work Flow container as shown below.

Under Workflow Container double click to create as shown below.

Enter Element Name, Description and select the created class.

Under Properties Tab select import, export and click on Ok.

Now Double click again to create emp_id Element which stores the Employee ID.

Enter attribute name, description and enter type as shown below.  You can enter the data type directly by selecting ABAP dict. Data type.

Under Properties tab check import, export and click on Ok.

Similarly create one more attribute emp_name to store Employee Name.

Under Properties tab check import, export and click on Ok.

Click on Save and Save the Work flow.

Step 2: Registering Start Events for Workflow.

Click on basic data (hat symbol) as shown below.

Go to Start events Tab and select Category as CL (ABAP Class), Enter Class Name and Enter Event Name (you can select event from F4 help) as shown below.

Step 2.1: Binding Business Object Attributes to Workflow Attributes.

Click on binding as shown below

Here binding generated automatically with the matching types, if you don’t see this binding, bind manually by drag and drop from Class container to Workflow container.

Now you can see empid of Business Object is mapped with emp_id of Workflow Container. Click on OK.

Step 2.2: Activating Start Event for Workflow

  Click on Activate as shown below.

Once activated it turns to green.

This means once the REGISTERED event of Class ZCL_WF_DEMO is triggered, the Workflow will Start.

Click on Save and go back to main screen.

Step 3: Creating Task 

Double Click on the Undefined Step as shown below.

Select Activity Step and click on Ok.

Click on Create Task as shown below.

Enter abbreviation, Name. Under Object method, select Object category as ABAP Class. Enter Class Name and Method Name (You can select method from F4 help) as shown below.

Select the check box 'Synchronous object method'. ( If you don' t select the 'Synchronous' , for Asynchronous method you need to maintain the Terminating Events, In terminating events select the element _WI_OBJECT_ID and select the event name using F4 )

Under Execution Select Background Processing, since no user interaction is required for our scenario.

Click on Save and Click on Back Button.

It will prompt to Transfer missing elements. Click on Yes. (You can also click on No and create elements manually).

Now Click on Ok.

Continuing in next part How to create and trigger class based workflow - part 3 ( as the maximum no.of images reached )..

Labels in this area