The business process shown above depicts an SAP cycle that involves ALE model to exchange business
data like
Purchase Order / Order - Message Type ORDERS
Order Confirmation
Order change
IDOC acts as a standard SAP interface to exchange business data through ALE. From an SAP
system, an IDOC can be sent to and received from
An EDI subsystem
IDOC Type defines the structure and format in which the data is exchanged.
It is similar to a structure in SAP
Segments IDOC data is arranged in Rows, The rows make up segments of an IDOC. Each
segment consists of fields/segments. Fields can contain data.
Message type is a name given, that tells us what type of business data is being exchanged.
Where the IDOC Type represents the data format. While the message tells us the purpose of data
being sent
PROCESS CODE
The process code contains the details of the Function Module that are used for IDoc processing.
Message Type can be linked to the Process code.
PORT
IDoc Port contains the information about the way data is sent between the source or target system.
The type of port defines the information contained within the port. For port type Internet Port will
contain IP address of the target system. For port type file, directory or file name information is
maintained. tRFC port contains information about the RFC destination of the target system. For
IDoc transmission using ALE tRFC ports are used.
IDOC DIRECTION
In SAP Outbox direction is represent by 1 i.e. outbox and Inbox direction is represented by 2.
PARTNER TYPE
Partner type/role is used to identify partners within the sap systems. Partner type is KU for customer,
LI for vendor and LS for Logical System.
IDOC EXTENSION
Basic type contains all the standard fields that are necessary for carrying out a business transaction.
However, if any additional values are to be sent to the partner then we can make use of the IDoc
Extension feature. IDoc extension is extension of basic type and contains additional custom IDoc
segments and fields that are not available in standard basic type.
IDOC Type & Segments
An IDOC Type defines the syntax(arrangement) of the data permitted segments and their
arrangements mandatory/optional segments.
ALE:-
Application link enabling is SAPs terminology, used to integrate business processes between R/3
Systems and non-R/3 systems.
ALE is the technology used to transfer business data between different systems using IDOCs /
BAPIs.
*IDOC is the container for the business data and ALE is the technology which builds the road for
data transfer.
For example to send Employee Data to Payroll department from HO, HO will populate Employee
detail into the EMPINFO01 format(IDOC). ALE settings will determine who is the receiver, how
to connect to the receiver and transmits the data.
SAP Business units (Sales Unit & production Unit) can use ALE for internal data exchange.
ALE is SAP Technology to send and receive business data in SAP Systems.
Container for the data is IDOC.
Advantages of ALE:
Reduced Paperwork
Reduced Cost
The below are the basic configuration steps involved in exchanging the business data between
two systems in distribution service layer.
Logical Systems
( TCode SALE ) - Logical System is a name given to uniquely
identify, the systems involved in data exchange. Logical Systems (LS) represent R/3 or
external systems in the SAP R/3 environment for the distribution of data. A client of an
SAP instance is represented by a logical system in the ALE context. This logical system
will act as sender or receiver of IDOCs.
Partner Type - Partner type are used to classify the business system.
Ex: Logical System (LS) for other SAP clients,
RFC Connections
Distribution Model ( TCode BD64 ):- Distribution Model A model that describes the
ALE message flow between logical systems. Applications and the ALE distribution
service layer use the model to determine receivers and to control the data distribution.
The relationships between logical systems, message types, BAPIs and filters are defined
in the distribution model.
Sender Logical System EC1CLNT800, Receiver Logical System SALES, Message Type
CREMAS, No filter conditions defined.
( TCode WE82 )
( TCode WE20 )
Ports ( TCode WE21 ):- Ports are a logical representation of the communication
channels in SAP. R/3 defines four types of ports viz. tRFC (transactional Remote
Function Calls), File, R/2, and Internet. tRFC ports once created are assigned to RFC
destination. ALE can use all port types to distribute IDOCs.
Process Code:
Process Codes are used to identify the function module or API (Application Programming
Interface) to be invoked for subsequent processing (Outbound or Inbound) of the business
application.
Outbound process code - Outbound process code under Message Control, generated the IDOC in
the IDOC Interface. The process code determines the relevant function module. (TCode WE41)
Inbound process Code - names the function module or workflow which reads the IDOC data and
transfers the data to the application document. (TCode WE42)
Outbound process codes are stored in table TEDE1, while inbound process codes are stored in
TEDE2.
Applications services: This layer provides ALE with an interface (for instance: IDOCs/BAPI) to
facilitate data exchange to or from external R/3 systems.
Ex: A program that collects Master / Transactional data to send to its partner system.
Distribution services: This service is the core in ALE model. Distribution model is used to
identify the receivers (partners) to which the data is to be exchanged. It acts as a sandwich layer
between application and communication layer.
* The onus of filtering and converting messages exchanged between SAP and non-SAP systems
is on the distribution layer of ALE.
The communication layer performs a remote function call using the port definition and
RFC destination specified by the customer model.
EDI:
Business data
Head Quarters
Suppliers
e
sin
Bu
ta
da
ss
Business data
Business data
Customer
Business data
Sales Office
Production
IDOC
EDI Subsystem
File
(Vendor
Format)
EDI is a standard format for exchanging business data between any 2 systems on different
networks .
Any two systems that use different data formats , and need to communicate with each other can
use EDI.
In case of EDI , EDI being a standard format .Any data format can be converted to universal EDI
format.
In case of SAP , IDOCs from SAP can be converted to EDI format. This is useful and is widely
used for communication with customers and vendors (non-SAP ) who do not understand IDOC
format .
EDI subsystem is needed for communication between 2 systems. This translates the data into
standard EDI format that is understood by receiver / sender system.
EDI uses either ANSI X12 or EDIFACT as standard formats in the data exchange.
In SAP communicating partners are not defined as logical systems for EDI. They have partner
types like KU-Customer, LI-Vendor etc...which uses a file port.
EDI subsystem:- A system that converts the SAP standard IDoc into an EDI standard such as EDIFACT or
ANSI X12, and vice versa.
IDOC Processing:
The IDOC Interface supports three types of data flow with the external system.
Outbound processing - IDOCs are transferred to a receiving system from the SAP
System.
Inbound processing - IDOCs are transferred to the SAP System from a sender system.
Status processing - The follow-on system confirms the processing status of outbound
IDOCs to the SAP System.
Outbound Processing
Inbound Processing
Each layer in ALE model has its own functionality starting from application layer -> distribution
layer -> communication layer in processing outbound IDOCs when message types are used to
transfer data asynchronously.
Application Layer - An application FM creates a master IDOC in outbound processing. This layer
fills the data record of IDOC.
ALE service Layer The Master-IDOC will travel through ALE layer for Receiver Determination
Data Selection, Segment Filtering, Data Conversion, Version Control and dispatch control. This
layer fills the control record of the IDOC and generates a communication IDOC.
Communication Layer - The formatted IDOC is passed to the communication layer from where it
is sent to the system (server) that was called via a tRFC (for SAP systems) or file interfaces (for
example, EDI).
IDOC - Control Record:- The format of the control record is similar for all IDOC types.
IDOC Status Records:- The status record shows the information regarding the processed stages
and processing stages of the IDOC. It attains appropriate statuses during its journey from one
system to another and it has identical format for each IDOC type.
Distribution service layer and Communication service layer add these statuses on the status
record, describing various phases of processing.
Trigger
Application
Port (WE21)
Others
Partner Profile - Defines the partner type with whom you communicate asynchronously via
IDOCs. This has to be maintained in the partner profiles configuration TCode WE20.
A port is created to assign in the outbound partner profiles. This port must be configured
already.
Inbound processing:
IDOC Structure, Service Programs, Partner Profile (derives from control record), Posting
Programs, Configuration Tables
Process Flow
Inbound Process Flow:Each layer in ALE model has its own functionality starting from application layer -> distribution layer
-> communication layer in processing inbound IDOCs to post the application data.
Communication Layer This layer receives the communication IDOC structure from the remote system
to post the application data.
ALE service Layer This layer can perform Segment Filtering, Field Conversion, Serialization and
Transfer Control on the communication IDOC structure.
Application Layer The posting program or process code calls the FM to finally post the document to the
database.
Partner Profile Inbound:The below screen shot depicts the message type, inbound process code and posting function module for
vendor master data.
The diagram depicts the business process flow between a customer and a vendor in common manufacturing
industries.
To automate the process in exchanging the business data between these partners we can configure the ALE model
with standard messages defined by SAP as shown like
Ex: QUOTES Quotation, ORDERS Purchase Order, ORDRSP Order Confirmation.
The diagram depicts the business process flow between a manufacturer and a supplier in an automotive industry.
To automate the process in exchanging the business data between the manufacturer and supplier standard
message type provided by SAP can be used in message exchange such as:
Ex: DELINS Delivery / JIT schedule, DELORD Delivery request, ORDRSP Order Confirmation.
The diagram depicts the business process flow between a Retailer and a consumer in a Retail Industry.
To automate the process in exchanging the business data between the manufacturer and distribution center
standard messages types provided by SAP can be used in message exchange such as:
Ex: PRICAT Price List / Catalogue, PROACT Stock & Sales Data, ORDRSP Order Confirmation
SALE
Logical Systems
RFC Connections
( TCode SM59)
Distribution Model
( TCode BD64)
Message Type
Ports
IDOC Type
( TCode SALE)
(TCode WE81)
(TCode WE20)
(TCode WE21)
(TCode WE30)
IDOC Segment
(TCode WE81)
(TCode WE82)
IDOC Monitoring
(TCode WE02)
ALE Monitoring
(TCode BD87)
(TCode WE30)
BAPI:Think of the pre-ERP universe as a series of small lakes, some connected, some not. Each lake (company) is filled
with data. Occasionally, boats venture from the shore to the middle of the lake for some data. Occasionally, one of
these
boats
transfers
data
from
one
lake
to
another.
With the advent of ERP, a canal systemSAP R/3is installed. A vast network of bidirectional waterways takes the
place of the lakes. Small, powerful ships and barges populate these waterways, keeping data in constant motion.
For the SAP consultant, IDocs are the barges. And Business Application Programming InterfacesBAPIsare the
small, powerful ships that keep these barges of data moving.
BAPI is Business Application Programming Interface and has the role as communication platform for developing
applications, e.g. booking material documents from flat files, see more in trx BAPI.
BAPI - Business Application - commonly a function module that is normally RFC enabled as well and acts as a
method of a business object. For example, Sales Order as the business object with a method of create - the BAPI is
BAPI_SALESORDER_CREATEFROMDAT2.
BAPI/RFC Interface
A remote function call is a call to a function module running in a system different from the caller's.
The remote function can also be called from within the same system (as a remote call), but usually caller and callee
will be in different systems.
In the SAP System, the ability to call remote functions is provided by the Remote Function Call interface system
(RFC). RFC allows for remote calls between two SAP Systems (R/3 or R/2), or between an SAP System and a nonSAP System.
RFC consists of the following interfaces:A calling interface for ABAP programs
Any ABAP program can call a remote function using the CALL FUNCTION...DESTINATION statement. The
DESTINATION parameter tells the SAP System that the called function runs in a system other than the caller's.
RFC communication with the remote system happens as part of the CALL FUNCTION statement.
RFC functions running in an SAP System must be actual function modules, and must be registered in the SAP System
as "remote".
When both caller and called program are ABAP programs, the RFC interface provides both partners to the
communication. The caller may be any ABAP program, while the called program must be a function module
registered as remote.
Calling interfaces for non-SAP programs
When either the caller or the called partner is a non-ABAP program, it must be programmed to play the other partner
in an RFC communication.
To help implement RFC partner programs in non-SAP Systems, SAP providesExternal Interfaces
RFC-based and GUI-based interfaces can be used by external programs to call function modules in SAP R/2 or R/3
systems and execute them in these systems.
Vice versa, ABAP programs in R/2 or R/3 can use the functions provided by external programs via these interfaces.
M<reward if useful>
BAPI interface technology forms the basis for the following developments:
Connecting:
New R/3 components, for example, Advanced Planner and Optimizer (APO) and Business
Information Warehouse (BW).
Non-SAP software
Legacy systems
Isolating components within the R/3 System in the context of Business Framework
Distributed R/3 scenarios with asynchronous connections using Application Link Enabling (ALE)
Connecting R/3 Systems to the Internet using Internet Application Components (IACs)
PC programs as frontends to the R/3 System, for example, Visual Basic (Microsoft) or Visual Age
for Java (IBM).
The interface concept of the classic R/3 is based on two different strategies: Remote Function Calls (RFC) and data
exchange through IDoc message documents. RFC makes direct and synchronous calls of a program in the remote
system. If the caller is an external program it will call an RFC-enabled function in R/3 and if the calling program is
the R/3 system it will call an RFC-function in another R/3-system or it will call a non-R/3 program through a
gateway-proxy (usually rfcexec.exe). BAPIs are a subset of the RFC-enabled function modules, especially designed
as Application Programming Interface (API) to the SAP business object, or in other words: are function modules
officially released by SAP to be called from external programs.
IDocs are text encoded documents with a rigid structure that are used to exchange data between R/3 and a foreign
system. Instead of calling a program in the destination system directly, the data is first packed into an IDoc and then
sent to the receiving system, where it is analyzed and properly processed. Therefore an IDoc data exchange is always
an asynchronous process. The significant difference between simple RFC-calls and IDoc data exchange is the fact,
that every action performed on IDocs are protocolled by R/3 and IDocs can be reprocessed if an error occurred in one
of the message steps.
While IDocs have to be understood as a data exchange protocol, EDI and ALE are typical use cases for IDocs. R/3
uses IDocs for both EDI and ALE to deliver data to the receiving system. ALE is basically the scheduling mechanism
that defines when and between which partners and what kind of data will be exchanged on a regular or event triggered
basis. Such a set-up is called an ALE-scenario.
The philosophical difference between EDI and ALE can be pinned as follows: If we send data to an external partner,
we generally speak of EDI, while ALE is a mechanism to reliable replicate data between trusting systems to store a
redundant copy of the IDoc data. The difference is made clear, when we think of a purchase order that is sent as an
IDoc. If we send the purchase order to a supplier then the supplier will store the purchase order as a sales order.
However, if we send the purchase order via ALE to another R/3 system, then the receiving system will store the
purchase order also as a purchase order.
Partner profile contains parameters for Inbound and Outbound processing of IDocs. For each message type we can
maintain, inbound/outbound options, message control, post processing options and contact information within
Inbound and outbound parameters.
Change Message Indicator indicates whether the IDoc is sent as a notification of change. For example, Purchase
Order change messages are sent to vendor using EDI standard message type 860.
Separate message type should be triggered in the purchase order for PO change. Additional line with change message
type must be added in the Message control tab with change message indicator on.
For example, Message Type 850 is an EDI standard for Purchase Order IDoc and is linked to IDoc Message Type
Orders.
IDOC STRUCTURE AND RECORDS
STRUCTURE
IDoc structure is divided into Control Record, Data Records and Status records.
These records are stored in the transparent tables in SAP. These are EDIDC, EDID4 and EDIDS.
CONTROL RECORD (EDIDC)
It contains information such as IDoc number, direction, IDoc Status, Basic Type, Message Type, Partner
(Sender/Receiver), date and time of creation/update, Interchange File or ISA number, etc.
IDoc segment has fields that contain the data necessary for posting the documents.
Initial Status numbers are 64 for inbound and 03 for outbound. Successful status is 53 for inbound and 16 for
outbound IDocs.
The relationship between the IDoc and the application document can be found in two ways:
1. Relationship tab of IDoc
2. Relationship tab of Application Document, e.g. PO, SO, Material Document, etc.
The initial status of this IDoc will be 30, which after successful processing will convert into status 16.
A successful outbound IDoc will pass through all the above statuses in reverse order (01-03-18-06-12-16). Each status
represents an IDoc validation step. If an IDoc passes all the validations it would reach status 16. These different
validation steps for outbound IDocs are explained below:
IDoc can possibly fail at any of the above steps during validation.
An inbound IDoc goes through all the above statuses in reverse order (50-64-53).
IDOC PROCESSING
AUTOMATIC/IMMEDIATE PROCESSING
In this case, IDoc are processed immediately as they generated or added in the system. The check Transfer IDoc
immediately is selected in Outbound Options and Trigger Immediately is selected in Inbound Option. These
checks are generally used when the real time information exchange is necessary between two systems.
MANUAL PROCESSING
IDocs can also be manually processed using the TCODE BD87 in SAP.
REPROCESSING IDOCS
On the basis of IDoc statuses different programs can be used for reprocessing of failed IDocs. These are given below:
Debugging of IDocs can be done using by copying the IDocs using TCode WE19. WE19 is a test tool for Idocs
processing. WE19 copies the existing idoc and creates a new IDoc which can then be modified as per testing needs.
The newly generated IDoc can also be processed using BD87.
IDocs can be displayed in system via TCODE WE02 and WE05. If IDoc number is not known then search can be
made on the basis of IDoc Date, Direction, BASIC TYPE, MESSAGE TYPE, and PARTNER NUMBER. Partner
number can be found in the Output Messages of the documents.
IDoc search can also be made on the basis of ISA or Transfer file Reference.
Though, the IDoc failure may not be related to any of the above mentioned reasons, the best way to find the IDoc
error is to compare the existing IDoc with the good example. Good example IDoc can be easily searched with any of
the IDoc search methods as described above.