Dear Colleagues,
In this blog post will try to introduce some of the Integration Extension scenarios between SAP S/4HANA and SAP Digital Manufacturing Cloud.
Before we we go in details about the Integration Extension, please make sure the standard integration configuration already done. Please follow
SAP Digital Manufacturing Cloud Integration Guide to setup configuration for integration.
Check Points:
- SAP Digital Manufacturing Cloud side:
HTTP destinations CPI_DESTINATION_IFLMAP and CPI_DESTINATION_TMN in DMC cockpit configured.
- Cloud Connector:
Add SAP Cloud Integration sub-account in Cloud Connector, and mapped virtual host to internal systems.
- SAP Cloud Integration side:
- Security Materials CF_AUTH and PD_DEPLOYER_USER configured.
- Package SAP S/4HANA Integration with SAP Digital Manufacturing Cloud copied, configure artifact 'Initial Parameters' and deployed, all required artifacts in package deployed.
- Destinations to virtual host(in step 2) configured.
- ERP side:
- HTTP destination configured with Transaction code SM59
- Logical system created
- Port created and associated with destination in step above
- Partner Profiles created and assigning outbound message types
Manage Integration Workflows App in SAP Digital Manufacturing Cloud:
Manage Integration workflows is an app in SAP Digital Manufacturing Cloud which can be used for customize SAP Cloud Integration behaviors by overriding the predefined workflow nodes.
For example, for Production Order(LOIPRO05) processing:
- If we want to change some fields values mapping rules or add customized fields, we can override the 'Standard XSLT' by put new XSLT mapping rules in field 'Custom XSLT'.
- If we need get some values from external systems for fields to DMC, we can override the node 'Standard Service Workflow' by specify new service workflow in field 'Custom Service Workflow'.
Custom scenario 1: Custom Fields
Customer want to extend some custom data for Shop Order, lets say they are fields DATA_FIELD_SO_1 and DATA_FIELD_SO_2 with label ShopOrderField1 and ShopOrderField2, the first field should be populated from IDoc(LOIPRO05) with value under xpath '
IDOC/E1AFKOL/E1AFFLL/E1AFVOL[1]/VORNR', the second field will set as fixed value 'I Will Be Displayed In DMC'.
Implementation steps:
- Define Custom Data for Shop Order in SAP Digital Manufacturing Cloud app 'Manage Custom Data'.
- Customize the XSLT mapping rules by copy the standard one.
- Uncomment the section 'customFieldDTOList' in shopOrderIn block.
- Create nodes and mapping rules for DATA_FIELD_SO_1 and DATA_FIELD_SO_2, see below screen capture for details.
- Save customized XSLT into field 'Custom XSLT' in SAP Digital Manufacturing Cloud app 'Manage Integration Workflows'.
Below is samples that DATA_FIELD_SO_1 populated with value from field VORNR in the first E1AFVOL of '//IDOC/E1AFKOL/E1AFFLL'.
<customFieldDTOList>
<customFieldDTO>
<attribute>DATA_FIELD_SO_1</attribute>
<value>
<xsl:value-of select="//IDOC/E1AFKOL/E1AFFLL/E1AFVOL[1]/VORNR"/>
</value>
</customFieldDTO>
<customFieldDTO>
<attribute>DATA_FIELD_SO_2</attribute>
<value>I Will Be Displayed In DMC</value>
</customFieldDTO>
</customFieldDTOList>
- Check orders from DMC has these two fields populated.
Detailed test steps, please refer below scenario below.
Custom scenario 2: Custom Service
Continue with the scenario 1, if customer want get values for DATA_FIELD_SO_2 from external systems. We need create a new iflow to retrieve values from external system and set it to the custom field dto.
Implementation steps:
- Login to SAP Cloud Integration tenant and navigate to Design section
- Create or Edit an existing package, and navigate into the package.
- Add an new 'Integration Flow' under 'Artifacts' tab
- Give name, id and description for the iflow.
- Edit the iflow to Implement the logic
The iflow should use 'ProcessDirect' as sender adapter, set Address as 'Z_LOIPRO05_PRODORDER_CUST_SVC'.
The final step should be an 'ProcessDirect' adapter to 'Receiver', connection address set with value LOIPRO05_PRODORDER_STD_SERVICE(from field 'Standard Service Workflow' under node 'LOIPRO05_PRODORDER'), if you want implement all the functions that LOIPRO05_PRODORDER_STD_SERVICE has, this step is not mandatory(By doing this, you can copy package 'SAP S/4HANA Integration with SAP Digital Manufacturing Cloud Templates', there are templates can be referred, or create the whole process by your own.).
- Implement the logic for prepare the request to External systems, request the external system, and set retrieved values to custom data field.
In my sample, I implemented a simple REST service that will return an random number less than 10000.
NOTE: When you call an external sytem, the request body in iflow will be replaced by the response body, so keep in mind save it before request and restore after response if you still need the original body.
- Save iflow and Deploy
- Set 'Custom Service Workflow' value as 'Z_LOIPRO05_PRODORDER_CUST_SVC'(from step 5) and Save.
- Test and Modify until everything works as expected.
For SAP Cloud Integration iflow develop, please refer
Getting Started with Integration Flow Development.
Conclusion:
With this post, you should already know how to do with Custom Data extension by overriding the XSLT file, and how to create a custom service iflow in SAP Cloud Integration to meet more complex requirements.
Thanks & Best Regards,
Wei