Logistics

How to Configure EDI Interfaces with MM in SAP S/4HANA

Learn how to set up EDI interfaces in SAP S/4HANA to automate the exchange of procurement documents like purchase orders, invoices, and order confirmations between buyers and suppliers.

 

Supplier collaboration is vital in automating, standardizing, and streamlining the procure-to-pay process in materials management. Business documents such as purchase orders, purchase order confirmations, ASNs, invoice documents, and so on are shared between the buyer’s and supplier’s ERP systems electronically via EDI. Let’s explore the setup of these interfaces in SAP S/4HANA, assuming that SAP S/4HANA is the ERP system on the buyer side.

 

Let’s start with the outbound EDI interfaces from SAP S/4HANA.

 

Outbound EDI Interfaces

The purchase order and the scheduling agreement delivery schedule are two important documents that will be shared by the buyers with supplier business partners. SAP S/4HANA generates IDocs for transmitting purchase orders (message type ORDERS) and scheduling the agreement delivery schedule (message type PURSAG_MAINTAIN) for business partners (suppliers) in real time via EDI.

 

SAP S/4HANA uses output determination for generating and transmitting outbound IDocs to an external system. Output messages are automatically generated during the creation of a purchase order and transmitted to suppliers after the purchase order is released or approved. NEU is the standard output type used to transmit purchase orders and scheduling agreement delivery schedules.

 

Let’s walk through the main configuration steps for outbound EDI interfaces.

Maintain Output Determination Condition Record

The condition technique is used for output determination for the message output in SAP S/4HANA. Creating an output determination condition record enables the automation of generating and transmitting output messages. To create, change, or display an output condition record, use the following transactions:

  • Transaction MN04: Purchase Order Output Condition Record—Create
  • Transaction MN05: Purchase Order Output Condition Record—Change
  • Transaction MN06: Purchase Order Output Condition Record—Display
  • Transaction MN10: Scheduling Agreement Delivery Schedule—Create
  • Transaction MN11: Scheduling Agreement Delivery Schedule—Change
  • Transaction MN12: Scheduling Agreement Delivery Schedule—Display

Use Transaction MN05 to arrive at the screen shown in the figure below, which is the initial screen for changing an output condition record for output type NEU. Specify the output type NEU in the entry field and then press (Enter). The Key Combination popup will be displayed. Key combinations can be configured based on business requirements to determine the output condition record during the creation of a purchase order and a scheduling agreement delivery schedule.

 

Output Condition Record for Output Type NEU: Initial Screen

 

For example, if you maintain an output condition record for purchasing output determination with the key combination set to Doc.Type/Purch.Org/Vendor, the output condition record will be determined during the creation of the purchase order automatically when the same combination of a document type, purchasing organization, and vendor is found in the purchase order.

 

Press (Enter) after selecting a key combination from the initial screen. The next figure shows the output condition record details that are created for output type NEU and with key combination Purch.Org/Vendor for EDI.

 

Output Condition Record for Output Type NEU: Details

 

The following are the key fields of the output condition record:

  • Organization: Specify the purchasing organization in which the output condition record is being created. This field is mandatory as it is one of the fields from the key combination.
  • Supplier: Specify the EDI supplier to which the purchase order is to be transmitted electronically via EDI.
  • Funct (function): Choose a partner function code from the dropdown menu. For a supplier-based condition record, choose VN (vendor) as the partner function. For EDI message output, a partner profile must exist for the vendor with partner type LI (vendor). If you want to send the IDoc output message to a middleware system, choose LS (logical system) as the partner function. In such cases, for EDI message output, a partner profile must exist for the logical system with partner type LS.
  • M… (medium): Choose a message transmission medium for outbound messages. The system creates messages based on the medium and triggers automatic message outputs such as fax, email (external send), print output, EDI, and so on. Table 12.4 shows the key output mediums in the standard system. For EDI output, select 6 (EDI) as the output medium.
Output Medium Description
1 Print output
2 Fax
4 Telex
5 External send
6 EDI

 

Thie figure shows that output record with output type NEU was generated automatically to trigger an EDI output that transmitted a purchase order to supplier 200080.

 

Purchase Order Output Determination

Ports in IDoc Processing

Ports are used in IDoc processing to define the communication channel for transmitting outbound IDocs from SAP S/4HANA to external systems and business partners. The following are the different types of ports in SAP S/4HANA:

  • Transactional RFC port: These ports are used for communicating the messages (IDocs) via Application Link Enabling (ALE) for establishing communication between two logical systems.
  • File port: File ports transmit IDocs in file format to a specific location in a system that can be accessed to retrieve the file in order to transmit it to the target system. File ports are used in EDI.
  • ABAP PI port: These ports are used to transfer messages using an ABAP interface. It provides the ability to customize the interface for transmitting and receiving messages (IDocs).
  • XML file port: These ports are used for communicating messages (IDocs) as XML files.

Ports are defined in SAP S/4HANA using Transaction WE21. A prerequisite for creating a port for IDoc processing is to define a remote function call (RFC) destination using Transaction SM59. The RFC destination contains the logical address and the authentication of the destination (target) system.

 

The figure below shows information for transactional RFC port A000000004. You can see the RFC destination field, where you specify an RFC destination to communicate the IDoc messages to the target system. The RFC destination contains the logical address and authentication details for the data transfer through IDocs.

 

Port in IDoc Processing

Create Partner Profile for Outbound IDocs

The partner profile consists of logical attributes to send and receive application documents (messages) electronically using IDocs. For every logical system, vendor, customer, other business partner, and so on, a partner profile must exist in SAP S/4HANA to process inbound and outbound IDocs.

 

Partner profiles are created in SAP S/4HANA using Transaction WE20 for the partner types shown in this table.

 

Partner Type Description
AD Address
B Bank
BP Benefits provider
GP Business provider
KU Customer
LI Vendor
LS Logical system
US User (first 10 characters, no check)

 

A partner type is a vital attribute to create a partner profile. To create a new partner profile, execute Transaction WE20 and click the Create icon at the top. Then specify a partner type and the corresponding partner number. Now, let’s discuss the various attributes of a partner profile while examining an existing profile created for a vendor.

 

To display an existing partner profile, click the arrow in front of a partner type on the left-hand side to expand the list. This arrow will appear only if at least one partner profile exists for the partner type. Then, double-click a partner number.

 

This figure shows the partner profile created for vendor 200080 using partner type LI (vendor), the outbound IDoc message type ORDERS (purchase order), and the partner function VN. In the partner profile, you can define the inbound and outbound message types and the corresponding IDoc processing parameters.

 Partner Profile for Business Partner with Partner Type LI (Vendor)

 

Let’s dive deep into the settings required in the partner profile for processing outbound IDocs:

  • Partner No.: Specify the partner number of the partner for which you are defining the partner profile. You can specify the supplier number of the business partner if you’re creating the partner profile for partner type LI (vendor).
  • Type: A partner type distinguishes different types of partners for communication. Specify the partner type for transmitting the IDocs. A partner profile can be defined for the logical system (LS), vendor (LI), customer (KU), and other partner types. To transmit a purchase order to an external system, define the partner profile for partner type LS, and to transmit a purchase order to a vendor, define the partner profile for partner type LI.
  • Message Type: Message types distinguish different document types that flow via EDI using IDocs. Every document that flows electronically via EDI is associated with a message type in SAP S/4HANA. For purchase order transmission, specify ORDERS (the standard message type for a purchase order) in this field.

Then, under the Post Processing: Valid Processors tab, you can define a user who gets the error messages if any during the IDoc processing. Specify “US” in the Ty. (user type) field, the user ID of the user who gets error messages in the Agent field, and the desired language in the Lang field as the postprocessing parameters.

 

Next, maintain the outbound options. Click the + icon under the Outbound section of the partner profile initial screen. This figure shows the outbound parameters of the partner profile for transmitting a purchase order to an external system via EDI using IDocs.

 

Partner Profile for Vendor with Outbound Parameters to Share Purchase Orders

 

The Outbound Options tab has the following key fields:

  • Receiver port: Ports are used in IDoc processing to define the communication channel for transmitting outbound IDocs from SAP S/4HANA to external systems and business partners. Specify a receiver port to transmit the IDoc to the EDI system that will send it to the vendor’s ERP system.
  • Size: Specify the number of IDocs that can be sent per RFC.
  • Output Mode: The output mode defines how the IDocs are transmitted to the external system/ business partner. There are two modes:
    • Pass IDoc immediately: If you select this mode, generated IDocs will be sent to the EDI system/external system immediately.
    • Collect IDocs: If you select this mode, IDocs are collected and transmitted to the EDI system/ external system periodically.
  • Basic type: Basic types define the structure of an IDoc. Every basic type is mapped to a message type in SAP S/4HANA. Specify the basic type/IDoc type in this field. For purchase order transmission, specify ORDERS05 (the standard basic type for a purchase order).

Let’s explore message control settings in the partner profile. In the Message Control tab of outbound parameters, you can link the corresponding output type of the application document (e.g., purchase order output type). This is how the system generates the IDoc and transmits it to the receiver port for sending the electronic document to the business partner. The next figure shows Message Control attributes such as application EF (purchase order), message type NEU (purchasing output type), and process code ME10 (purchase order).

 

Partner Profile for Vendor with Outbound Parameters: Message Control

 

If the NEU output message is triggered with medium 6 (EDI) from purchase order creation, the system checks the corresponding partner profile for the partner function of the output message using message type NEU and the partner ID of the vendor.

 

Process code ME10 is defined for the purchase order transmission in the standard system. It contains a function module to process the purchase order IDoc.

 

This figure shows the EDI Standard attributes of the partner profile for the purchase order transmission. Message type 850 represents the EDI standard for the purchase order transmission.

 

Partner Profile for Vendor with Outbound Parameters: EDI Standard

 

Inbound EDI Interfaces

The purchase order confirmation, ASN, and invoice are the most important documents received from the supplier. To receive them via EDI, IDocs with specific message types and basic types must be generated in the EDI system or external system and sent to SAP S/4HANA. A partner profile for the respective partner and partner type is mandatory to process the inbound IDocs.

 

Let’s walk through the main configuration steps for inbound EDI interfaces.

Partner Profile Settings for Incoming Invoice

To maintain inbound options for a partner (e.g., vendor), go back to the partner profile initial screen. Click the + icon under the Inbound section of the partner profile initial screen to arrive at the inbound options screen.

 

This figure shows the partner profile for partner number 200080 and partner type LI (vendor). Inbound parameters of the partner profile are defined for receiving an invoice document from the vendor via EDI using IDocs.

 

Partner Profile for Vendor with Inbound Parameters for Invoice

 

The following are the key fields:

  • Message Type: Message types distinguish different document types that flow via EDI using IDocs. Every document that flows electronically via EDI is associated with a message type in SAP S/4HANA. For an incoming invoice document, specify INVOIC (the standard message type for incoming invoice documents) in this field.
  • Process code: A process code represents the type of inbound transaction data for processing the IDoc. Specify INVL (the standard logistics invoice verification process code) for incoming logistics invoices.
  • Cancel Processing After Syntax Error: If you enable this indicator, the system cancels IDoc processing if a syntax error is found in the IDoc.
  • Processing by Function Module: There are two options to process the inbound IDocs:
    • Trigger by background program: If you select this processing mode, inbound IDocs are collected and processed by a background program periodically.
    • Trigger Immediately: If you select this processing mode, inbound IDocs are processed immediately.

Partner Profile Settings for Purchase Order Confirmation

The figure below shows the partner profile for partner 200080 and partner type LI (vendor). Inbound parameters of the partner profile are defined for receiving an order confirmation from the vendor via EDI using IDocs.

 

Partner Profile for Vendor with Inbound Parameters for Purchase Order Confirmation

 

The following are the key fields:

  • Message Type: Message types distinguish different document types that flow via EDI using IDocs. Every document that flows electronically via EDI is associated with a message type in SAP S/4HANA. For an incoming invoice document, specify ORDRSP (the standard message type for purchase order confirmations) in this field.
  • Process code: A process code represents the type of inbound transaction data for processing the IDoc. Specify ORDR (the purchase order confirmation process code) for order confirmation.

Editor’s note: This post has been adapted from a section of the book Integrating Materials Management in SAP S/4HANA by Murthy KP. Murthy is a senior manager at Deloitte with a focus on supply chain and intelligent spend management. He has more than 16 years of SAP experience delivering complex supply chain transformation projects enabled by SAP S/4HANA and SAP Ariba.

 

This post was originally published 6/2025.

Recommendation

Integrating Materials Management in SAP S/4HANA
Integrating Materials Management in SAP S/4HANA

For seamless materials management, you need a connected landscape. Configure key MM integration points in SAP S/4HANA with this comprehensive guide! To start, set up your cross-functional organizational structures and master data. Then dive into step-by-step configuration for integrating MM with peripheral processes: sales and distribution, quality management, production planning, finance, and more. With details on connecting to external systems, this book is your one-stop shop for MM integration!

Learn More
SAP PRESS
by SAP PRESS

SAP PRESS is the world's leading SAP publisher, with books on ABAP, SAP S/4HANA, SAP IBP, intelligent technologies, SAP Business Technology Platform, and more!

Comments