*Applies to:* ERP 6 EhP5 – Master Data Governance for Supplier h3. 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. h3. 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. h2. 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: 0.1. (A) SAP Master Data Governance – maintenance and distribution of ERP specific attributes 0.2. (B) SAP NetWeaver MDM - maintenance and distribution of global attributes 0.3. (C) NetWeaver CE – process runtime, process specific UIs, process worklist, web service consumption and provisioning 0.4. (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: 0.1. (1) The initial supplier registration web page triggers the start web-service of the BPM process 0.2. (2) The global attributes from the registration web-page are used to create a new supplier record in SAP NetWeaver MDM 0.3. (3) In this human interaction step a new supplier is being approved 0.4. (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. 0.5. (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. 0.6. (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. 0.7. (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. 0.8. (8) The last step in the BPM process informs the original requestor that the new Business Partner has been created and activated. h2. 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. h3. 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. | !http://wiki.sdn.sap.com/wiki/images/icons/emoticons/information.gif|height=16|alt=|align=absMiddle|width=16|src=http://wiki.sdn.sap.com/wiki/images/icons/emoticons/information.gif|border=0! | *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. | h3. 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. 0.1. 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. 0.1. 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).