Applies to:
ERP 6 EhP5 – Master Data Governance for Supplier
Summary
This article provides implementation details for a simplified cross system Supplier On-boarding scenario leveraging SAP’s Enterprise Master Data Management portfolio consisting of SAP NetWeaver Master Data Management (available since 2004) and SAP Master Data Governance (currently in Ramp-Up). The overarching process is modeled using SAP NetWeaver Business Process Management.
Author(s):
Lars Rueter
Company : SAP AG, Germany
Created on: 4. March 2011
Author(s) Bio
Mr. Rüter works at SAP in the area of SAP Master Data Governance. In the past 11 years at SAP he has held different positions in Asia Pacific and EMEA. He has extensive experience in SAP's Master Data Management product portfolio, Java Development and SAP NetWeaver Portal. Mr Rüter has been involved in a large number of SAP implementations worldwide.
Cross system create supplier process
In our example we will build a cross-system supplier self-service registration and approval process. A supplier registers via a website and enters some initial data such as company name, street, city and postal code. These global attributes are stored in NetWeaver MDM for further distribution to Non-SAP systems. When the supplier is approved by the master data specialist a change request is automatically generated in SAP Master Data Governance. A workflow in SAP Master Data governance ensures that all ERP specific attributes are maintained. After final approval in SAP Master Data Governance the new supplier is activated and distributed. After activation a notification is send to the original requester.
Figure 1: High-level process overview
In figure 2 below you see which systems are part of the process:
- (A) SAP Master Data Governance – maintenance and distribution of ERP specific attributes
- (B) SAP NetWeaver MDM - maintenance and distribution of global attributes
- (C) NetWeaver CE – process runtime, process specific UIs, process worklist, web service consumption and provisioning
- (D) NetWeaver Developer Studio – process designtime
Figure 2: System Landscape
As mentioned above the process was implemented using NetWeaver BPM for the design and execution of the cross-system process. But we also leverage the out-the-box governance process in Master Data Governance for maintenance of ERP specific attributes.
Figure 3: Technical process overview
The figure above provides a more technical process overview using the Business Process Modeling Notation (BPMN) notation from SAP NetWeaver BPM:
- (1) The initial supplier registration web page triggers the start web-service of the BPM process
- (2) The global attributes from the registration web-page are used to create a new supplier record in SAP NetWeaver MDM
- (3) In this human interaction step a new supplier is being approved
- (4) BPM calls a SAP Master Data Governance Web Service to create a change request with the initial supplier data. This also triggers a SAP Business Workflow in SAP Master Data Governance.
- (5) This step in BPM is called an intermediate message event. The process waits for a message to come in from Master Data Governance before the flow commences. Early in the SAP Business Workflow process we have inserted a task to call BPM. In this call we transmit the ID of the change request.
- (6) BPM uses the change request ID from SAP Master Data Governance to send an e-mail to the original requestor. The e-mail contains a link to the SAP Business Workflow log. Using this link the original requestor can monitor the status of the change request in MDG.
- (7) After sending an e-mail the BPM process waits again for a message from SAP Master Data Governance. This time SAP Master Data Governance sends a message at the end of the SAP Business Workflow process and after the Supplier has been finally approved and activated. The message includes the final ID of the Business Partner in the primary persistence.
- (8) The last step in the BPM process informs the original requestor that the new Business Partner has been created and activated.
Implementation Steps
Integration between NetWeaver MDM and BPM has already been sufficiently documented on SDN. In this section the focus is on the integration between SAP Master Data Governance and NetWeaver BPM. Therefore we look specifically at the three integration points numbered step 4, step 5 and step 7 in figure 3 above. In step 4 we show how the inbound communication to SAP Master Data Governance was realized using a standard Web Service. The steps 5 and 7 are technically very similar in the sense that they both use a web service client proxy to transmit process status information from the SAP Business Workflow back to SAP NetWeaver BPM.
Using the inbound Business Partner Web Service
The ESR Web Service used to create a Business Partner in our scenario is called BusinessPartnerSUITEBulkReplicateRequest_In. In order to leverage this Web Service to automatically create a change request and key-mapping in SAP Master Data Governance , the method INBOUND_PROCESSING of BAdI MDG_SE_BP_BULK_REPLRQ_IN in Enhancement Sport MDG_SE_SPOT_BPBUPA has to be implemented.
IF_MDG_SE_BP_BULK_REPLRQ_IN~INBOUND_PROCESSING
METHOD if_mdg_se_bp_bulk_replrq_in~inbound_processing.
DATA ls_user_setting TYPE mdg_user_proxy_setting.
DATA lt_user_setting TYPE mdg_user_proxy_setting_t.
DATA lv_crtype TYPE mdg_sup_change_req.
if in-message_header-business_scope-id-content = 'BPM'.
ls_user_setting-field_name = 'PROXY_PERSISTANCE'.
ls_user_setting-field_value = '1'.
APPEND ls_user_setting TO lt_user_setting.
ls_user_setting-field_name = 'SUPPLIER_CHANGE'.
SELECT SINGLE usmd_creq_type INTO lv_crtype FROM usmd1601 WHERE usmd_process = 'SUP1'.
*
ls_user_setting-field_value = lv_crtype.
APPEND ls_user_setting TO lt_user_setting.
CALL METHOD cl_mdg_bp_bupa_si_in=>if_mdg_upload_proxy~setup_for_file_upload
EXPORTING
iv_instance = 1
* IO_UPLOAD_DIALOG =
it_user_setting = lt_user_setting.
endif.
ENDMETHOD.
The code first checks the scope-id-element in the message header. The SAP Master Data Governance load will only continue if the scope-id-element is set to BPM. The proxy implementation of the inbound service uses the context of the SAP Master Data Governance-file-upload-framework to determine how the incoming data has to be processed. We use the enhancement spot to set the file upload framework context in such a way that the incoming data is stored in the SAP Master Data Governance staging area and a change request of type SUPPL01 (Create Supplier) is being created. If key-mapping information was send as part of the Web Service call, the key-mapping for the new supplier will automatically be updated.
The ABAP code in the Enhancement Sport looks for the first process type SUP1 in table USMD1601 and takes the change request type from that line. In our example LRDEMO will be selected as change request type when the web service is called (refer to table USMD1601 in figure 4 below). You may have to adapt the ABAP code to ensure your custom change request type (as defined in the following section _ Customizing the governance process_) is correctly assigned in the Enhancement Spot.
Figure 4: Table USMD1601
An example XML document to test the web service is attached to this wiki.
Test your scenario – Inbound Web Service
You should now test if the implementation is working. Using a Web Service test tool such as the SAP Web Service Navigator you can call the Web Service. After successful execution you should find a new change request in the POWER -List (Personal Object Work Entity Repository). You can access the POWER-List via the supplier role in SAP Master Data Governance.
Customizing the governance process
Your Web Service is working? Good! Your inbound connection to SAP Master Data Governance is now ready. Next we need to establish the outbound connection to NetWeaver BPM. In our example we extend the governance process for create supplier by two additional SAP Business Workflow tasks. Each of the two tasks sends a message to NetWeaver BPM.
Since we do not want to modify the SAP delivered workflow template and change request type, we first create a copies.
Look up the id of the workflow template for Create Supplier: Open MDG IMG activity Create Change Request Type and find the row with change request type SUPPL01 (Create Supplier). In the same row you find the workflow template id for this change request type.
Open the Workflow Builder (transaction swdd) and create a copy of the SAP delivered workflow template for Create Supplier (use the workflow template id from the previous step). Do not forget to save and activate you new workflow template.
In MDG IMG activity Create Change Request Type create a copy of the SAP delivered change request type SUPPL01 (Create Supplier). Assign the new workflow template id from the previous step to the new change request. In our example we have created a custom change request type LRDEMO which is linked to workflow template WS99900008 (Firgure 5 below).
Figure 5: IMG activity Create Change Request Type
In MDG IMG activity Define workflow step numbers create a copy of the rows from the SAP delivered workflow template for the create supplier workflow template. In your copied rows change the workflow template id to the id of your custom workflow template.
Figure 6: IMG activity Define Workflow Step Numbers
To ensure the receiver determination will work for your new change request type enhance the BRF+ table GET_AGENT. Start transaction BRF+ and search for MDG as shown in figure 7 below.
Figure 7: BRF+ Search
Navigate to the GET_AGENT table as shown in figure 8. Create one row in the table for each workflow step. In column CREQUEST_TYPE enter the name of your custom change request type. In columns OTYPE and OBJID enter the object type (eg. user / organization) and corresponding value respectively.
Figure 8: BRF+ table get_agent
Test your scenario – custom change request type
This a good point to test your new change request type and workflow template. From the supplier role menu in SAP Master Data Governance choose the Create Supplier menu item. You should see your custom change request type in the drop down box of the create supplier screen. Select your custom change request type. Enter the new business partner details and approve the individual workflow steps until activation. At the end of the workflow you should have created a new Business Partner in the primary persistence. You can check by doing a search for the business partner id. You may have to change the receiver determination in BRF+ to ensure you can approve all the workflow steps.
Test your scenario – inbound web service with custom change request type
If you have confirmed that your new change request type and workflow template are working, repeat the test using the BusinessPartnerSUITEBulkReplicateRequest_In web service. Verify that after calling the web service a change request is created and the associated custom workflow is started. You can use transaction swud to find the workflow instance.
Exchanging process context information between SAP Business Workflow and NetWeaver BPM
In our example we decided to implement the exchange of process context information between NetWeaver BPM and SAP Business Workflow using asynchronous web services. In particular for exchanging the MDG change request id and business partner id. In NetWeaver BPM two Trigger Events were created (wsdl1, wsdl2) for this purpose. The consumption side is technically realized by generating an ABAP proxy for each service and calling this proxy from a task in the SAP Business Workflow. In step 5 (figure 3) we are using the Web Service call to transfer the change request-id to the SAP NetWeaver BPM context. In step 7 (figure 3) we transfer the business partner id after activation in the back end. After transferring the change request id step 5 (figure 3) we can use the change request id in NetWeaver BPM to generate an URL to the SAP Business Workflow log for this change request. We use this URL in our BPM process to send an e-mail notification to the original requestor with the link to the workflow log.
Generating a SAP Business Workflow log URL from a change request id in SAP MDG
https:// <HOSTNAME> : <PORT> /sap/bc/webdynpro/sap/usmd_crequest_protocol2?SAP-CLIENT= <CLIENT> &SAP-LANGUAGE=EN&CREQUEST= <insert the change request number here>
For sending the change request id to NetWeaver BPM a task was added after the Set Initial Status of Change Request task at the beginning of the workflow (figure 9). In the object method section of the task maintenance screen (figure 10) a custom class and method is selected. The called method calls the web service proxy to transmit the change request id. To be able to select your custom class from the workflow task it must implement the interfaces BI_OBJECT, BI_PRESISTENT and IF_WORKFLOW (figure 13). You can find more information regarding ABAP OO for workflow in the references section at the bottom of the article.
Figure 9: Create business partner workflow with custom task
Figure 10: Custom task maintenance
For sending the change request id to NetWeaver BPM a task was added after the Set Initial Status of Change Request task at the beginning of the workflow (figure 9). In the object method section of the task maintenance screen (figure 10) a custom class and method is selected. The called method calls the web service proxy to transmit the change request id. To be able to select your custom class from the workflow task it must implement the interfaces BI_OBJECT, BI_PRESISTENT and IF_WORKFLOW (figure 13). You can find more information regarding ABAP OO for workflow in the references section at the bottom of the article.
After successful activation of the Business Partner we can send the Business Partner Id to NetWeaver BPM. A new task was created after the Set Status of Change Request close to the end of the process (figure 11). In the task maintenance (figure 12) we assign a custom method that in turn uses the web service proxy to call NetWeaver BPM.
Figure 11: Create business partner workflow with custom task
Figure 12: Custom task maintenance
Figure 13: Interface tab of the class that gets called from the custom workflow task
Test your scenario – complete process
You can now call the inbound SAP Master Data Governance web service. In turn a change request will be created. The change request id will be transmitted to NetWeaver BPM. After approval and activation of the Business Partner the Business Partner id is transmitted to NetWeaver BPM. You can use transaction sxi_monitor to view incoming and outgoing messages.
NetWeaver BPM implementation considerations
While the focus of this article is not so much on NetWeaver BPM, but more on the interfaces of SAP Master Data Governance one important aspect with regard to intermediate message events in NetWeaver BPM should be mentioned here. In NetWeaver BPM it is necessary to define a message correlation between the incoming messages from SAP Master Data Governance and the process instance in NetWeaver BPM. Any unique id (eg. process id) can be used for this purpose. The unique id can be send as part of the BusinessPartnerSUITEBulkReplicateRequest_In web service call, for example in the message header. Subsequent calls from SAP Master Data Governance to NetWeaver BPM can then transmit this unique id as part of the message payload. NetWeaver BPM uses the unique id to find the right process instance for the incoming message.
Summary
In this article it was shown how SAP Master Data Governance can be used as part of a NetWeaver BPM cross-system master data process. The article also highlights how the capabilities of the build in governance processes can be easily extended using SAP NetWeaver BPM. The combination of SAP Master Data Governance with SAP NetWeaver BPM and SAP NetWeaver Master Data Management addresses a wide range of scenarios in the area of Enterprise Master Data Management.