Introduction
In my previous post B2B on SAP Integration Suite – Cloud Integration – CPI – using Trading Partner Management – Part 1 – IDoc to EDI Flow(s) we covered the initial set up of your B2B Trading Partner Management on Integration Suite / CPI / Cloud Integration for a IDoc to EDI Scenario, i.e., an Outbound EDI scenario from an Enterprise perspective.
In this post we continue on this journey ( with the principal of keeping it simple) for an Inbound EDI Scenario,i.e, we receive an EDI file over HTTP or SFTP Adapters and then process it over to our ERP system as an IDoc. We will build on top of the configuration we have already performed.
Scenario in Scope
This is a reversal of our previous scenario, i.e., an EDI to IDoc Scenario.
- Get a EDI file over SFTP from Trading Partner or EDI Gateway.
- Convert EDI file to EDI XML.
- Map the EDI XML to IDoc XML using Graphical Mapping of Integration Suite
- Deliver the IDoc to ERP.
- Leverage use of TPM.
Pre-requisites from Previous Post
It is very much possible that you do not want to do Outbound EDI scenario and want to start with an Inbound EDI Scenario. In that case while this blog has most of the configuration and steps, there are certain steps you need to refer back to my Part 1. Ensure below steps are configured before you move on from the linked Part 1 post.
- Create Company Profile
- Create Identifiers (for Self)
- Create Systems (for Self)
- Create Type Systems ( for Self)
- Create Trading Partners
- Create Identifiers
- Create System
- Create Type System
High Level Steps in Scope
- Create a MIG for EDIFACT Message
- Create a MIG for IDoc
- Create Communication System for Trading Partners
- Create Communication System for Self
- Define Agreement Template
- Define Agreements
- Create your Mapping IFlow
- Create a SFTP Sender IFlow
- Configure / Customize Standard IFlows
- Test your Flow
Create a MIG ( Message Implementation Guide) for EDIFACT Message
The EDIFACT message in scope in our implementation is ORDERS D96 B. We will create a MIG for this EDIFACT Message. If you have the EDI XML available to you, that will make your life easy, else you just need to select all the relevant fields in scope.
Go to Integration Suite –> Design –> MIGs. Click on ADD
Select UN/EDIFACT
Search for ORDERS and Select ORDERS
Select D.96B.S3 ( Corresponding to our EDIFACT Incoming EDI(
If you have the EDI XML of your Cloud Integration, you can use that here to make your MIG process easy. Note: You will also see the option here to select Process Integration. This also allows you to use EDI XML from Process Integration ( or Process Orchestration) if you are planning to migrate EDI from SAP PO to Cloud Integration. If you do not have the EDI XML, you can skip this step.
Provide the below details
- Name: MIG_UN_EDIFACT_ORDERS_D96B
- Direction: BOTH
- Own Business Context : Select Required Business Process Context
- Click on Create
- Select Option Get Proposals . I would suggest you select the fields in scope as per your EDI Guidelines and specification.
- If you have your EDI File example, you can also Simulate this and make sure it works.
- Activate your MIG
Create a MIG for IDoc
As per our requirement, the IDoc in scope is an ORDERS.ORDERS05 IDoc. You can use the Message Implementation Guidelines section to create a MIG for ORDERS.ORDERS05 IDoc. The steps are similar to what we have described in previous section and hence I will just provide some self explanatory screenshots here.
Create Communication ( for Trading Partner)
As we will receive the EDI File from our trading partner (CUSTOMER1) over SFTP, we will need to create a Sender Communication for this Trading Partner in TPM. Unfortunately SFTP is not supported currently in TPM. ( As of Sep 2023) This is on the roadmap (Q4 2023) and hence as a workaround we will define a AS2 Sender Communication System. In reality we will not use this but to allow us to move forward we need to define a AS2 Sender Communication for our Trading Partner – CUSTOMER1. [ Updated to reflect the Nov 2023 release from SAP to allow for ProcessDirect Based flows]
Navigate to your Integration Suite -> Design –> B2B Scenarios. Go to tab Trading Partners. If you have followed all steps in the Pre-requisites you should see the Trading Partner CUSTOMER1. We will add the Communication for this Trading Partner.
Navigate to Systems –> Communications of your Trading Partner and click on Create
Not relevant from Nov 2023
Enter below details and save
[Updated Nov 2023 to allow ProcessDirect based Senders]
Name: CUST1_COMM_DUMMY_SENDERAlias: CUST1_COMM_DUMMY_SENDERDirection: Sender ( As your Trading Partner is now going to Initiate the message)Adapter: AS2 ( As SFTP Is not Supported and this is a Dummy channel)Security Configuration: ChannelUser Account: DummyLeave other details as is and Save
- Name : CUST1_COMM_SFTP_PROCESSDIRECT_SENDER
- Alias: CUST1_COMM_SFTP_PROCESSDIRECT_SENDER
- Direction: Sender
- Adapter: Process_Direct
Not relevant from Nov 2023
Create Communication (for Self)
As we are going to map the EDI file to a IDoc and post an IDoc to SAP ECC ( ERP) we will need to define a Receiver Communication for our Company.
Navigate to B2B Scenarios on your Integration Suite and Tab : Company Profile. If you have completed all pre-requisites of previous section, you will see your Company as below
Navigate to Systems -> Communications and Click on Create
Enter below details and click on Save
- Name: ERP_ECC_IDOC_RECEIVER
- Alias: ERP_ECC_IDOC_RECEIVER
- Direction: Receiver
- Adapter: IDOC
- Address: http://<<erphostname>>/sap/bc/srt/idoc?sap-client=<<clientnumber>>
- Proxy Type: OnPremise
- Authentication: Basic
- Credential Name: ERPCLNT200
Note: In this configuration, I have assumed that I use cloud connector to connect to my ERP system. Adjust details accordingly.
Refer to part 4 of this blog series of mine for IDoc Configuration (HCI/HCP-IS: IDoc Adapter Deciphered – Part 1 – Trigger IDoc from SAP ERP to HCI Using Basic Authentication)
Define Agreement Template
In this section, we will create a Agreement Template in our Trading Partner Management. The Agreement Template here is where CUSTOMER1 is the Initiator and ERPCLNT200 is the Reactor
Go to Integration Suite -> Design -> B2B Scenarios -> Agreement Templates.
- Name: Customer1 Initiates EDIFACT ORDERS D96B
- System –> ERP_ECC
- Type System –> S/4 HANA On Premise IDoc
- Type System Version –> 701
- Identifier –> ERPCLNT200
Create a B2B Scenario / Transaction
- Name: EDIFACT ORDERS D96B To IDoc ORDERS.ORDERS05
- Business Transaction Pattern: One Way Notification
- My Company Role : Reactor
When you try to select the Message Implementation Guideline MIG; you will not be able to see your MIG. That is because your MIG was defined for S/4Hana 1709 but our ECC version is 701. Reset the filters and then the search will work.
Define the Communication channel ( IDoc) in your Template.
Define Agreement
Create a Agreement in your Trading Partner Management as per below details.
We have not created a Type System Version for D.96B.S3 so far as we will receive a EDIFACT message of Type System Version D.96B.S3. We will create that now .
You will now see D.96B.S3 in your Trading Partner Agreement. Select that and the remaining Identifiers as per screenshot below.
Provide Sender Communication Details in Trading Partner Agreement
Provide Sender Interchange Details in Trading Partner Agreement
Provide Mapping Details in Trading Partner Agreement
As per our scope, we will not use MAG and use a Message Mapping in Cloud Integration. Select option “Customized Mapping Processing” and provide your Process Direct endpoint of your Iflow ( /tpm/Customer1/EDIFACT_ORDERSD86B/IDOC_ORDERS_ORDERS05). Note this endpoint as you will use it in the next step.
Activate your Trading Partner Agreement
Create your Custom Mapping IFlow
As per previous section, we need to have a custom mapping flow running on the Process Direct Endpoint: /tpm/Customer1/EDIFACT_ORDERSD86B/IDOC_ORDERS_ORDERS05
Create an IFlow that takes your EDI XML as Input and maps it to the ORDERS05 IDoc. I will not go into the details of this. Below screenshots are self explanatory.
Create a SFTP Sender IFlow
[[Updated in Nov 2023 to reflect the new Process Direct Based Approach with the package release from SAP]]
Define a SFTP to ProcessDirect Iflow that receives a EDI File from SFTP and sends it over ProcessDirect. The ProcessDirect endpoint will be /tpm/b2b/processdirect, pointing to the standard IFlow Step 1 – Sender Process Direct Communication Flow V2.
In this flow as we process a EDI File, we need to set a header for the next Standard IFlow from SAP to identify the type of message.
Set Header “SAP_EDI_Document_Standard” with value “UN-EDIFACT” ( for EDIFACT) or “ASC-X12” ( for ANSI X12). See below screenshot.
As we have seen previously we have configured our Trading Partner Management in previous section to have AS2 Sender as our Sender Channel. This was done to overcome the limitation of our TPM as it does not support SFTP yet.
To now get to process our inbound EDI file over SFTP,
Go to the Standard Package of SAP Cloud Integration – Trading Partner Management V2Copy the Iflow Step 1 – Sender AS2 Communication Flow V2 as a custom Iflow with Name Step 1 – Sender SFTP As AS2 Communication Flow V2 in your own Custom Package.Once you have done that, change the Sender AS2 Channel in this copied Iflow to a Sender SFTP Channel. Do not change anything else except the Sender AS2 Channel.
See screenshots
Not relevant from Nov 2023
Not relevant from Nov 2023
Not relevant from Nov 2023
Configure / Customize Standard IFlows
As per our previous post, we need to deploy as is the below Iflows and Groovy Script from Standard SAP Package Cloud Integration – Trading Partner Management V2 .
Navigate to Discover -> Integrations and Copy the Standard Package
Cloud Integration – Trading Partner Management V2 to your tenant
- Reusable Groovy Scripts V2
- Step 2 – Interchange Processing Flow V2
- Step 1 – Sender Process Direct Communication Flow V2
Optionally Deploy this Iflow depending on whether you have implemented the previous Post or not. If you are directly implementing a SFTP to IDoc EDI Flow, you need to deploy this Iflow. If you have already implemented the Part 1 of this series for IDoc to EDI Flow, then do not deploy this Iflow as you have built a Custom Iflow in Part 1
- Step 3 – Receiver Communication Flow V2 ( Note: If you have implemented the previous scenario from Part 1 where you modified this iflow, then do not Deploy this iflow. You will use the Modified IFlow.)
Below are the list of Iflows to be deployed
S.No | IFlow | Description |
1 | CUST1_COMM_SFTP_PROCESSDIRECT_SENDER | Custom IFlow for SFTP to Process Direct |
2 | Step 1 – Sender Process Direct Communication Flow V2 | Standard Iflow for ProcessDirect Sender |
3 | Step 2 – Interchange Processing Flow V2 | Deploy As Is |
4 | Step 3 – Receiver Communication Flow V2 | Deploy As Is if directly implementing this scenario. Else Deploy Step 3 – Receiver Communication Flow V2 SFTP Modified from previous post |
5 | Reusable Groovy Scripts V2 | Deploy As Is |
Test You Flow
Drop a EDIFACT EDI Message of Format ORDERS D96 B on your SFTP Server. The File will be picked by Iflow CUST1_COMM_SFTP_PROCESSDIRECT_SENDER and processed all the way to ERP. The Iflows that will be triggered are
- CUST1_COMM_SFTP_PROCESSDIRECT_SENDER
- Step 1 – Sender Process Direct Communication Flow V2
- Step 2 – Interchange Processing Flow V2
- EDI_ORDERS96B_TO_ORDERS – Executes our Mapping
- Step 3 – Receiver Communication Flow V2 SFTP Modified
The message will be processed over and will look as below in the B2B Monitor
- Message Type : ORDERS ( As Sender Sends EDIFACT Orders )
- Message Number: 15 ( UNH Message Reference Number)
- Sender Identifier : CUST_1234 ( Corresponding to Customer1 EDI Identifier)
- Receiver Identifier : SELF_1234 ( Corresponding to Self Company EDI Identifier)
- Document Standard : UN-EDIFACT
- Interchange Control Number: EDI ICN Number
- Adapter Type : AS2 ( Workaround as SFTP is not supported)
- Message Type : ORDERS.ORDERS05 ( Corresponding to IDoc Orders)
- Document Standard : SAP_IDoc
- Sender Identifier: CUSTOMER1 ( for IDoc SNDPRN)
- Receiver Identifier: ERPCLNT100 ( for IDoc RCVPRN)
Final Thoughts
We have extended our EDI flow for an Inbound EDI flow. We have received a EDIFACT Message and processed them over into Integration Suite using Trading Partner Management and B2B.
The only “Customization” we have done is to handle SFTP for Sender / Receiver channel by leveraging AS2 ( for Sender) and SOAP ( For Receiver). With multiple partners in your landscape you can avoid having to write custom code and leverage the B2B Trading Partner Management and its Partner Directory to handle all your EDI Flows.
In the next part we will look at extending this to use a AS2 Sender Channel and AS2 Receiver Channel. Stay Tuned!
Additional Blogs from this Series
- Trading Partner Management – Part 1 – IDoc to EDI Flow(s)
- Trading Partner Management – Part 3 – EDI over AS2 to IDoc Flows(s)
- Trading Partner Management – Part 4 – IDoc to EDI over AS2 Flow(s)
- Trading Partner Management – Part 5 – Custom IDoc Flow
- Trading Partner Management – Part 6 – Custom Search Attributes
- Trading Partner Management – Part 7 – EDI Functional Acknowledgements for Inbound EDI Messages
- Trading Partner Management – Part 8 – EDI Functional Acknowledgements for Outbound EDI Messages
- Trading Partner Management – Part 9 – Outgoing IDoc Bundling
- Trading Partner Management – Part 10 – Outgoing IDoc Bundling With EDI Bundling
- Trading Partner Management – Part 11 – Handling Parameters
- B2B on SAP Integration Suite – Part 12 – Migrating SAP PI / PO B2B Mappings without TPM
- Trading Partner Management – Part 13 – Migrating SAP PI / PO B2B Mappings with TPM
- Trading Partner Management – Part 14 – Handling Bundled Incoming EDIs
- Trading Partner Management – Part 15 – Handling Message Retries
- Trading Partner Management – Part 16 – B2B Failed Message Alerting
- Trading Partner Management – Part 17 – TPM Naming Convention Guideline