Modifying Custom Integration Flows and Custom Data Fields

Objectives

After completing this lesson, you will be able to:
  • Examine and modify workflow configuration for both inbound and outbound interactions.
  • Identify workflow XSLTs.

Manage Integration Workflows

The Manage Integration Workflows app allows you to examine and modify the workflow configuration for both inbound and outbound interactions by adjusting the XSLT of the workflow. Background workflows facilitate the transformation and transportation of messages to targeted systems. Configuration data for these parameters predominantly resides in the SAP Cloud Integration. This app, however, enables you to directly configure parameters on the integrative side.

Workflow Types

The image shows an Integration Workflows screen in the SAP software system. It displays a table listing various workflow items, such as Web Center Download (LDWCS02), Material Download (MATMAS03), and BOM Download (BOMMAT04). For each workflow item, the table provides a description of what the workflow does. For example, the Web Center Download (LDWCS02) workflow Works center download using LDWCS02 IDoz, while the BOM Download (BOMMAT04) workflow downloads a bill of materials (BOM) using the BOMMAT04 transaction. The table also shows the direction of data flow for each workflow, which is Inbound for all the listed items, suggesting data is being imported or received into the system through these workflows.

As shown above, there are two types of predefined workflows, which can be separated in the Manage Integration Workflows app:

  1. Inbound workflows
  2. Outbound workflows

Inbound Workflows

Inbound workflows in SAP Digital Manufacturing are triggered by inputs or requests from external sources, such as production orders from SAP ERP, material requirements, or quality control notifications. Some examples of inbound workflows include:

  • Several master data downloads, for example, Work Center Download
  • Inventory Download
  • Production Order Download

Outbound Workflows

Outbound workflows in SAP Digital Manufacturing are triggered by the completion of production activities or the generation of output data, such as finished goods, quality control results, or production performance metrics. Examples of outbound workflows include:

  • Order Complete
  • Production Order Yield Conformation
  • Inventory Scrap/Return

Each of those integration workflows has a standard XSLT, for example, for the Production Order Download.

Workflow XSLTs

Standard XSLTs

The image shows a screenshot of an SAP interface for managing integration workflows, specifically the Production Order Download (LOIPRO05 V2) workflow configuration. The interface displays fields for configuring the service, with sections for General Configuration, Service Configuration, and Error Handling Configuration. In the Service Configuration section, there are two text fields labeled Standard XSLT and Custom XSLT. Each field contains XML-like code snippets. The Standard XSLT appears to define an XSLT transformation using an xsl:stylesheet element with various parameters. The Custom XSLT field is similar, but appears to allow customization of the XSLT transformation. The purpose of these XSLT configurations seems to be defining how data is transformed or mapped between different formats during the Production Order Download workflow integration process within the SAP system.

Each of the integration workflows has a standard XSLT, for example, for the Production Order Download. If you need to adapt the workflows, there is a possibility to make use of a custom XSLT.

Custom XSLTs

The image shows a SAP application interface titled Manage Integration Workflows. On the left side, there is a list of several workflow items such as All, Inbound, and Outbound. The panel on the right displays an open dialog box labeled Production Order Download (LOIPRO05 V2). This dialog contains XML configuration code divided into three tabs: General Configuration, Service Configuration, and Error Handling Configuration. The code snippet visible specifies settings related to manufacturing orders using XML tags and attributes. Overall, the interface allows configuring integration workflows, with the current view focused on downloading production order data and its associated configuration parameters.

Copy the standard XSLT and make your changes in the XSLT.

There are several example adaptions with code templates of the integration flows available on the SAP DM Help page: https://help.sap.com/docs/sap-digital-manufacturing/execution/manage-integration-workflows?q=integration+worklfows

SAP Cloud integration retrieves the Custom XSLT from SAP DM and uses it for future XSLT mappings for an IDoc to XML. See this following Schema.

The image depicts a high-level architecture diagram for an iDoc (intermediate document) in SAP. The diagram shows the flow of data from left to right. On the left, there is a box labeled S/4HANA representing the source system. An arrow points from the S/4HANA box to a central box labeled XSLT Mapping. This central box takes the input from S/4HANA and performs an XSLT (eXtensible Stylesheet Language Transformations) mapping to transform the data. Another arrow leads from the XSLT Mapping box to a box on the right labeled CI, indicating the mapped data is sent to an interface named CI. Below the XSLT Mapping box, there is a label Inbound XML and an arrow pointing towards a box labeled DM, likely referring to a data model or data management system. Finally, there is a bi-directional arrow between the CI and DM boxes, labeled XSLT Configuration, suggesting that the XSLT mapping can be configured based on the interaction between the CI interface and the DM component.

Business Case

Let's practice what you have just learned by integrating custom data from SAP S/4HANA into a custom data field on order level.

Note

The changes you introduce using custom XSLT affect all the plants existing in your tenant. You can add if-else conditions to differentiate between plant values.

Business Requirement

As a production supervisor, you need to have the equipment data from SAP ERP to SAP DM on order level.

To do this, we can first see if Check Equipment Data is part of the standard integration of SAP S/4HANA. On the Help page for DM Integration, you can find the Standard Transactional Data.

We are looking for the transactional data coming with the production order and see that there is no equipment data in standard integration foreseen.

The above image shows the functions of the integration landscape

Because we know that the equipment data in this case is part of the LOIPRO IDoc (Production Order IDOC), which is sent by SAP S/4HANA to DM, we need to find a way to make it usable in the DM System.

First, we need a Custom Data field on order level. Create this in the Manage Custom Data app in DM. Add the Equipment field on order level:

The image shows an Order screen from an SAP software system. On the left side, there is a navigation menu with various options like BOM, BOM Component, Certification, Data Collection, Material, Material Group, and more. The main part of the screen displays fields related to an order, such as Data Field, Field Label, Shift program name LM_PROD, and Customer specific Engineering Data. The EQUIPMENT field is highlighted, indicating it is the currently selected field for the order being viewed or edited. In summary, this screenshot presents an interface for managing order details within an SAP system, allowing the user to specify information like production shift programs, custom engineering data, and the specific equipment associated with the order.

Let’s search for the field value in the SAP S/4HANA IDoc. See what an example LOIPRO IDoc looks like:

The image shows a data record display in the SAP software system. The record has an ID of 000000000225626 and contains various data fields such as AUFNR, BELNR, YBM1, PCE1, and FTRMI, along with their corresponding values. The fields are organized in a hierarchical tree structure, with some fields nested under others. For example, the AUFNR field has a value of 10101183, while the YBM1 field, which is nested under AUFNR, has a value of 20140625. The data record provides a detailed view of the specific information stored for this particular ID within the SAP system.

The name of the field value is important to fill the Custom Data field in DM with the value of exactly this field from the iDoc. Now back in DM, look at the Integration Workflow for Production Order Download in the Manage Integration Workflows app:

The image shows a user interface for managing integration workflows in an SAP system. On the left side, there is a list of several workflow names such as BOM Download (BOMMAT04), BOM Download (BOMMAT05), Master Routing Download (LOPRDUM), and Operational Master Recipe Download (LOPROUP). When one of these workflows is selected, its configuration details are displayed on the right side in a pop-up window titled Production Order Download (LOIPROD5 V2). The configuration window has tabs for General Configuration, Service Configuration, and Error Handling Configuration. Under the Service Configuration tab, there are fields for specifying a Standard Pre-xSLT Workflow and a Custom Pre-xSLT Workflow. The Custom Pre-xSLT Workflow field contains XSLT code for transforming XML data, with elements like <CreateQuoteTime>, <SenderBusinessSystemID>, <SenderBusinessSystemIDQualifier>, <ReceiverBusinessSystem>, and <MessageHeader>.

It is best to copy the standard XSLT for the Production Order Download (LOIPRO05 V2) to an editing tool. Search for the line where it is foreseen to enter custom data fields and map it with the field from the IDoc. Here is an example:

The code snippet shows an example usage of a CustomFieldList in XML format. It defines a custom field for an EQUIPMENT attribute, which selects a value using an XPath expression. The value is selected from an XML path of /LOIPROB5/IDOC/E1AXXX/ZE1AFXXXX/ZZEQXXX. Inside the CustomFieldList, there is also a sample for a custom field on the order book header level, which demonstrates how to use the BomHeaderCustomFieldList element. The code then shows an example test case using an xsl:if statement. It checks if the E1AFPOL[POSNR='0001']/KUNAG path is equal to an empty string and the E1AFPOL[POSNR='0001']/NAME1 path is equal to an empty string. If both conditions are true, it selects the value of E1AFPOL[POSNR='0001']/KUNAG. This XML code provides a structured way to define custom fields and retrieve specific values from a larger XML document using XPath expressions. It allows for conditional logic to select the desired value based on certain criteria.

Copy the customized XSLT into the Custom XSLT field in the Production Order Download (LOIPRO05 V2) as shown in the following figure.

The image shows an SAP system interface for managing integration workflows. On the left side, there is a list of several workflow items like Work Center Download, Material Download, and Material Download using MATMAS03 IDocs. On the right side, there is a pop-up window titled Production Order Download (LOIPRO05 V2). This window displays XML code that seems to be a configuration for downloading production order data from SAP. The code mentions XML templates, XSLT transformations, and URL endpoints for sending and receiving data. Overall, the screen capture depicts a technical workflow setup in an SAP system for integrating and exchanging data related to production orders.

Choose Save and try out the Integration customization works out in the Manage Orders app:

The image shows a user interface screen from an SAP system for managing production orders. The screen displays details for a specific order number TR180-0027, including the order category (Material), production order (BICYCLE TR180 / A (BICYCLE TR180)), production version, release status (Released), execution status, and planned quantity (2 PC). Below the order header information, there are several tabs providing additional details and options, such as Order Information, Planned BOM, Planned Operations, SFCs, Custom Data, Order Schedule, and Co-Product SFCs. In the Custom Data section, there is a data field labeled Shift progress rates LM POD with a value of TEAM SAP for the Customer specific Engraving attribute and 8291017 for the Equipment attribute.

Log in to track your progress & complete quizzes