. 1
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
technical bottlenecks
upgrade problems
the effect of time zones on international
Corporations
excessively long response times in large centralized systems
. 2
The SAP Solution - ALE
SAP has provided ALE (Application Link Enabling) as the solution to these
issues. It allows you to:
. 3
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
. 4
IDOC INTERFACE
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.
A s y n c h ro n o u s
D o c u m e n t - r e la t e d
S ys t e m 1 S y ste m 2
1 R 13 S y s te m 1 EDi s u b s y s te m
1 R 13 S y s te m
1 R 12 S y s te m
1 3 rd p a rty s o ftw a re
S A P A G 1999 ID o c E n jo y ( T h . B e c k e r ) / 5
. 8
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.
. 9
IDOC Data Flow
Application MM Application
SD
...
. 10
Outbound Data Flow
SAP Applicatio n
Document
IDO
C
. 11
inbound Data Flow
IDO
C
IDOC +
Process
Docu me nt
SAP application
ADVANTAGES OF USING IDOCs
For Eg. 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.
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.
Following are the benefits of IDOCs over Flat files.
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.
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.
Custom IDOCs are distinguished from SAP IDOCs by their names, as they start with
Z.
Several tools are available to monitor the state of the system. They range from simple
IDOC display to IDOC statistics.
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.
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 business processes and applications to be
distributed across multiple SAP systems.ALE ensure integration in a distributed SAP
environment.
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.
. 17
Comparing Flat File Structure
to
IDOC Structure
The best way to explain the IDOC architecture is to compare your legacy world to how
SAP implements the same concept in IDOC.
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:
. 20
IDOC version of the flat file
ZMREPT01 Segments
Lname Fname SS N Dob
Z1EMHDR
(M,1,1)
Z1WKDET
We ek n o Hrly Rate Tot Hrs
(O,1,99999)
Z1CLDET
(O,1,1)
Clsi te W or k de sc.
Z1SUMRY
(O,1,1)
Tot hrs Tot amount
21
Comparison
140 6900
An example of the mon thly report file fo r o ne par ticular emp loyee
. 22
IDOC DEFINITION COMPONENTS
Name:
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.
. 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.
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 a
reusable component, 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
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.
. 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.
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
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.
. 29
IDOC RUN TIME COMPONENTS:
Although there are several records in an IDOC, they are still classified as
one of the three record types.
Control Record
Data Record
Status Record
. 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 separately
Segments can be mandatory or optional
Segment definition is 10 char Auto generated + 3 char for SAP
Version (hence backward compatibility)
ID OC R eco rd Types
. 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.
. 34
Control Record as viewed by IDOC display tool
. 35
Data Records
A data record has two parts: an administrative section and a data section.
. 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.
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 t ro l R e c o rd
D a ta R e c o rd s
E 1H D D O C E1TLSUM
M 1 C 1
E 1H D AD R E 1 iT D O C
C 5 M 1
E 1 iT S C H
T r e e o f S e g m e n ts C 99 C 5
S ta tu s R e c o rd s
. 39
IDOC View Concept
. 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.
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) .
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.
. 50
CREATING A MODEL VIEW
. 51
Generating Partner Profiles in 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
. 62
. 63
INBOUND IDOCs
. 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:-