Skip to Content
Author's profile photo Former Member

SAP XI Supports EDI X12

This article describes how to use SAP XI Conversion Agent to process EDI X12 messages.
It is the second part of a series of articles related to SAP XI Conversion Agent and EDI:

Part 1: SAP XI supports EDIFACT
Part 2: SAP XI supports EDI X12
Part 3: Handling EDI Exceptions with the SAP XI Conversion Agent
Part 4: SAP XI Conversion Agent Frequently Asked Questions



The X12 is the ANSI standard for exchanging EDI business transactions between organisations. X12 is used primarily within the US.
The X12 standard is the counterpart of the EDIFACT standard maintained by the International Standards Organization.
SAP XI supports both of these industry standards.

Outline of EDI X12 process in SAP XI


A standard X12 process within SAP XI can be decomposed as follows:

1. Receive the native X12 message via FTP or via a proprietary Value Added Network (VAN) protocol
2. Convert the native X12 message into XML X12
3. Map/Transform the XML X12 message into an XML Idoc message
4. Post the XML Idoc to a SAP SAP R/3


The process is illustrated in the diagram below:



EDI X12 and SAP XI Conversion Agent


The SAP XI Conversion Agent provides:

– a library of EDI X12 metadata required for the conversion and the mappings (see diagram steps 2 and 3)
– a tool to develop and deploy the conversion of native EDI X12 message into XML X12 (see diagram step 2)

The implementation consists in the following tasks:

– Create a Content Master Studio Project
– Deploy the Content Master Project to the XI Server
– Import the X12 schema to the XI repository
– Import the Idoc metadata into the XI repository
– Configure your flow into the XI Directory Objects


How to create a Content Master Studio Project


Create a CM Library Project:



Enter X12_850_Purchase_Order as the project name:



Select the purchase order message in the X12 library EDI_MSG_850_Purchase_Order. Make sure you select the parser object EDI_MSG_850_Purchase_Order_Parser:



The following project structure is created:



How to test the X12 conversion

In order to test the conversion with a sample EDI X12 file you set the parameter example_source to LocalFile and you browse to the location of your sample file:



You can test the parsing locally by selecting the menu option run :



You can check the generated output file and the event log:



How to create the transformation mapping from X12 to IDOC


First locate the X12 Purchase Order schema (xsd) available in the Content Master project:



You import the xsd as an external definition in SAP XI



Once imported,the X12 Purchase Order message structure is available as an external definition. It will be used as source document for the mapping.




This weblog was co-authored by Lionel Biennier and Béla Suranyi.

Assigned Tags

      You must be Logged on to comment or reply to a post.
      Author's profile photo Former Member
      Former Member
      Is it also possible the other way, From SAP to EDI X12 Partners. How can you create the EDI X12 file ? 
      Author's profile photo Former Member
      Former Member
      Yeah how can I export a purchase order from SAP to X12 format  from SAP Business One 2005A

      I'm about to code a module to make it  but I wanted to know a shorter way to achieve it

      They gave me 3 days to make it 🙂

      Author's profile photo Former Member
      Former Member there a way vice versa and perhaps in X25!? Does anybody have some experience with this?! I face an IDoc - XI - OFTP scenario (OFTP = Odette (X.25))

      thx for help!

      Author's profile photo Madhu Sudan Reddy B
      Madhu Sudan Reddy B

         Which versions of X12 files are supported using Item filed conversion (Either 4010 version or 4030 version).Is there any option that it supports both the versions.

        Thanks and Regards,