You are on page 1of 68

ALE AND IDOCS OVERVIEW

ALE
ALE is a business solution to a very real need emerging in the SAP
market. This is the need for businesses to move towards tighter
integration between systems, yet, at the same time, provide
independence to the various business units within the company.
In the past the move was towards centralized systems
Standardization of business processes accompanied by ever tighter
integration within the central system no longer represents a practicable
approach to this problem. The following are some of the most commonly
encountered difficulties:
technical bottlenecks
upgrade problems
the effect of time zones on international
Corporations
excessively long response times in large centralized
systems

The SAP Solution - ALE


SAP has provided ALE (Application Link Enabling) as the solution to these
issues. It allows you to:
Distribute your applications across several SAP systems,
such that centralized functions, as well as decentralized
functions can operate in the same company arena
Maintain and distribute master data elements from a central
system, thus maintaining unique number ranges across
several systems
Couple R/2 and R/3 systems, in some instances
Couple SAP and external systems, via IDocs (Intermediate
documents) and an external translation mechanism

How ALE Works?


ALE allows the user to perform an SAP transaction in the sending system,
after which the following steps occur:
One or more communication IDocs (intermediate documents: container for
the application data) are created in the sending system database. An ALE
distribution model, that needs to have been configured, determines which
systems the IDocs are to be sent
These communication IDocs, that contain the relevant application data of the
transaction that was performed, are then passed to the ALE communication
layer
This layer performs an RFC call using the port definition and RFC destination
determined through the customer model
The IDocs are then transferred to the respective receiving systems. These
could be SAP R/3, R/2 or external systems

IDoc INTERFACE
Business data is exchanged with an external system using the IDoc Interface.
The IDoc Interface consists of the definition of a data structure and a
processing logic for this.
The data structure is the IDoc. It is the exchange format that unites the
communicating systems. Using IDocs you can define an exception handling
within the R/3 System using SAP Business Workflow, without the need for the
data to already be an SAP application document.
You require the IDoc Interface in the following scenarios:
Electronic Data Exchange (EDI)
Application Link Enabling (ALE)
Linking to any other business application systems (for example, PC
applications, external workflow tools) using IDoc.

What is an IDoc ?
The term IDoc stands for Intermediate Document. Its not a
process. An IDoc is simply a data container that is used to
exchange information between any two processes that can
understand the syntax and semantics of the data.
An IDoc is created as a result of execution of an outbound ALE or
EDI process. In an inbound ALE or EDI process, an IDoc serves as
an input to create application document.
IDocs are independent of sending and receiving system. They
can be used for SAP to SAP and SAP to non-SAP process
communications as long as the participating processes can
understand the syntax and semantics of the data.

IDocs are independent of the direction of data exchange.An IDoc can


be used by an inbound as well as an outbound process.
For e.g the ORDERS01 IDoc is used by the purchasing module to
send a purchase order and is also used by the sales and distribution
module to accept a sales order. This avoids creating redundant IDoc
types for the same information.

ID o c C o n c e p t

A s y n c h ro n o u s

D o c u m e n t-r e la te d

S y s te m 2

S y s te m 1
SAP
Docum ent

 R /3 S y s te m

ID o c






EDI
R /3
R /2
3 rd

D ocum ent
T ra n s a c tio n
M essage

s u b s y s te m
S y s te m
S y s te m
p a rty s o ftw a re

S A P A G 1 9 9 9 I D o c E n jo y ( T h . B e c k e r ) / 5

The business data is saved in IDoc format in the IDoc interface and is
forwarded as IDocs. If an error occurs, exception handling is triggered
via workflow tasks. The agents who are responsible for these tasks and
have the relevant authorizations are defined in the IDoc interface.
The IDoc interface supports three types of data flow with the external
system:
Outbound Processing
IDocs are transferred to a receiving system from your SAP System
Inbound Processing
IDocs are transferred to your SAP System from an upstream system.
Status Processing
The receiving system confirms the processing status of outbound
Idocs to your SAP System.

IDoc Data Flow

Outbound
Application

Data
MM
SD
...

Message Control

IDoc Interface &


ALE Services

System 2
e.g. EDI subsy stem

Inbound
Application

Workflow

IDoc

File
tRFC
XML
...

IDoc Interface &


ALE Services

System 2
e.g. EDI subsy stem

SAP AG 1999 IDocEnjoy (Th. Becker) / 1

10

Outbound Data Flow

SAP Applicatio n
Document

Message Control (NAST)


Document

NAST
Record

IDo c Interface & ALE Services


IDoc

System 2, e.g. EDI subsystem

SAP AG 1999 IDocEnjoy (Th. Becker) / 9

11

Inbound Data Flow

System 2, e.g. EDI subsystem


IDoc

IDoc Interface & ALE Services


IDoc +
Process

SAP Business Workflow

IDoc +
Function Module

Document

SAP application

12

ADVANTAGES OF USING IDocs


For e.g Standard IDoc MATMAS01 is used to exchange material master information
with the legacy system in version 3.1G. Now the company decides to go in for a
version upgrade to 3.1H in which MATMAS01 has been enhanced .You can continue
to use the older version and then decide to switch to the enhanced IDoc later.
Ability to create and enhance IDocs
Using the standard tools ( IDoc editor and segment editor ) you can either enhance
standard SAP IDocs or create new IDocs in the system to support custom interface.
The newly developed IDocs integrate seamlessly into the standard ALE/ EDI interface
because they are developed using standard tools provided by the system. They also
become available in the standard list of SAP IDocs and can take advantage of all the
tools are designed like IDoc monitoring, error handling and archiving.

13

Following are the benefits of IDocs over Flat files.


Independence from Applications
The biggest advantage of using the IDoc interface is that its an open
interface i.e independent of the internal structure used by SAP to store
data and independent of sending and receiving applications.
Communication with Back-Level IDocs
The standard IDocs and the segments within the IDoc have a version
associated with them.Each time a standard IDoc or a segment is enhanced,
the system assigns it a newer version. Partner applications that were developed
using a previous version of the IDocs are fully supported.
SAP can generate and process back-level IDocs. This version management
technology offers backward compatibility.

14

Custom IDocs are distinguished from SAP IDocs by their names,


as they start with Z.
Standard Monitoring Tools
Several tools are available to monitor the state of the system. They
range from simple IDoc display to IDoc statistics.
IDoc type Documentation
Each IDoc in the system is thoroughly documented .The usage is
detailed down to the field level with possible values for each field and
how it affects the process.
The documentation of any IDoc can be obtained using transaction
WE60.
Archiving Tools
Tools are available for miscellaneous tasks such as archiving ,
data cleanup and restoring information back into SAP.

15

USE OF IDocs
EDI integration
EDI is electronic exchange of business documents between SAP and non-SAP systems.
Several applications ( purchasing, sales or shipping ) in SAP are enabled for EDI.
To use EDI first the application document viz.. purchase order is created. EDI interface
layer converts the application document into an IDoc which is transferred to an EDI
subsystem.The EDI subsystem translates the IDoc into an industry-standard format
and then transfers it to a business partner over a network.
ALE Integration
ALE (Application Link Enabling) enables the exchange of data between two SAP
systems.This system allows SAP businessprocesses and applications to be distributed
across multiple SAP systems.ALE ensures integration in a distributed SAP
environment.

16

OCR Application integration


OCR( Optical Character Recognition ) is a technology that scans and interprets printed
matter using pattern recognition. You can integrate an OCR application with SAP via
IDocs. Documents in a standard format can be scanned to generate IDocs, which
then can be transferred to the SAP system for processing.
ICR Application integration
Bar-code system is an example ICR ( Intelligent Character Recognition ) technology.
Data encoded using bar-codes can be captured and stored as an IDoc, which then
can be passed to SAP for further processing.

17

Comparing Flat File Structure


to
IDoc Structure

18

The best way to explain the IDoc architecture is to compare your legacy world to how
SAP implements the same concept in IDoc.

Lname(10)

Fname(10)

SSN(11)

Week no(1) Hrs worked(3)


Total hrs(3) Total amount(10)

DOB(8)

Hrly rate(3)

Employee header occurs once mandatory

Client site(20)

Work des.(50) Weekly details multiple

Summary once

Assume that you have an application that records an employees weekly hours .
At the end of the month, a file containing the monthly report data for each is
sent to external system. This application has been replaced by the SAP system ,
and a standard IDoc has been developed to support the process.

19

Following are some properties of the file:


It has three types of records: employee header information,
weekly details and monthly summaries.
Each record type has certain properties ,such as whether its
optional or mandatory, number of times it can be repeated,
field names, data type for each field, and length of each field.
The client site and work description in the weekly details is
not always available.

20

IDOC version of the flat file

ZMREPT01

Segments
Z1EMHDR
(M,1,1)
Z1WKDET
(O,1,99999)
Z1CLDET
(O,1,1)

Lname

We ek n o

Clsite

Fname

Hrly Rate

SS N

Dob

Tot Hrs

W or k de sc.

Z1SUMRY
(O,1,1)
Tot hrs

Tot amount

21

Comparison

Smith
1
2
3

John
30
30
30

123-45-6789
102668
40
Houston Brewery
40
Network Computers
50
Network Computers

Beer Testing
High Level Consulting
Programming

50

60

EDI Programming

140

6900

DSP Systems

An example of the monthly report file for one particular employee

22

IDoc DEFINITION COMPONENTS


Name:
A basic IDoc type can be assigned up to a thirty-character name in release 4.0
onwards. To encompass all releases we have used an 8 character name ZMREPT01.
Custom IDoc types always start with Z the last two character represents the version
number.After a basic IDoc type is released and you move to a newer version of the
SAP system, any changes to the structure of the basic IDoc type will create a new
basic IDoc type i.e the version number is incremented by 1.
Thus ZMREPT02 represents an enhanced version of this IDoc. Segments of a
previous version are never deleted. This is necessary to maintain backward
compatibility.

23

List of permitted segments:


These segments make up the IDoc structure. The current example has four segments:
Z1EMHDR, Z1WKDET , Z1CLDET and Z1SUMRY.

Arrangement of segments:
Arrangement specifies the physical sequence and any parent-child relationship in the
segments. A parent-child relationship signifies that the child segment cannot exist
without the parent and is commonly used for text segments. It gives an IDoc type a
hierarchical structure.

24

Mandatory versus Optional segments:


When used in an IDoc type,each segment has an attribute that defines whether the
segment is optional or mandatory.
In the example given, Z1EMHDR is a mandatory segment because the monthly report
will not make sense without the employees basic information.
Minimum / Maximum range for each segment:
Each segment has an attribute that defines the minimum and the maximum number
of times a data record corresponding to a segment can exist in an IDoc.
In the example given, data records corresponding to the Z1WKDET segment can
occur multiple times.

25

SEGMENTS
A segment defines the format and structure of a data record. Segments are reusable
components, which means they can be used in more than one IDoc type. A segment
consists of various fields that represent data in a data record.
Segment Components
A segment in the SAP system is technically implemented as three physically separate
pieces.
1) Segment type
This is version independent name of the segment. SAP provided segment types begin
with E1, whereas custom-defined segment types begin with Z1.
In the example Z1EMPHDR and Z1WKDET are segment types.

26

2) Segment definition
This is version dependent definition of a segment where you specify the fields that
belong to the segment. SAP segment definitions start with E2, whereas customer
segment definitions start with Z2.
The name of a segment definition is 10 characters long and is automatically assigned
by the system from the name of the segment type.
For e.g for the segment type E1EDKA1, the segment definition is
E2EDKA1.
The last three characters represent the version of the segment.The first segment
definition has spaces in last three characters.The last three characters are
incremented by 1 to reflect the new definition.

27

IDOC Definition Components


Segment definitions
Z2TEST

Z2TEST001

Z2TEST002

Field 1

Field 1

Field 1

Field 2

Field 2

Field 2

Field 3

Field 3

Field 3

Field 4

Field 4

Field 4

Field 5

Field 5
Field 6

28

3) Segment Documentation
This represents the data dictionary documentation for each field in the segment
definition.Segment documentation of SAP-provided segments begins with E3,
whereas the segment documentation of customer-defined segment types with Z3.
There is only one segment documentation per segment.

29

IDoc RUN TIME COMPONENTS:


Although there are several records in an IDoc,they are still classified as one
of the three record type.
Control Record
Data Record
Status Record
At run time the following events occur:A unique IDoc number is allocated.
One control record is attached to the IDoc.
Segments translate into data records.
Status records are attached.
Syntax rules are checked.

30

Structure of a Idoc type


Idoc are nothing but container of data for ALE and EDI process
It is basically a structured format for carrying data.
Idoc type is a Idoc structure without the data , at run time it is
called as Idoc.
Message type is mapped to a Idoc type.
Each Idoc type will have a inbound program and a Outbound
program. The program will create the particular Idoc.
Name

Segments (no. of segments will be present in Idoc , Segment


definition,Segment documentation,)
Segments are stored seperately
Segments can be mandatory or optional
Segment definition is 10 char Auto generated + 3 char for SAP
version (hence backward compatibility)

31

IDoc Record Types

Control Record

IDoc-ID
Sender-ID
Receiver-ID
IDoc type and logical message
External structure

Data Record

IDoc-ID
Sequence/Hierarchy
Segment
Format definition for
header data
item data

Status Record

IDoc-ID
Status information

SAP AG 1999 IDocEnjoy (Th. Becker) / 6

32

Transaction WE02 0r WE05 ( IDoc Display )


.

33

Control Record
As the name suggests contains all of the control information about an IDoc, this
basically includes IDoc number, sender and receiver information such as the
message type it represents and the IDoc type.
A control record can be compared to an envelope of a letter,by looking at the
envelope,you can identify the sender and the recipient.
It has following characteristics
There is one and only one control record per IDoc.
The structure of the control record is the same for all Idocs and is
defined by SAP.
It is stored in EDIDC table

34

Control Record as viewed by IDoc display tool

35

Data Records
In an IDoc, data records contain the application data.The employee header
information,weekly details,client details and summary information reside in
data records.
A data record has two parts: an administrative section and a data section.
Administrative section contains the segment name,segment number
and hierarchy level.
Data section is where the actual data resides.This is mapped to a
segment type.
Data records are stored in the EDIDD table.
The complete documentation of the data record can be viewed by
using transaction WE61.

36

Status Record
These are attached to an IDoc throughout the process as the IDoc achieves
different milestones.
At every milestone a status code,date and time are assigned.
The latest status code is also maintained in the control record.
Status records have following characteristics:Multiple status records are usually attached to an IDoc.
In outbound processes, after the IDoc is passed from SAP to the
subsystem,the subsystem generates the status records and passes
them to SAP.
For inbound processes,SAP generates the status records.
List of status code and there details can be seen by executing
transaction WE47.

37

Details of a status code WE47

38

ID o c T y p e s

C o n tro l R e c o rd
D a ta R e c o rd s
E1H D D O C
M

E1TLSUM

C
E1H D A D R
C

E 1 IT D O C

1
E 1 IT S C H

T re e o f S e g m e n ts

99

S ta tu s R e c o rd s

S A P A G 1 9 9 9 ID o c E n jo y (T h . B e c k e r) / 7

39

IDoc View Concept


z

An IDoc view is a selection of segmen ts of a g iven IDoc


type and is compatib le with the IDoc types syntax.

IDo c views are applied in outbound processing of


selected ap plications.

Advantages o f views:

Enhancing the performance by restricting the number of


tables read

Reducing the data volume in internal tables at run time

SAP AG 1999 IDocEnjoy (Th. Becker) / 10

40

ALE Configuration :1. Setting Up Clients


2. Defining Logical System Names for Clients
3. Defining Communication Parameters
4. Modeling the Distribution
5. Generating Partner Profiles in the Sending System
6. Distributing the Distribution Model
7. Generating Partner Profiles in the Receiving System
8. Creating Vendor Master Data
9. Sending Vendor Master Data
10.Checking Processing Status

41

Setting Up Clients
Set up two clients to enable communication between logical systems.
The two clients may be located in the same R/3 System or in
separate systems.
To set up a new client, from the SAP standard menu choose Tools ->
Administration -> Administration -> Client administration -> Client
maintenance.

Defining Logical System Names for Clients


The name of the logical system is used as the unique ID. This name
is assigned explicitly to one client in an R/3 System.
You can find the functions required for this in the R/3
Implementation Guide(SPRO) under BasisComponents -> Application
Link Enabling (ALE) under Sending and Receiving Systems -> Logical
Systems.

42

SETTING UP CLIENTS

43

DEFINING LOGICAL SYSTEMS FOR CLIENT

44

ASSIGNING LOGICAL SYSTEMS TO CLIENT

45

46

Defining the Communication Parameters


For the two logical systems to be able to communicate with one another, they
must know how to connect to each other. The RFC destination provides this
information.
In each of the two clients, you must assign the RFC destination for the other
logical system. In Customizing for ALE choose Sending and Receiving Systems
-> Configure Systems in Network -> Define RFC Destination.
Execute the function.
Choose Create.
Enter the RFC destination:
Use the name of the logical system that is to be the destination
(use UPPERCASE letters).

47

DEFINING THE COMMUNICATION PARAMETERS

48

49

Modeling the Distribution


Logon to the logical system from which you want to send materials to
another system (sending system LOGSYS010) .
From the R/3 Implementation Guide screen, choose Basis ->
Application Link Enabling (ALE) -> Modeling and Implementing
Business Processes -> Maintain Distribution Model.
Create the model view. Select Create model view. Enter the technical
name VENDMODEL and a description for it.
Define the sending and receiving systems and the message type.
Position the cursor on VENDMODEL and select Add message type.
A dialog box appears.
Enter the logical system name of the sender LOGSY010 and the
receiver LOGSY500 and the message type CREMAS .
Save the distribution model.

50

CREATING A MODEL VIEW

51

Generating Partner Profiles in the Sending


System
First, generate the partner profiles in the sending system (LOGSY010). To do
this, log on to the relevant logical system.
In the R/3 Implementation Guide under Basis, choose:
Application Link Enabling (ALE)
-> Modeling and Implementing Business Processes
-> Partner Profiles and Processing Time
-> Generate Partner Profiles
Enter VENDMODEL as the name of your distribution model.
Without changing the parameters proposed by the system, execute the
program.
The partner profiles required have now been generated on the sending
system.

52

GENARATING PARTNER PROFILES IN SENDING SYSTEM

53

Distributing the Distribution Model


Transport the distribution model views from the sending system to the
receiving system.
Carry out the following steps in the sending system:
In the R/3 Implementation Guide under Basis Components, choose:
Application Link Enabling (ALE)
-> Modeling and Implementing Business Processes
-> Maintain Distribution Model
Edit -> Model View -> Distribute.
Enter the model view VENDMODEL .
Select LOGSY500 , the name of the receiving logical system.
Execute the program.
Your distribution model view will be copied to the receiving system.

54

DISTRIBUTING THE MODEL VIEW

55

Generating Partner Profiles in the Receiving


System

you have copied the distribution model to the receiving system, you can also
generate the partner profiles here. To do this, log on to the receiving logical
system (for example, LOGSY500 ).
In the R/3 Implementation Guide under Basis Components, choose:
Application Link Enabling (ALE)
-> Modeling and Implementing Business Processes
-> Partner Profiles and Processing Time
-> Generate Partner Profiles
Enter the name of your distribution model view, in this case,
VENDMODEL.
Without changing the parameters proposed by the system, execute the
program.
The required partner profiles will be generated in the receiving system.

56

GENARATING PARTNER PROFILES IN RECIEVING SYSTEM

57

Creating Vendor Master Data


Once you have made all the settings required to distribute materials, you can
create a material and then distribute it.
Log on again to the sending system and follow these steps:
Choose the transaction XK01 for entering vendor details

58

Sending Vendor Master Data

You are now going to send the vendor you have just created to the receiving
system.
Choose TOOLS-> ALE -> MASTERDATADISTRIBUTION ->
-> CROSS APPLICATION-> VENDOR -> SEND
Enter the vendorl you have created (for example, Vendor001).
Use CREMAS Message type:
Enter LOGSY500, the logical receiving system
Execute the program.
You should now be able to display your vendor in the receiving system. If the
material is not available here, either the transmission has not yet finished or an
error has occurred. The next step shows you how to check the communication
and detect any errors.

59

SENDING VENDOR MASTER DATA

60

Checking Processing Status


The system provides functions for monitoring communication. These
functions enable you to confirm whether ALE messages have been
processed and transferred correctly or whether errors occurred. If an error
did occur, the type of error is indicated.
You can monitor the processing status in both the sending system and the
receiving system. Choose Tools -> ALE -> Administration -> Monitoring ->
Status monitor for ALE messages.
Execute the function, and select the IDocs of the logical message type
MATMAS which you created today.
A list of inbound and outbound IDocs grouped by status is displayed:

61

A list of inbound and outbound IDocs grouped by status is displayed:

OUTBOUND IDocs
Status
03, 12, 38

Description of Status
IDoc successfully transferred

02, 04, 05, 25 ,26, 29

Processing error

30

Waiting status (still processing...)

>=50

Inbound IDoc (not relevant in this


context)

Other

Not relevant in this context

62

63

INBOUND IDocs
Status
53

Description of Status
IDoc successfully updated by application

64

Waiting status (still processing...)

<50

Outbound IDoc (not relevant in this context)

51, 56, 60, 61,

Inbound error

63, 65
Other

Not relevant in this context

64

65

To display a list of IDocs with a particular status, double-click on a line.


For detailed information on one of these IDocs, double-click on it. If an
error occurs, you can display information about the cause of it by
choosing Process -> Incorrect segments.

Error Handling
If an error has occurred, use the monitoring function to resolve it. The
cause of the error is likely to be a value in your material that the
receiving system does not know and therefore cannot process it. Try to
eliminate the cause of the error and send your material again.
If your IDoc in the sending system was successfully transferred (status
03) but does not appear in the receiving system, a technical
communication error is the likely cause. You can use the status monitor
in the sending system to check this. Choose Goto -> Transactional RFC
-> Display calls.
If an error occurs you should consult your system administrator.

66

Transaction codes for ALE and IDoc:SALE


SM59
BD64
BD82
BD10
BD11

for defining and assign logical systems


RFC destination
Customer distribution model.
Generating Partner Profile
Sending Material
Getting the material

WE31
WE30
WE41
WE40
WE81

Segment creation
Idoc Type creation
Process code for Outbound
Process code for Inbound
Creating Message types

67

Thanks

68

You might also like