
This blog provides a step by step process to migrate, simple, point to point B2B outbound EDIFACT interfaces from SAP PO to Cloud Integration (CPI) without TPM.
I have taken an example of an outbound invoice interface (Own system --> Trading Partner) to explain the process
System Type: UNEDIFACT
Message Type: INVOIC
Version: 96A
When we talk about migrating B2B interfaces which are in SAP PO to cloud then there are below options.
Migrating by implementing the B2B interfaces via TPM comes with a lot of benefits and best practices. Please refer to the blog for more details but there are customers who wants to avoid time and effort in creating MIGs, qualifying the fields, redoing the MAGs, testing, and implementing via TPM. They want to reuse the existing simple B2B mappings done in SAP PO system.
Hence, in this blog, we will focus on the option #2 with step-by-step approach to easily migrate B2B outbound EDIFACT interfaces from SAP PO to Cloud Integration
Note: This approach works for message mapping with function libraries without imported archive. To import it to Cloud Integration, please refer blog .
Connection between SAP PO and Cloud Integration is already set up. Please refer blog
In this case, we will concentrate on migrating a outbound INVOIC interface (Own system --> Trading Partner) from SAP PO to Cloud Integration
1. Create a package, Click on Edit --> Migrate
2. Select your already configured SAP PO system from the drop-down --> Next Step
3. Select Integrated Configuration (ICo) of the B2B interface you wish to migrate.
4. ICo selected will be reviewed dynamically by the tool and following template proposals are provided.
5. For Simplicity purpose, I will select the below template and click on Next Step
Update: For the list of supported templates available, please refer Supported Templates
6. Provide a name for your iFlow --> Review --> Migrate --> View Artifact
7. Click on Configure - to configure sender and receiver channels.
8. In the Local integration process, you can see the mapping migrated from SAP PO
9. If you have any fields, which is using $B2B_END_UEBNR for unique numbers which is a parameter in SAP PO then follow below steps.
1. Open another tab, to create NRO as below.
2. Add Content modifier before SAP PO mapping and set exchange property.
3. Click on create to create a custom function
4. Add the below code
import com.sap.it.api.mapping.*;
def String customFunc1(String P1,MappingContext context) {
String value1 = context.getProperty(P1);
return value1;
}
Update:
Now, in CI we have standard function "getProperty" available. Hence, please use this function instead of above mentioned custom. In the property name maintain the the value as ICN_DEFAULT
5. Do the mapping as below for all the fields which is using SAP PO NRO parameter, $B2B_END_UEBNR, save and deploy the message mapping
10. If your mapping is using $B2B_SEG_COUNTER to count the number of segments which is the value for the field D_0074 under the segment, S_UNT, then we will make use of XSLT mapping
1. Add a property in the content modifier. This property will be called in the XSLT mapping.
2. Create a XSLT Mapping next to the imported message mapping and add the below code
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<!-- Declaring the Parameter -->
<xsl:param name="MessageType"/>
<!-- Matching the template -->
<xsl:template match="@*|node()">
<xsl:copy>
<xsl:apply-templates select="@*|node()"/>
</xsl:copy>
</xsl:template>
<!-- Matching the template for D_0074 under S_UNT where segment count is added -->
<xsl:template match="S_UNT/D_0074">
<xsl:copy>
<!-- Use the parameter in the XPath expression -->
<xsl:value-of select="count(//*[starts-with(name(), 'S_')][ancestor-or-self::*[name()=$MessageType]])"/>
</xsl:copy>
</xsl:template>
<!-- Template to remove "_1" from node names -->
<xsl:template match="*[substring(name(), string-length(name()) - 1) = '_1']">
<xsl:element name="{substring-before(name(), '_1')}">
<xsl:apply-templates select="@*|node()"/>
</xsl:element>
</xsl:template>
</xsl:stylesheet>
Parameter can be changed based on the message type used in the flow to make this XSLT mapping dynamic. Template to remove _1 from the node names is added to convert PO xml to CI (CPI) specific xml.
11. Final step would be to download the EDIFACT xsd from Integration Advisor. In this case it is “UN-EDIFACT_INVOIC_D96A.xsd”, add the XML to EDI converter and add the downloaded xsd.
Update: For steps to download the xsd from Integration Advisor, please refer blog
12. That’s it, save and deploy the iFlow!
Now, when an IDOC is triggered to this iFlow, you will be able to see that the IDOC gets converted successfully to EDI format and the unique values from NRO and segment counters are also populated correctly .
Unique values from NRO for the field D_0020
Segment counter for the field D_0074
These steps will help to easily and quickly migrate simple, point to point B2B outbound EDIFACT interfaces from SAP PO to CI. This will help in reusing the existing mapping done in SAP PO. This blog also explained how SAP PO parameters like $B2B_END_UEBNR and $B2B_SEG_COUNTER are replaced in SAP Cloud Integration.
Note: Inbound EDIFACT interfaces will require more modifications and it cannot be used directly from the EDI to xml converter in the imported PO mapping.
In my next blog, I will try to cover how to migrate inbound EDIFACT interfaces w/o using TPM.
Please feel free to discuss your experience with B2B migration from SAP PO to cloud in the comment section of this blog post.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
27 | |
24 | |
23 | |
19 | |
16 | |
15 | |
10 | |
9 | |
9 | |
8 |