Skip to Content
Author's profile photo Former Member

Workflow on Material Change :Send workitem to the User’s Business Workplace on Metrial Change

Objective:Send workitem to the user’s Business Workplace on Material Change.

Purpose:Whenever a Material will change in MM02, a workitem will be sent to the creator of the material and the user who will change the material with the description ‘Material Property is changed from ‘’ to ‘’ ‘to their Business Workplace.

Business Scenario:Whenever a Material ‘Unit (MEINS)’ will change from MM02 a workitem will be sent to the creator of the material and the user who will change the material with the description ‘Material Property is changed from ‘’ to ‘’ ‘to their Business Workplace.

Process: This demo will involve the following steps:       

  • Copy the Standard BUS BUS1001 (Material) into custom ZBUS1001.
  • Create an Event ‘CHANGED’ for Change Material to trigger the Workflow.
  • Make an entry in SWEC for ‘Events for Change Document’ and put the Change doc. Object: ‘MATERIAL’ Object Type: ‘ZBUS1001’ and Event ‘CHANGED’. Select the radio button Trigger event ‘On Change’.
  • Go to SWDD and build a Workflow.
  • Create a Method to get changed Material data using a Function Module.
  • Create a Multiline Container Element to hold multiple Agents in lines.
  • Create a Method to get Agent from multiline container element.
  • Use Fork to send mail to users parallely.
  • Use that Multiline Container Element in Send Mail step to send work item to different users.

Prerequisites: It is assumed that the reader of the document has the knowledge of Change Document and Workflow builder.

(Many business objects are changed frequently, and these changes are logged into change documents to make the changes traceable. Change documents can be created for changes already made as well as for planned changes. Tables: CDHDR and CDPOS)

Step by step Approach:

1.      Go to SWO1 and copy the Standard BO: BUS1001 to custom ZBUS1001.


Create an Event ‘CHANGED’.


1.      Change Release status by navigate Edit ->Change Release Status -> Object Type Component -> To Implemented.

Then go to Edit ->Change Release Status -> Object Type Component -> To Released.


Go to Txn. SWEC to connect the Event with Change Doc. Object to trigger the workflow on change.



Go to SWDD and create a Workflow. Go to Basic Data and put Abbreviation and name for your workflow. Then Save it.


Go to Basic data -> Start Event. Put The Event CHANGED and Activate and Click on automatic binding to start Workflow.


1.      To get the Changed Data of Material we need to create a custom Method. Here we will create a Function Module to return the value of changed data.

Go to SE37 and provide the Function Module name.


Select the radio button Remote-Enabled to create a RFC enabled function module.


Put Import and Export parameters and select Pass By Value button for RFC-Enabled FM.



Write this piece of code to fetch data from Change Document tables: CDHDR and CDPOS. Source Code:





Save and Activate.

1.      Now Go to SWO1 and create a Method.

Create with Function module as template ‘Yes’.





Complete the full process and select Yes.


Now press the red button to generate the method successfully and follow the step 3 to release the component type method.

Now Create a Task from PFTC->Standard Task. Give a name to the task and put the method over here. Select Background Processing.


Click on Binding button and press Automatic Binding. Save the Task.


1.      Now go to SWDD and create an Activity step and put the Task over here.

Click on Binding and press Automatic Binding.



Make all workflow container element as import export parameter.

Now create another method to get agents. Here workitem would send to the two different user, one who created the Material and one who changed the material.

To achieve this functionality 1stcreate a multiline container element to hold Agents. Give SOXNA-FULLNAMEas ABAP dict. type.


Click on import, export and multiline and click on continue on Properties tab.

Now go to SWO1and create another method GETAGENT. Create two parameters MATNR as imp and IT_AGENT as export./wp-content/uploads/2014/09/28_538584.jpg

Click on Program and write down this piece of code.



Save and generate this method successfully. Next follow the step 3 to release the component.


Create another Task and give the method name over here. Click on Background Processing. Do Automatic Binding.


Go to SWDD and create another activity. Click Automatic Binding.



Now send workitem to the users parallel. To achieve this functionality use Fork. Parallel Branch ‘02’. Necessary branch ‘01’.


Create Send Mailstep to each branch. Pass the multiline container element IT_AGENT to the Recipients.


Click on Control tab and do necessary bindings. Click Transfer Graphic.



Now Your Workflow will look like this.


Finally go to Basic Data-> Start Event tab and do binding with Event container element Material’ with workflow container element ‘MATNR’ to start the workflow on ‘MATERIAL’ change. Activate the workflow.


Go to MM02Txn and make necessary changes. Workitem will be sent to two different users to their Business Workplace.



Assigned Tags

      You must be Logged on to comment or reply to a post.
      Author's profile photo Paul Bakker
      Paul Bakker


      Wow - thank you for this very detailed document. That would have taken a while to put together.

      In your first step, I'm wondering why you copied the BOR object instead of creating a subtype. When you 'subtype' you get the advantage of keeping the original object as well as adding whatever methods / events you wish. Best of both worlds.

      The code in the ZBAPI is a bit restrictive. You seem to be assuming that changes can only be made through transaction MM02. And what if there are multiple changes to the same material? I would add some selection/sorting by date.

      Good work - keep on posting!



      Author's profile photo Former Member
      Former Member
      Blog Post Author

      Thanks Paul for your valuable inputs.I would keep in mind your points.



      Author's profile photo manoj kedem
      manoj kedem

      very good document and very useful for beginners...

      Author's profile photo Former Member
      Former Member
      Blog Post Author

      Thanks Manoj....

      Author's profile photo Anjan Paul
      Anjan Paul

      Hi Rituparna,

          This is very good(valo) work. As mentioned by Paul BOR should be use usin delegation

      Author's profile photo Former Member
      Former Member
      Blog Post Author

      Thanks Anjan, you are Welcome 🙂

      Author's profile photo Bijay Kumar Barik
      Bijay Kumar Barik


      Really good documentation 🙂 . Thank you for all the time and effort.


      Biju K

      Author's profile photo Gaurang Gujar
      Gaurang Gujar

      Hello Ritupurna,

      That's a really very Nice Document.Keep Blogging and Posting.



      Author's profile photo Rick Bakker
      Rick Bakker

      Thank you for this very detailed document.

      Can you change the typo in the title?

      Author's profile photo Former Member
      Former Member

      Good job done.. This document is really loaded with steps and snapshots and also written in lucid language. 🙂

      Author's profile photo Cholen Tuna
      Cholen Tuna

      Hi Rituparna,

      Thanks for this wonderful document! I am trying to implement the same workflow and have been following the steps above. However, I am encountering errors on creating the GetAgent task in SWDD. If I change the left-handside values, I get "An object compatible with '[BO.ZBUS1001]' was expected as the source expression".

      I would think it's because the parameters in the method are object type ZBUS1001? Or maybe the task was not created properly? Can you please share any advise you may have? Thanks!




      Author's profile photo chao chen
      chao chen

      Great document,It's helpful to me,thanks for hard work.