What is EDI? Electronic Data Interchange

Author:Murphy  |  View: 22268  |  Time: 2025-03-23 12:51:00

Electronic Data Interchange (EDI) is a standardized method of automatically transferring data between computer systems.

As the supply chain becomes more digital, effective data exchange has become a must-have for any major company.

Examples of supply chain systems communicating using EDI – (Image by Author)

In the complex network of suppliers and distributors, efficient data communication is critical.

As analytics experts, how can we use EDI technology to support the digital transformation of organizations?

They ensure the smooth flow of essential transactional data, such as purchase orders, invoices, shipping notices, and more.

EDI Application for Procurement Management – (Image by Author)

In this article, we will uncover the crucial role of Electronic Data Interchange (EDI) in driving supply chain operations and how it can empower data analytics.

We will illustrate how EDI messages translate into action in warehouse operations using Python scripts.

Summary
I. EDI for Supply Chain Management
  1. A must-have for any large business
  2. More than 60 years of history
  3. EDI Standards
  4. Supply Chain Processes that use EDIs
II. Data Interchange & Operational Management
  1. Warehouse Operations Simulation Model
  2. Build a simulation model with Python
III. Why is Business Intelligence Significant?
  1. What is the environmental impact of our operations?
  2. Become a data-driven green organization
IV. What's Next?
  1. EDI for ESG Reporting and GreenWashing
  2. Conclusion

What is EDI for Supply Chain Management?

This is a must-have for any large business.

Electronic Data Interchange (EDI) was created to facilitate efficient, reliable, and secure data exchange.

After several decades, it has deeply imposed itself as a must-have for any large modern business.

It facilitates the automatic transmission of business documents in a standardized format.

Examples of Application – (Image by Author)

This allows diverse systems to communicate using a common language.

  • A company wants to send a supplier a purchase order with item(s) information, quantity and expected delivery date.
  • A warehouse wants to inform a carrier that a pallet is ready to be picked
  • A store sends a replenishment order to a central distribution centre

More than 60 years of history

Developed in the late 1960s, EDI initially served to transmit shipping and transportation documents.

Brief History of the Electronic Data Interchange – (Image by Author)

Over the years, EDI expanded its capabilities to cover various industries, with more than 150k businesses focusing on supply chain management.

Considering the massive daily transactions, it is challenging to imagine international supply chains operating without EDI.

What are the EDI Standards?

EDI operates based on established standards used by different industries in multiple geographic locations.

A non-exhaustive list of standards by industry and geographic location – (Image by Author)

However, there are two predominant standards

  • ANSI X12: primarily used in North America
  • EDIFACT: created by the UN and used internationally

These standards define the string format and the information contained in EDI messages.

They are ensuring uniformity in data interpretation across various systems.

Example of a Purchase Order translated into an EDI Message – (Image by Author)

In the example above, a purchase order is translated into an EDI message for transmission.

  • Order is created by the purchasing team and received by the supplier
  • Order information includes customer, supplier, delivery address and date, invoice address and detailed information about ordered items
  • Invoicing, delivery and company information are mapped using IDs (Company ID, Location ID, …)

What are the Supply Chain Processes that use EDIs?

With the complexification of supply chain operations, EDI messages form the backbone of communication for critical events like:

  • Inbound shipment arriving at a warehouse
  • A pallet being put away
  • A picking order that is being executed
  • An outbound shipment that is cancelled

EDI messages keep the wheels of logistic operations turning.

To illustrate this idea, we will use Python to simulate creating and transmitting EDI messages for warehouse operational management.


Data Interchange & Operational Management

Design of a Warehouse Operations Simulation Model

In our Python script, we will replicate several warehousing processes from the angle of EDI message exchange.

  • Inbound shipment messages containing details like SKU and quantity
  • Putaway confirmations with SKUs and putaway locations
Logistic Operations – (Image by Author)

These messages enable synchronisation of the ERP and Warehouse Management systems (WMS), drive efficiency and reduce errors.

  • Message 1: informing the warehouse teams that a shipment is coming for inbound via the WMS (ERP -> WMS)
  • Message 2: warehouse teams inform the distribution planning team that the pallet has been put in stock and is ready to be ordered (WMS -> ERP)

Let's build our own EDI message simulation tool with Python.

Build a simulation model with Python

Let's simulate these message exchanges using the EDI norm ANSI X12

  1. Inbound: goods are received at the warehouse An EDI message (Warehouse Shipping Order – 940) notifies the warehouse of an incoming shipment and its details.

  2. Putaway: after receiving, goods are stored at a specific location A confirmation EDI message (Warehouse Stock Transfer Receipt Advice – 944) is returned to the ERP to confirm the putaway.

  3. Picking: for an order, items are picked from storage locations This EDI message (Warehouse Shipping Order – 940) can instruct the warehouse on which items to pick.

  4. Outbound: shipping to the customer An EDI message (Warehouse Shipping Advice – 945) is sent to the ERP to confirm that the goods have been shipped.

Here is the simplified version of the Python script,

# Author: Samir Saci
# Note: this script has been simplified for educational purposes.

class EDIMessage:
    def __init__(self, message_id):
        self.message_id = message_id
        self.content = ""

    def add_segment(self, segment):
        self.content += segment + "n"

    def get_message(self):
        return f"ST*{self.message_id}*1n{self.content}SE*2*1"

class Warehouse:
    def __init__(self):
        self.inventory = {}

    def receive_inbound(self, message):
        lines = message.content.split("n")
        for line in lines:
            if line.startswith("N1"):
                _, _, sku, quantity, unit = line.split("*")
                self.inventory[sku] = self.inventory.get(sku, 0) + int(quantity)
        print("Received Inbound Shipment:n", message.content)

    def process_putaway(self, sku):
        message = EDIMessage("944")
        if sku in self.inventory:
            message.add_segment(f"N1*ST*{sku}*{self.inventory[sku]}*units")
            print("Putaway Confirmation:n", message.get_message())
            return message
        else:
            print("SKU not found in inventory.")

    def process_picking(self, message):
        lines = message.content.split("n")
        for line in lines:
            if line.startswith("N1"):
                _, _, sku, quantity, unit = line.split("*")
                if self.inventory[sku] >= int(quantity):
                    self.inventory[sku] -= int(quantity)
                else:
                    print(f"Insufficient quantity for SKU {sku}")
        print("Processed Picking Order:n", message.content)

    def process_outbound(self, picking_message):
        message = EDIMessage("945")
        lines = picking_message.content.split("n")
        for line in lines:
            if line.startswith("N1"):
                _, _, sku, quantity, unit = line.split("*")
                message.add_segment(f"N1*ST*{sku}*{quantity}*boxes")
        print("Outbound Shipment Confirmation:n", message.get_message())
        return message

Initiate the model and create your inbound order

  • Two different SKUs received in cartons
  • {Qty 1: 50 boxes, Qty 2: 40 boxes}
# Initiate the model
warehouse = Warehouse()

# Inbound Process
inbound_message = EDIMessage("940")
inbound_message.add_segment("N1*ST*SKU123*50*boxes")
inbound_message.add_segment("N1*ST*SKU124*40*boxes")
warehouse.receive_inbound(inbound_message)
print("Inventory of {}: {} boxes".format("SKU123",warehouse.inventory["SKU123"]))
print("Inventory of {}: {:,} boxes".format("SKU124",warehouse.inventory["SKU124"]))

And the output looks like this,

N1*ST*SKU123*50*boxes
N1*ST*SKU124*40*boxes

Inventory of SKU123: 50 boxes
Inventory of SKU124: 40 boxes
  • The two messages that have been transmitted
  • Inventories of received items have been updated with the received quantity

Putaway confirmation

# Putaway Process
warehouse.process_putaway("SKU123")
  • This message sends a putaway confirmation for "SKU123"
ST*944*1
N1*ST*SKU123*50*units
SE*2*1

Picking orders and outbound shipments

  • The two SKUs are picked with quantities below their inventory level
# Picking Process (Picking goods for an order)
picking_message = EDIMessage("940")
picking_message.add_segment("N1*ST*SKU123*10*boxes")
picking_message.add_segment("N1*ST*SKU124*5*boxes")
warehouse.process_picking(picking_message)
print("Inventory of {}: {} boxes".format("SKU123",warehouse.inventory["SKU123"]))
print("Inventory of {}: {:,} boxes".format("SKU124",warehouse.inventory["SKU124"]))

# Outbound Process (Sending out goods)
warehouse.process_outbound()

Output,

N1*ST*SKU123*10*boxes
N1*ST*SKU124*5*boxes

Inventory of SKU123: 40 boxes
Inventory of SKU124: 35 boxes

ST*945*1
N1*ST*SKU123*10*boxes
N1*ST*SKU124*5*boxes
SE*2*1
  • 2 picking orders with 10 and 5 boxes for "SKU123" and "SKU124"
  • The inventory has been updated
  • The outbound orders are taking the quantities picked

How can we ensure smooth transmission?

Error Detection & Handling

We did not introduce this model for the sole purpose of coding.

The idea is to understand how to create various checks to handle errors when writing or reading messages.

EDI is not exempt from data quality issues like

  • Missing data, incorrect data format, invalid codes, …
  • Logical inconsistencies causing significant operational disruptions

Therefore, implementing robust data checks and validations is crucial for ensuring the accuracy and reliability of Electronic Data Interchange.

Example of error handling for receiving orders

def receive_inbound(self, message):
    lines = message.content.split("n")
    for line in lines:
        if line.startswith("N1"):
            try:
                _, _, sku, quantity, unit = line.split("*")

                # SKU or quantity is missing
                if not sku or not quantity:
                    print("Error: SKU or quantity missing.")
                    return

                # Quantity is an integer
                quantity = int(quantity)

               # Negative or zero quantities
                if quantity <= 0:
                    print("Error: Quantity must be positive.")
                    return

                self.inventory[sku] = self.inventory.get(sku, 0) + quantity
            except ValueError:
                print("Error: Incorrect data format.")
                return

    print("Received Inbound Shipment:n", message.content)

This piece of code is:

  • Checking if quantities are missing or not in the integer format
  • Verify that all quantities are positive
  • Raise an error if needed

What's next?

With Python, you can support your infrastructure team in automating testing to develop new EDI messages.


What are the Power of EDI for Data Analytics?

By connecting diverse computer systems, EDI supports daily operations and serves as a veritable goldmine for data analytics.

Each EDI transaction carries valuable information,

  • Time stamps, locations and reason codes that provide traceability of your shipments and measure process(es) performance
  • Quantity, Pricing, and Item information that can be used to model material, financial and information flows

Generate transactional data to monitor and improve a supply chain network.

What is Supply Chain Analytics? – (Image by Author)

This valuable source of data can be used to

  • Describe past events: Descriptive Analytics
  • Analyze defects and incidents: Diagnostic Analytics
  • Predict Future Events: Predictive Analytics
  • Design Optimal Processes and Decisions: Prescriptive Analytics

Let's dive deep into each type of analytics to understand how it relies on good EDI infrastructure.

Descriptive and Diagnostic Analytics

Descriptive analytics is about understanding what has happened in the past.

With a correct setup of EDI messages, we can map historical transaction data to gain insights into past performance.

Example of a Distribution Process Tracked with Time Stamps – (Image by Author)

For instance, EDI messages can be status-updated at each stage of your distribution chain.

  1. Each event is linked with a time stamp (from Order Creation to Store Delivery)
  2. Actual Time Stamps can be compared with Expected Time Stamps
  3. Delays can then be analyzed to find the root cause
Expected vs. Actual Time per Process – (Image by Author)
  • Expected Times are calculated using target lead times agreed upon with operational teams
  • ERP, WMS, Freight Forwarder Systems and Store Management Systems are all communicating timestamps using EDI

You can collect and process these time stamps to create automated reports tracking the shipments along the distribution chain.

Tags: Data Science Logistics Notes From Industry Python Supply Chain

Comment