SAP Workflow transaction SWO1 - Business object builder

SWO1 - Business object builder
Within transaction SWO1 you can maintain business object (create, change, display, copy, etc ). You can also test each business object by clicking on the test button then creating instance data (test data to be used as input values)

-Add to SAP business object
You can also add new methods, events, attributes etc to a standard SAP business object such as BUS1001006.

Step 1 - Create business object subtype
To do this simply execute transaction SWO1 and enter desired BO, then click the create Subtype icon and enter desired details on the create screen. Also ensure you don't create it as a local object and you provide a valid development package.


Step 2 - create new objects
Now simply click on the item in the tree you want to create a new one of i.e. attributes, methods, events etc and press create.
Once you have created your new object you need to activate it which is a bit of a long winded procedure, which involves clicking on the new object and performing the following functions in order.
• Edit->Change release status->Object Type->To implemented
• Edit->Change release status->Object Type->To released
• Edit->Change release status->Object Type Component->To implemented
• Edit->Change release status->Object Type Component->To release

Example of Adding new method to SAP business object
Choose the method tree branch and press the create icon. You will get the option to create the method from ABAP function module, this may work for some FM's but if they contain elements unsupported by business objects you will get and error. If you still want to base it on a function module select no and then go to the abap tab and enter it here. It will then use as much of it as it can.

Once the method is created press the program button to see the ABAP code and add more. You can use any ABAP code in here apart when you need to set or read the method parameters. This must be done using the following macros:
• swc_set_table container 'T_ROWS' it_rows.
• swc_get_table container 'T_ROWS' it_rows.
• swc_set_element container 'MATNR' ld_matnr.
• swc_get_element container 'MATNR' ld_matnr.

T_ROWS and MATNR = methods parameters
Ld_rows and ld_matnr = local variables declared in method

Once method is finished and you have followed the activation steps detailed above in step 2 the method is almost ready to be called from your workflow step.

Step 4 - Set delegate so your new subtype as the one to use
Within SWO1 goto settings->delegate and delete your new subtype to the business object. This then ensures any reference the BO will also any objects you have created in your new subtype.




Related Articles

SAP Workflow
SAP Workflow email reminders
Create SAP abap class for Workflow task fucntionality
Trigger SAP Workflow event from ABAP code
Add SAP Workflow event trigger
SAP Workflow event trace and diagnosis tools
Create basic SAP Workflow
SAP Workflow email reminders
Activate event linkages using SAP workflow transaction SWE2
SAP Workflow transaction SWEC to Trigger workflow on change document
SAP Workflow wizards
SAP Workflow development information