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.
- 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(LOIPRO04) 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, these fields should be populated from IDoc(LOIPRO04) with fields ($placeholder).
- 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 E1AFFLL of ‘//IDOC/E1AFKOL’.
<customFieldDTOList> <customFieldDTO> <attribute>DATA_FIELD_SO_1</attribute> <value> <xsl:value-of select="//IDOC/E1AFKOL/E1AFFLL/E1AFVOL/VORNR"/> </value> </customFieldDTO> <customFieldDTO> <attribute>DATA_FIELD_SO_2</attribute> <value>I Will Be Displayed In DMC</value> </customFieldDTO> </customFieldDTOList>
- Check orders from ERP has these two fields populated.
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.
- 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_LOIPRO04_CUSTOMIZED_FLOW’.
The final step should be an ‘ProcessDirect’ adapter to ‘Receiver’, connection address set with value LOIPRO04_STD_SERVICE(from field ‘Standard Service Workflow’ under node ‘LOIPRO04_PRODORDER’), if you want implement all the functions that LOIPRO04_STD_SERVICE has, this step is not mandatory.
- Implement the logic for prepare the request to External systems, request the external system, and set retrieved values to custom data field.
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_LOIPRO04_CUSTOMIZED_FLOW'(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.
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,