Supply Chain Management Blogs by SAP
Expand your SAP SCM knowledge and stay informed about supply chain management technology and solutions with blog posts by SAP. Follow and stay connected.
cancel
Showing results for 
Search instead for 
Did you mean: 
SaraMani
Advisor
Advisor
525

Introduction

In the manufacturing process, timely access to detailed instructions is vital for smooth operations. SAP Digital Manufacturing (SAP DM) users face a common issue where Operation Long Text, critical for understanding operational steps, is not included in the iDocs (LOIPRO) transferred from SAP ERP. Although this information is available via SOAP messages in SAP ERP, the standard integration between SAP ERP and SAP DM relies on iDocs, leading to missing long text data on the shop floor.

This blog explores two approaches to solve this issue:

  1. Extending the LOIPRO iDoc in SAP ERP by adding a custom field to include Operation Long Text.
  2. Using a custom BAPI and a PreXSLT iFlow in SAP CPI to enrich the iDoc with Operation Long Text before mapping it to SAP DM fields.

Regardless of the chosen method, the SAP DM segment `<pp:LongText>` will be used to map the custom field from the iDoc.

Understanding the Challenge

SAP ERP uses LOIPRO iDocs to send production and process order information to SAP DM. However, by default, these iDocs do not contain Operation Long Text, which includes crucial instructions for shop floor operators. Although SAP ERP provides this information through SOAP messages, integrating SOAP-based data adds unnecessary complexity, as SAP DM primarily relies on iDocs.

To bridge this gap, you can either extend the LOIPRO iDoc to include a custom field for long text or use a custom BAPI with SAP CPI to retrieve and enrich the iDoc with this information. In either approach, the SAP DM segment `<pp:LongText>` will be used for mapping the long text, but the field name in the iDoc can be customized according to customer preferences.

SaraMani_0-1726244126521.png

 

SaraMani_1-1726244126528.png

Approach 1: Extending the iDoc in SAP ERP

A simple solution to this issue is extending the LOIPRO iDoc to include a custom field that holds the Operation Long Text. The customer can define the name of this custom field as per their business requirements.

  • Extend the iDoc structure: Add a custom field to the LOIPRO iDoc to store the Operation Long Text. This custom field can have any name, depending on the customer’s preferences. Once added, this field will contain the operation-specific long text, which can later be mapped to SAP DM.
  • Mapping to SAP DM: After the custom field is added to the iDoc, it must be mapped to the SAP DM payload segment `<pp:LongText>` during the data integration process. This segment is part of the SAP DM payload and is used to display long text within SAP DM.

Example of SAP DM Payload Mapping:

<pp:LongText pp:languageCode="" pp:MIMECode="text/plain" pp:TextCategory=""> 
         {CustomFieldFromIDocContainingLongText}
</pp:LongText>

In this case, the custom field from the iDoc is mapped to the `<pp:LongText>` segment in SAP DM.   This will be displayed in SAP DM in the Operation/Phase details for the Routing/Recipe. 

SaraMani_2-1726244126548.png

Approach 2: Custom BAPI with PreXSLT iFlow in SAP CPI

For customers seeking more flexibility, another approach involves using a custom BAPI to retrieve the Operation Long Text and enriching the iDoc using a PreXSLT iFlow in SAP CPI.

  • Create a Custom BAPI: Develop a custom BAPI in SAP ERP that retrieves the Operation Long Text for all operations within a production or process order. This BAPI can return the long text in a structured format based on the requirements.
  • Use a PreXSLT iFlow in SAP CPI
    • The PreXSLT iFlow will call the custom BAPI/API to retrieve the Operation Long Text.
    • It will then enrich the iDoc with the retrieved long text, adding it as a custom field in the iDoc.
    • The enriched iDoc is then passed through the integration process.
  • Mapping to SAP DM: Similar to the iDoc extension in Approach #1, the custom field in the enriched iDoc will be mapped to the `<pp:LongText>` segment in SAP DM.

Why This Solution Matters

Both approaches—extending the iDoc or using a custom BAPI—ensure that Operation Long Text is included in the data transfer between SAP ERP and SAP DM. Here are the key benefits:

  • Customizable iDoc Structure: The iDoc can be extended with any custom field name for the long text, offering flexibility for different customer needs.
  • Streamlined Data Flow: By enriching the iDoc with long text, whether through direct extension or via CPI, all relevant information can be transferred to SAP DM using the existing iDoc-based integration.
  • Consistent XSLT Mapping: Both approaches use the same XSLT step to map the custom iDoc field to the `<pp:LongText>` segment in SAP DM, ensuring consistency and simplicity.

Conclusion

The absence of Operation Long Text in iDocs (LOIPRO) poses a challenge for SAP DM users. While SOAP messages can provide this data, relying on SOAP adds complexity. The solution lies in either extending the iDoc to include a custom field for long text or using a custom BAPI to enrich the iDoc via SAP CPI. In both cases, the custom iDoc field is mapped to the `<pp:LongText>` segment in SAP DM using a XSLT transformation in integration layer.

This approach streamlines the integration between SAP ERP and SAP DM, allowing shop floor operators to access critical instructions and improving overall production efficiency.

Note: This above blog is only applicable for SAP ECC and SAP S4Hana, not for S4HC.