Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 29

Containers.

It’s the location/variables to store/hold the data. It can be simple variables, structure , even objects of any
class. Elements required in the workflow are declared in the workflow container.

It can be of five types

1. Workflow container
2. Task container
3. Method container
4. Rule container

Binding

Exchange of data can be done through binding between two different container. Data can be flowed from
event container to workflow container , from workflow container to method container and so on.

Project : Here we will first learn how to create container elements and then one example to demonstrate
how to store data into database or how to interact with backend from Workflow.

How to create container elements.?

DC on the Create button present present in left panel of tcode SWDD.


Provide name of the container element to be created and type of that container element. It
can be simple data type or structure or it can refer to any Business object or class.
In the properties tab select the import and export parameters which means we can import
this variable from other container or we ca export this varaible to other container. It is
recommended to check both the checkbox.

In the initial tab provide the initial value which means we can assign any default value to the
container elements.
Now the variable /container element has got created and placed in left panel of Workflow
container.
RC on the undefined step and select create button. We are going to create one step called
User decision step.

Choose the User decision step from list of steps. This step is basically a dialog step which
requires user interaction to take the action. The action will be specified at design time. Once
this step is executed at run time one dialog work-item gets generated and get placed in user
inbox .
In title section provide the title which will be nothing but the subject line of the mail. We can
dynamic value set in subject by having & symbol placed in the title section. Once &1 is
placed , provide the binding of the container element in parameter section which will be
holding the dynamic value at run time .
Provide the agent who will be receiving the work-item in his/her inbox. Here workflow
initiator is being choosen so that the person who initiates the workflow will receive the
workitem. Also provide the action which you want the user to take.
Click on save button hence it will ask to provide abbreviation. It is to identify the worklfow
from list of workflows.
Once saved workflow gets created with one user decision step and two branches ( Approve
and Reject).

Go to Class tcode – Se24 and create one class.


Add the interface IF_Workflow in the interface section. This interface is added in the class
which has to be used in the workflow. Then only workflow will recognize the class. Once this
interface is added by default 6 methods get added in method section.
Create one method called SAVE_DATA in the method tab.

Create one parameter in the importing parameter.


Now go to table SE11 and create one table which will store the salesorder once gets
approved.
Now move back to SE24 method where you need to write the following code to save the
sales order into database table.
Now create the Activity step in Approve branch that will be responsible to save the sales
order into database.
Create the task by RC on display button beside Task.

Provide the abbreviation and object category as ABAP Class and object type as class
Name and provide the method to save the salesorder.
Now check the binding -> The flow of data should be from Task container to Method
container. i.e. the sales order which is approved should flow from Task container to method
container so that the method can take that data and save the same into database. Drag and
drop the elements to perform the binding.
Now flow the data from Workflow container to Task container. Thus the flow would be done
w.r.t Binding. ( worklfow container -> Task container -> Method container).
Now the activity step has got added in the approve branch.

Ow test the Workflow by clicking on Test button present beside the Activate button.Provide
the salesorder value.
Now go to SBWP , where the workitem will be present. Now execute the workitem.
Now look into the database , the record would have got stored into databse.
Go to SWIA to see the graphical log.
Now we understood how to flow the container element through binding and how the workflow interact
with Databse table.

You might also like