To instantiate any Business object in a Workflow

By Swetabh Shukla, Infosys

1.       Go to SWDD and create a new workflow. This workflow will have two steps. This is just for test purpose so we are not going to define any triggering event etc.  First step will instantiate (creating a runtime object) a business object and second step will use that runtime object to execute one of its method. We know that to instantiate any BO we need the object key to be passed. Key uniquely identifies a runtime instance of Business Object (henceforth we will refer it as BO or business object interchangeably). 

Note: BO = ‘Business Object’ in all the references below. 

For example use BO BUS1001006. This BO is for Standard Material. Let us consider a material number ‘ZSHUKSWE20’ in this case. The method DISPLAY of BO can be used to display the material passed in key field of the BO BUS1001006. We will try to instantiate the BO for object key = ZSHUKSWE20 which is material number in current scenario. 

We will use Business Object SYSTEM and method GENERICINSTANTIATE to instantiate any Business Object in workflow.                 

The workflow template will look like this.


  1. Define a container element of Business Object type which you want to instantiate in a workflow.

We will define a container element of type business object BUS1001006. 


  1. Now Create an Activity type step and use Business Object SYSTEM and method GENERICINSTANTIATE.  This task will be background task since we don’t want any interaction with users.


Create the task from workflow builder directly.


In binding of the task with method pass variables objectkey and objecttype. These will be created automatically in Task container. The method will return runtime object in export parameter ‘OBJECTINSTANCE’.


Save the task and go back to workflow builder. 


Now create binding between TASK and workflow. Now here you can pass hard coded values for OBJECTKEY = Material Number and OBJECTTYPE = BUS1001006               

Save it and finally we have added a step which instantiates a business object. Let’s use this instance to display the material ZSHUKSWE20. This step will return runtime object of type ‘BUS1001006’ and key = ZSHUKSWE20.

Click here to continue...

Please send us your feedback/suggestions at webmaster@SAPTechnical.COM 

HomeContribute About Us Privacy Terms Of Use • Disclaimer • SafeCompanies: Advertise on SAPTechnical.COM | Post JobContact Us  

Graphic Design by Round the Bend Wizards

footer image footer image